mirror of
https://github.com/home-assistant/core.git
synced 2026-04-25 21:56:08 +00:00
Fix switch light adding itself to devices (#68060)
This commit is contained in:
@@ -113,4 +113,5 @@ class LightSwitch(LightEntity):
|
||||
|
||||
# Add this entity to the wrapped switch's device
|
||||
registry = er.async_get(self.hass)
|
||||
registry.async_update_entity(self.entity_id, device_id=self._device_id)
|
||||
if registry.async_get(self.entity_id) is not None:
|
||||
registry.async_update_entity(self.entity_id, device_id=self._device_id)
|
||||
|
||||
Reference in New Issue
Block a user