Skip to content

Commit

Permalink
Fix JurajNyiri#450: Config entry name resets on reconfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajNyiri authored and marcosngomezi committed Jul 20, 2024
1 parent d7d4ab0 commit 8211987
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions custom_components/tapo_control/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
)
Expand Down

0 comments on commit 8211987

Please sign in to comment.