From 52e884dc265bacb514250bdc3f30d6c23d519458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Sat, 20 Jul 2024 15:55:08 +0200 Subject: [PATCH] Fix #450: Config entry name resets on reconfiguration --- custom_components/tapo_control/config_flow.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/custom_components/tapo_control/config_flow.py b/custom_components/tapo_control/config_flow.py index 2bd7a96..0764df1 100644 --- a/custom_components/tapo_control/config_flow.py +++ b/custom_components/tapo_control/config_flow.py @@ -113,7 +113,6 @@ async def async_step_reauth_confirm_stream(self, user_input=None): allConfigData[CONF_PASSWORD] = password self.hass.config_entries.async_update_entry( self.reauth_entry, - title=tapoHost, data=allConfigData, unique_id=DOMAIN + tapoHost, ) @@ -231,7 +230,6 @@ async def async_step_reauth_confirm_cloud(self, user_input=None): allConfigData[CLOUD_PASSWORD] = cloudPassword self.hass.config_entries.async_update_entry( self.reauth_entry, - title=tapoHost, data=allConfigData, unique_id=DOMAIN + tapoHost, ) @@ -921,9 +919,7 @@ async def async_step_sound_sensor(self, user_input=None): self.hass.config_entries.async_update_entry( self.config_entry, - title=ip_address, data=allConfigData, - unique_id=DOMAIN + ip_address, ) return self.async_create_entry(title="", data=None) except Exception as e: @@ -1025,7 +1021,6 @@ async def async_step_media(self, user_input=None): media_sync_cold_storage_path = self.config_entry.data[ MEDIA_SYNC_COLD_STORAGE_PATH ] - ip_address = self.config_entry.data[CONF_IP_ADDRESS] allConfigData = {**self.config_entry.data} if user_input is not None: @@ -1066,12 +1061,9 @@ async def async_step_media(self, user_input=None): allConfigData[MEDIA_SYNC_COLD_STORAGE_PATH] = ( media_sync_cold_storage_path ) - # todo also initial setup to add the default values! self.hass.config_entries.async_update_entry( self.config_entry, - title=ip_address, data=allConfigData, - unique_id=DOMAIN + ip_address, ) return self.async_create_entry(title="", data=None) except Exception as e: @@ -1312,7 +1304,6 @@ async def async_step_auth(self, user_input=None): allConfigData[CONF_RTSP_TRANSPORT] = rtsp_transport self.hass.config_entries.async_update_entry( self.config_entry, - title=ip_address, data=allConfigData, unique_id=DOMAIN + ip_address, )