From 06f98274a044c14ddc53418db3bb121d71e7e1b2 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Tue, 4 Jul 2023 09:34:44 +0200 Subject: [PATCH 1/3] Reolink fix missing title_placeholders --- homeassistant/components/reolink/config_flow.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/reolink/config_flow.py b/homeassistant/components/reolink/config_flow.py index df5bf968ae13ee..a50b67f484a286 100644 --- a/homeassistant/components/reolink/config_flow.py +++ b/homeassistant/components/reolink/config_flow.py @@ -79,6 +79,11 @@ async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: self._username = entry_data[CONF_USERNAME] self._password = entry_data[CONF_PASSWORD] self._reauth = True + _LOGGER.error(self.context) + self.context["title_placeholders"] = { + "ip_address": entry_data[CONF_HOST], + #"hostname": discovery_info.hostname, + } return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( From 2c510198c485ed924fb6f864d83f5d2bfaa45726 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Tue, 4 Jul 2023 09:44:49 +0200 Subject: [PATCH 2/3] fix hostname --- homeassistant/components/reolink/config_flow.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/reolink/config_flow.py b/homeassistant/components/reolink/config_flow.py index a50b67f484a286..eebf8570769bb2 100644 --- a/homeassistant/components/reolink/config_flow.py +++ b/homeassistant/components/reolink/config_flow.py @@ -79,11 +79,8 @@ async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: self._username = entry_data[CONF_USERNAME] self._password = entry_data[CONF_PASSWORD] self._reauth = True - _LOGGER.error(self.context) - self.context["title_placeholders"] = { - "ip_address": entry_data[CONF_HOST], - #"hostname": discovery_info.hostname, - } + self.context["title_placeholders"]["ip_address"] = entry_data[CONF_HOST] + self.context["title_placeholders"]["hostname"] = self.context["title_placeholders"]["name"] return await self.async_step_reauth_confirm() async def async_step_reauth_confirm( From bfaf7da59455e948e6e36fa1f905d8de7cbe5b46 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Tue, 4 Jul 2023 09:46:55 +0200 Subject: [PATCH 3/3] fix black --- homeassistant/components/reolink/config_flow.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/reolink/config_flow.py b/homeassistant/components/reolink/config_flow.py index eebf8570769bb2..75ad26665c3bd8 100644 --- a/homeassistant/components/reolink/config_flow.py +++ b/homeassistant/components/reolink/config_flow.py @@ -80,7 +80,9 @@ async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult: self._password = entry_data[CONF_PASSWORD] self._reauth = True self.context["title_placeholders"]["ip_address"] = entry_data[CONF_HOST] - self.context["title_placeholders"]["hostname"] = self.context["title_placeholders"]["name"] + self.context["title_placeholders"]["hostname"] = self.context[ + "title_placeholders" + ]["name"] return await self.async_step_reauth_confirm() async def async_step_reauth_confirm(