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") "Failed to import tellcore")
return [] return []
# pylint: disable=no-member core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
#if telldus.TelldusCore.callback_dispatcher is None:
#dispatcher = DirectCallbackDispatcher()
#core = telldus.TelldusCore(callback_dispatcher=dispatcher)
#else:
core = telldus.TelldusCore()
switches_and_lights = core.devices() switches_and_lights = core.devices()
lights = [] 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) callback_id = core.register_device_event(_device_event_callback)
def unload_telldus_lib(): def unload_telldus_lib(event):
if callback_id is not None: if callback_id is not None:
core.unregister_callback(callback_id) 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") "Failed to import tellcore")
return return
# pylint: disable=no-member core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
#if telldus.TelldusCore.callback_dispatcher is None:
dispatcher = DirectCallbackDispatcher()
core = telldus.TelldusCore(callback_dispatcher=dispatcher)
#else:
# core = telldus.TelldusCore()
signal_repetitions = config.get('signal_repetitions', SINGAL_REPETITIONS) 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) callback_id = core.register_device_event(_device_event_callback)
def unload_telldus_lib(): def unload_telldus_lib(event):
if callback_id is not None: if callback_id is not None:
core.unregister_callback(callback_id) core.unregister_callback(callback_id)