Debug async_added_to_hass

This commit is contained in:
Tom Harris
2018-02-21 01:24:02 -05:00
parent 22cadff91f
commit 4963a255d8
5 changed files with 48 additions and 44 deletions

View File

@@ -96,11 +96,11 @@ class InsteonPLMBinarySensor(BinarySensorDevice):
sensorstate = self._insteon_device_state.value
return bool(sensorstate)
@asyncio.coroutine
def async_added_to_hass(self):
"""Register INSTEON update events."""
_LOGGER.debug('Device %s added. Now registering callback.',
self.address)
self.hass.async_add_job(
self._insteon_device_state.register_updates,
self.async_binarysensor_update)
#@asyncio.coroutine
#def async_added_to_hass(self):
# """Register INSTEON update events."""
# _LOGGER.debug('Device %s added. Now registering callback.',
# self.address)
# self.hass.async_add_job(
# self._insteon_device_state.register_updates,
# self.async_binarysensor_update)

View File

@@ -137,11 +137,11 @@ class InsteonPLMFan(FanEntity):
hex_speed = SPEED_LOW
return hex_speed
@asyncio.coroutine
def async_added_to_hass(self):
"""Register INSTEON update events."""
_LOGGER.debug('Device %s added. Now registering callback.',
self.address)
self.hass.async_add_job(
self._insteon_device_state.register_updates,
self.async_fan_update)
#@asyncio.coroutine
#def async_added_to_hass(self):
# """Register INSTEON update events."""
# _LOGGER.debug('Device %s added. Now registering callback.',
# self.address)
# self.hass.async_add_job(
# self._insteon_device_state.register_updates,
# self.async_fan_update)

View File

@@ -111,11 +111,11 @@ class InsteonPLMDimmerDevice(Light):
"""Turn device off."""
self._insteon_device_state.off()
@asyncio.coroutine
def async_added_to_hass(self):
"""Register INSTEON update events."""
_LOGGER.debug('Device %s added. Now registering callback.',
self.address)
self.hass.async_add_job(
self._insteon_device_state.register_updates,
self.async_light_update)
#@asyncio.coroutine
#def async_added_to_hass(self):
# """Register INSTEON update events."""
# _LOGGER.debug('Device %s added. Now registering callback.',
# self.address)
# self.hass.async_add_job(
# self._insteon_device_state.register_updates,
# self.async_light_update)

View File

@@ -83,11 +83,11 @@ class InsteonPLMSensorDevice(Entity):
"""Receive notification from transport that new data exists."""
self.async_schedule_update_ha_state()
@asyncio.coroutine
def async_added_to_hass(self):
"""Register INSTEON update events."""
_LOGGER.debug('Device %s added. Now registering callback.',
self.address)
self.hass.async_add_job(
self._insteon_device_state.register_updates,
self.async_sensor_update)
#@asyncio.coroutine
#def async_added_to_hass(self):
# """Register INSTEON update events."""
# _LOGGER.debug('Device %s added. Now registering callback.',
# self.address)
# self.hass.async_add_job(
# self._insteon_device_state.register_updates,
# self.async_sensor_update)

View File

@@ -99,10 +99,14 @@ class InsteonPLMSwitchDevice(SwitchDevice):
"""Turn device off."""
self._insteon_device_state.off()
@asyncio.coroutine
def async_added_to_hass(self):
"""Register INSTEON update events."""
self._insteon_device_state.register_updates(self.async_switch_update)
#@asyncio.coroutine
#def async_added_to_hass(self):
# """Register INSTEON update events."""
# _LOGGER.debug('Device %s added. Now registering callback.',
# self.address)
# self.hass.async_add_job(
# self._insteon_device_state.register_updates,
# self.async_switch_update)
class InsteonPLMOpenClosedDevice(SwitchDevice):
@@ -162,11 +166,11 @@ class InsteonPLMOpenClosedDevice(SwitchDevice):
"""Turn device off."""
self._insteon_device_state.close()
@asyncio.coroutine
def async_added_to_hass(self):
"""Register INSTEON update events."""
_LOGGER.debug('Device %s added. Now registering callback.',
self.address)
self.hass.async_add_job(
self._insteon_device_state.register_updates,
self.async_relay_update)
#@asyncio.coroutine
#def async_added_to_hass(self):
# """Register INSTEON update events."""
# _LOGGER.debug('Device %s added. Now registering callback.',
# self.address)
# self.hass.async_add_job(
# self._insteon_device_state.register_updates,
# self.async_relay_update)