Skip to content

Commit

Permalink
code cleanup, fix removal
Browse files Browse the repository at this point in the history
  • Loading branch information
myTselection committed Apr 14, 2023
1 parent 338f99f commit dfb4832
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion custom_components/carbu_com/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b

async def async_remove_entry(hass, config_entry):
try:
await hass.config_entries.async_forward_entry_unload(config_entry, PLATFORMS)
await hass.config_entries.async_forward_entry_unload(config_entry, Platform.SENSOR)
_LOGGER.info("Successfully removed sensor from the integration")
except ValueError:
pass
6 changes: 3 additions & 3 deletions custom_components/carbu_com/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def create_schema(entry, option=False):
return data_schema


class Mixin:
class Validator:
async def test_setup(self, user_input):
client = async_get_clientsession(self.hass)

Expand Down Expand Up @@ -107,7 +107,7 @@ async def test_setup(self, user_input):



class ComponentFlowHandler(Mixin, config_entries.ConfigFlow, domain=DOMAIN):
class ComponentFlowHandler(Validator, config_entries.ConfigFlow, domain=DOMAIN):
"""Config flow for component."""

VERSION = 1
Expand Down Expand Up @@ -148,7 +148,7 @@ async def async_step_import(self, user_input): # pylint: disable=unused-argumen
# return ComponentOptionsHandler(config_entry)


class ComponentOptionsHandler(Mixin, config_entries.ConfigFlow):
class ComponentOptionsHandler(Validator, config_entries.ConfigFlow):
"""Now this class isnt like any normal option handlers.. as ha devs option seems think options is
# supposed to be EXTRA options, i disagree, a user should be able to edit anything.."""

Expand Down
2 changes: 1 addition & 1 deletion custom_components/carbu_com/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/myTselection/carbu_com/issues",
"requirements": ["bs4", "html5lib"],
"version": "2.1.0"
"version": "2.1.1"
}

0 comments on commit dfb4832

Please sign in to comment.