mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fix Mac address check in kef integration (#107746)
Fix the check for Mac address in kef integration (#106072) It might be due to an update of `getmac` dependency in some case the mac was resolved to "00:00:00:00:00:00" instead of the anticipated `None`. With that the original bug #47678 where a duplicated entity would be created in case of HA is restarted while the KEF speaker is offline came back. The PR #52902 was applied back in time to fix that issue. Now, this change is a continuation of the previous efforts. The solution was tested for about two months and it does address the bug with creating duplicated entities in case of KEF speakers being offline.
This commit is contained in:
parent
350806c036
commit
1bb76e2351
@ -118,7 +118,7 @@ async def async_setup_platform(
|
|||||||
|
|
||||||
mode = get_ip_mode(host)
|
mode = get_ip_mode(host)
|
||||||
mac = await hass.async_add_executor_job(partial(get_mac_address, **{mode: host}))
|
mac = await hass.async_add_executor_job(partial(get_mac_address, **{mode: host}))
|
||||||
if mac is None:
|
if mac is None or mac == "00:00:00:00:00:00":
|
||||||
raise PlatformNotReady("Cannot get the ip address of kef speaker.")
|
raise PlatformNotReady("Cannot get the ip address of kef speaker.")
|
||||||
|
|
||||||
unique_id = f"kef-{mac}"
|
unique_id = f"kef-{mac}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user