From 7de866bacc3dc6c55a48898e438b3a60d7d34ae2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 25 Mar 2022 11:51:47 -1000 Subject: [PATCH 1/3] Fix screenlogic to get the macaddress from discovery Fixes #68677 --- homeassistant/components/screenlogic/config_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/screenlogic/config_flow.py b/homeassistant/components/screenlogic/config_flow.py index d9feec629e21d..bf2b8e1c14ddc 100644 --- a/homeassistant/components/screenlogic/config_flow.py +++ b/homeassistant/components/screenlogic/config_flow.py @@ -79,7 +79,7 @@ async def async_step_user(self, user_input=None): async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowResult: """Handle dhcp discovery.""" - mac = _extract_mac_from_name(discovery_info.hostname) + mac = _extract_mac_from_name(discovery_info.macaddress) await self.async_set_unique_id(mac) self._abort_if_unique_id_configured( updates={CONF_IP_ADDRESS: discovery_info.ip} From c180731e660695b6db799ed1c1c9043c35105fc5 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 25 Mar 2022 11:53:01 -1000 Subject: [PATCH 2/3] fix matching --- homeassistant/components/screenlogic/manifest.json | 2 +- homeassistant/generated/dhcp.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/screenlogic/manifest.json b/homeassistant/components/screenlogic/manifest.json index 98129e24f0146..32ec187287732 100644 --- a/homeassistant/components/screenlogic/manifest.json +++ b/homeassistant/components/screenlogic/manifest.json @@ -8,7 +8,7 @@ "dhcp": [ {"registered_devices": true}, { - "hostname": "pentair: *", + "hostname": "pentair*", "macaddress": "00C033*" } ], diff --git a/homeassistant/generated/dhcp.py b/homeassistant/generated/dhcp.py index 4b4c2d7b97964..91e6550919dd2 100644 --- a/homeassistant/generated/dhcp.py +++ b/homeassistant/generated/dhcp.py @@ -82,7 +82,7 @@ {'domain': 'samsungtv', 'macaddress': '4844F7*'}, {'domain': 'samsungtv', 'macaddress': '8CEA48*'}, {'domain': 'screenlogic', 'registered_devices': True}, - {'domain': 'screenlogic', 'hostname': 'pentair: *', 'macaddress': '00C033*'}, + {'domain': 'screenlogic', 'hostname': 'pentair*', 'macaddress': '00C033*'}, {'domain': 'sense', 'hostname': 'sense-*', 'macaddress': '009D6B*'}, {'domain': 'sense', 'hostname': 'sense-*', 'macaddress': 'DCEFCA*'}, {'domain': 'sense', 'hostname': 'sense-*', 'macaddress': 'A4D578*'}, From 01161dcc9f6700ebcfb79e219e811761d2ee8a78 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 25 Mar 2022 11:56:22 -1000 Subject: [PATCH 3/3] fixes --- homeassistant/components/screenlogic/config_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/screenlogic/config_flow.py b/homeassistant/components/screenlogic/config_flow.py index bf2b8e1c14ddc..260317dca1190 100644 --- a/homeassistant/components/screenlogic/config_flow.py +++ b/homeassistant/components/screenlogic/config_flow.py @@ -79,7 +79,7 @@ async def async_step_user(self, user_input=None): async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowResult: """Handle dhcp discovery.""" - mac = _extract_mac_from_name(discovery_info.macaddress) + mac = format_mac(discovery_info.macaddress) await self.async_set_unique_id(mac) self._abort_if_unique_id_configured( updates={CONF_IP_ADDRESS: discovery_info.ip}