diff --git a/homeassistant/components/switch_as_x/light.py b/homeassistant/components/switch_as_x/light.py index e6fc334caef..53128487d5c 100644 --- a/homeassistant/components/switch_as_x/light.py +++ b/homeassistant/components/switch_as_x/light.py @@ -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)