Move dispatcher out of init. (#6355)

This commit is contained in:
Pascal Vizeli authored and GitHub committed 2017-03-02 10:20:57 +01:00
1 parent 8743f23f13
commit 50887e7e2c
3 files changed
+14 -5

No files matched your search

@@ -49,10 +49,13 @@ class EnvisalinkSensor(EnvisalinkDevice, Entity):
_LOGGER.debug('Setting up sensor for partition: ' + partition_name)
super().__init__(partition_name + ' Keypad', info, controller)
@asyncio.coroutine
def async_added_to_hass(self):
"""Register callbacks."""
async_dispatcher_connect(
hass, SIGNAL_KEYPAD_UPDATE, self._update_callback)
self.hass, SIGNAL_KEYPAD_UPDATE, self._update_callback)
async_dispatcher_connect(
hass, SIGNAL_PARTITION_UPDATE, self._update_callback)
self.hass, SIGNAL_PARTITION_UPDATE, self._update_callback)
@property
def icon(self):