Don't set up callbacks until entity is created. (#38251)

This commit is contained in:
Greg Dowling
2020-07-27 16:15:28 +01:00
committed by Franck Nijhof
parent 37e029b2c1
commit 8768fe1652

View File

@@ -194,7 +194,9 @@ class VeraDevice(Entity):
slugify(vera_device.name), vera_device.device_id
)
self.controller.register(vera_device, self._update_callback)
async def async_added_to_hass(self):
"""Subscribe to updates."""
self.controller.register(self.vera_device, self._update_callback)
def _update_callback(self, _device):
"""Update the state."""