Removed the check for callback_dispatcher

This commit is contained in:
Stefan Jonasson 2015-09-23 09:52:58 +02:00
parent 16c2827465
commit b4ca691822
2 changed files with 4 additions and 14 deletions

View file

@ -24,12 +24,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
"Failed to import tellcore")
return []
# pylint: disable=no-member
#if telldus.TelldusCore.callback_dispatcher is None:
#dispatcher = DirectCallbackDispatcher()
#core = telldus.TelldusCore(callback_dispatcher=dispatcher)
#else:
core = telldus.TelldusCore()
core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
switches_and_lights = core.devices()
lights = []
@ -48,7 +43,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
callback_id = core.register_device_event(_device_event_callback)
def unload_telldus_lib():
def unload_telldus_lib(event):
if callback_id is not None:
core.unregister_callback(callback_id)

View file

@ -32,12 +32,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
"Failed to import tellcore")
return
# pylint: disable=no-member
#if telldus.TelldusCore.callback_dispatcher is None:
dispatcher = DirectCallbackDispatcher()
core = telldus.TelldusCore(callback_dispatcher=dispatcher)
#else:
# core = telldus.TelldusCore()
core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
signal_repetitions = config.get('signal_repetitions', SINGAL_REPETITIONS)
@ -60,7 +55,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
callback_id = core.register_device_event(_device_event_callback)
def unload_telldus_lib():
def unload_telldus_lib(event):
if callback_id is not None:
core.unregister_callback(callback_id)