diff --git a/custom_components/zaptec/config_flow.py b/custom_components/zaptec/config_flow.py index fa8fb79..ba53961 100644 --- a/custom_components/zaptec/config_flow.py +++ b/custom_components/zaptec/config_flow.py @@ -11,6 +11,7 @@ _LOGGER = logging.getLogger(__name__) + class ZaptecFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): """Config flow for Blueprint.""" @@ -35,7 +36,6 @@ async def async_step_user( vol.Required("username", default=""): str, vol.Required("password", default=""): str, vol.Optional("scan_interval", default=30): vol.Coerce(int), - } placeholders = { @@ -47,15 +47,18 @@ async def async_step_user( if user_input is not None: valid_login = False try: - valid_login = await Account.check_login(user_input["username"], user_input["password"]) + valid_login = await Account.check_login( + user_input["username"], user_input["password"] + ) except aiohttp.ClientConnectorError: errors["base"] = "connection_failure" except AuthorizationFailedException: errors["base"] = "auth_failure" if valid_login: - return self.async_create_entry(title=DOMAIN.capitalize(), data=user_input) - + return self.async_create_entry( + title=DOMAIN.capitalize(), data=user_input + ) return self.async_show_form( step_id="user", diff --git a/custom_components/zaptec/const.py b/custom_components/zaptec/const.py index ff3e291..1d8c401 100644 --- a/custom_components/zaptec/const.py +++ b/custom_components/zaptec/const.py @@ -1,5 +1,5 @@ NAME = 'zaptec' -VERSION = '0.0.1' +VERSION = '0.0.2' ISSUEURL = 'https://github.com/custom-components/zaptec/issues' STARTUP = """ diff --git a/custom_components/zaptec/sensor.py b/custom_components/zaptec/sensor.py index 9d09608..4f01f64 100644 --- a/custom_components/zaptec/sensor.py +++ b/custom_components/zaptec/sensor.py @@ -13,10 +13,6 @@ from .misc import to_under _LOGGER = logging.getLogger(__name__) - -#PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(SENSOR_SCHEMA_ATTRS) - - SCAN_INTERVAL = timedelta(seconds=60) @@ -32,12 +28,7 @@ async def _update_remaps() -> None: OBSERVATIONS_REMAPS.update({value: key for key, value in v.items()}) - async def _dry_setup(hass, config, async_add_entities, discovery_info=None): -#async def async_setup_platform( -# hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None -#) -> None: - sensors = [] acc = hass.data[DOMAIN]["api"] @@ -67,11 +58,11 @@ async def cb(data): return True + async def async_setup_platform( hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None ) -> None: return True - #return await _dry_setup(hass, config, async_add_entities, discovery_info) async def async_setup_entry(hass, config_entry, async_add_devices): @@ -201,7 +192,6 @@ def device_info(self): "manufacturer": DOMAIN, } - @property def device_state_attributes(self) -> dict: return self._attrs