Added callback logging.

This commit is contained in:
Stefan Jonasson 2015-09-23 11:07:37 +02:00
parent 48df06d1c0
commit b6bf398859
2 changed files with 4 additions and 0 deletions
homeassistant/components

View file

@ -40,6 +40,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
for light_device in lights:
if light_device.tellstick_device.id == id_:
# Execute the update in another thread
logging.getLogger(__name__).info(
"Updating state to {}".switch_device.state())
threading.Thread(target=light_device.update_ha_state, daemon=False, args=(True,)).start()
light_device.update_ha_state(True)

View file

@ -52,6 +52,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
for switch_device in switches:
if switch_device.tellstick_device.id == id_:
# Execute the update in another thread
logging.getLogger(__name__).info(
"Updating state to {}".switch_device.state())
threading.Thread(target=switch_device.update_ha_state, daemon=False).start()
break