Fix switch light adding itself to devices (#68060)
This commit is contained in:
parent
ea6da674df
commit
a902f0ee53
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue