From cea76d178e21ed87ddca722b27ac350175c974bf Mon Sep 17 00:00:00 2001 From: Mick Date: Sun, 7 Jan 2024 21:23:28 +0000 Subject: [PATCH] Code improvements --- custom_components/sagemcom_fast/__init__.py | 2 +- custom_components/sagemcom_fast/config_flow.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/sagemcom_fast/__init__.py b/custom_components/sagemcom_fast/__init__.py index 5aa427c..3c22415 100644 --- a/custom_components/sagemcom_fast/__init__.py +++ b/custom_components/sagemcom_fast/__init__.py @@ -140,7 +140,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: return unload_ok -async def update_listener(hass: HomeAssistant, entry: ConfigEntry): +async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None: """Update when entry options update.""" if entry.options[CONF_SCAN_INTERVAL]: data: HomeAssistantSagemcomFastData = hass.data[DOMAIN][entry.entry_id] diff --git a/custom_components/sagemcom_fast/config_flow.py b/custom_components/sagemcom_fast/config_flow.py index b73c989..4b64225 100644 --- a/custom_components/sagemcom_fast/config_flow.py +++ b/custom_components/sagemcom_fast/config_flow.py @@ -79,6 +79,7 @@ async def async_step_user(self, user_input=None): errors = {} if user_input: + # TODO change to gateway mac address or something more unique await self.async_set_unique_id(user_input.get(CONF_HOST)) self._abort_if_unique_id_configured()