From c5d806fdbe179799d15a15d7f291bea5aa988e83 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 7 Jul 2021 09:46:59 +0200 Subject: [PATCH] Fix broadlink creating duplicate unique IDs (#52621) --- homeassistant/components/broadlink/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/broadlink/switch.py b/homeassistant/components/broadlink/switch.py index 1f599d6d108..1576c8b8418 100644 --- a/homeassistant/components/broadlink/switch.py +++ b/homeassistant/components/broadlink/switch.py @@ -146,7 +146,6 @@ class BroadlinkSwitch(BroadlinkEntity, SwitchEntity, RestoreEntity, ABC): self._attr_assumed_state = True self._attr_device_class = DEVICE_CLASS_SWITCH self._attr_name = f"{self._device.name} Switch" - self._attr_unique_id = self._device.unique_id @property def is_on(self): @@ -215,6 +214,7 @@ class BroadlinkSP1Switch(BroadlinkSwitch): def __init__(self, device): """Initialize the switch.""" super().__init__(device, 1, 0) + self._attr_unique_id = self._device.unique_id async def _async_send_packet(self, packet): """Send a packet to the device."""