From 1bb76e2351c7c8b690e8134369df3775a3dfd692 Mon Sep 17 00:00:00 2001 From: Eugene Tiutiunnyk <4804824+eugenet8k@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:23:40 -0800 Subject: [PATCH] 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. --- homeassistant/components/kef/media_player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/kef/media_player.py b/homeassistant/components/kef/media_player.py index 96f52ef7e03..b8407fd8bde 100644 --- a/homeassistant/components/kef/media_player.py +++ b/homeassistant/components/kef/media_player.py @@ -118,7 +118,7 @@ async def async_setup_platform( mode = get_ip_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.") unique_id = f"kef-{mac}"