Fix screenlogic to get the macaddress from discovery (#68687)

This commit is contained in:
J. Nick Koston 2022-03-26 01:07:24 -10:00 committed by GitHub
parent b9f172899e
commit 7198ec06d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -79,7 +79,7 @@ class ScreenlogicConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowResult: async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowResult:
"""Handle dhcp discovery.""" """Handle dhcp discovery."""
mac = _extract_mac_from_name(discovery_info.hostname) mac = format_mac(discovery_info.macaddress)
await self.async_set_unique_id(mac) await self.async_set_unique_id(mac)
self._abort_if_unique_id_configured( self._abort_if_unique_id_configured(
updates={CONF_IP_ADDRESS: discovery_info.ip} updates={CONF_IP_ADDRESS: discovery_info.ip}

View File

@ -8,7 +8,7 @@
"dhcp": [ "dhcp": [
{"registered_devices": true}, {"registered_devices": true},
{ {
"hostname": "pentair: *", "hostname": "pentair*",
"macaddress": "00C033*" "macaddress": "00C033*"
} }
], ],

View File

@ -82,7 +82,7 @@ DHCP: list[dict[str, str | bool]] = [
{'domain': 'samsungtv', 'macaddress': '4844F7*'}, {'domain': 'samsungtv', 'macaddress': '4844F7*'},
{'domain': 'samsungtv', 'macaddress': '8CEA48*'}, {'domain': 'samsungtv', 'macaddress': '8CEA48*'},
{'domain': 'screenlogic', 'registered_devices': True}, {'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': '009D6B*'},
{'domain': 'sense', 'hostname': 'sense-*', 'macaddress': 'DCEFCA*'}, {'domain': 'sense', 'hostname': 'sense-*', 'macaddress': 'DCEFCA*'},
{'domain': 'sense', 'hostname': 'sense-*', 'macaddress': 'A4D578*'}, {'domain': 'sense', 'hostname': 'sense-*', 'macaddress': 'A4D578*'},