From b4ca691822cd36a1138ca4e75fc3619e6fe59619 Mon Sep 17 00:00:00 2001 From: Stefan Jonasson Date: Wed, 23 Sep 2015 09:52:58 +0200 Subject: [PATCH] Removed the check for callback_dispatcher --- homeassistant/components/light/tellstick.py | 9 ++------- homeassistant/components/switch/tellstick.py | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/light/tellstick.py b/homeassistant/components/light/tellstick.py index 626b7a9be33..f8a3a105f8c 100644 --- a/homeassistant/components/light/tellstick.py +++ b/homeassistant/components/light/tellstick.py @@ -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) diff --git a/homeassistant/components/switch/tellstick.py b/homeassistant/components/switch/tellstick.py index 7846f789250..e300c9959bc 100644 --- a/homeassistant/components/switch/tellstick.py +++ b/homeassistant/components/switch/tellstick.py @@ -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)