mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Codestyle cleanup
This commit is contained in:
parent
f48e65096a
commit
94db1ac142
@ -6,13 +6,13 @@ Support for Tellstick lights.
|
|||||||
import logging
|
import logging
|
||||||
# pylint: disable=no-name-in-module, import-error
|
# pylint: disable=no-name-in-module, import-error
|
||||||
from homeassistant.components.light import Light, ATTR_BRIGHTNESS
|
from homeassistant.components.light import Light, ATTR_BRIGHTNESS
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ( EVENT_HOMEASSISTANT_STOP,
|
||||||
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP,
|
ATTR_FRIENDLY_NAME)
|
||||||
ATTR_FRIENDLY_NAME)
|
|
||||||
import tellcore.constants as tellcore_constants
|
import tellcore.constants as tellcore_constants
|
||||||
from tellcore.library import DirectCallbackDispatcher
|
from tellcore.library import DirectCallbackDispatcher
|
||||||
REQUIREMENTS = ['tellcore-py==1.1.2']
|
REQUIREMENTS = ['tellcore-py==1.1.2']
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Find and return Tellstick lights. """
|
""" Find and return Tellstick lights. """
|
||||||
@ -44,6 +44,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(event):
|
def unload_telldus_lib(event):
|
||||||
|
""" Un-register the callback bindings """
|
||||||
if callback_id is not None:
|
if callback_id is not None:
|
||||||
core.unregister_callback(callback_id)
|
core.unregister_callback(callback_id)
|
||||||
|
|
||||||
|
@ -11,9 +11,8 @@ signal_repetitions: 3
|
|||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (EVENT_HOMEASSISTANT_STOP,
|
||||||
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP,
|
ATTR_FRIENDLY_NAME)
|
||||||
ATTR_FRIENDLY_NAME)
|
|
||||||
from homeassistant.helpers.entity import ToggleEntity
|
from homeassistant.helpers.entity import ToggleEntity
|
||||||
import tellcore.constants as tellcore_constants
|
import tellcore.constants as tellcore_constants
|
||||||
from tellcore.library import DirectCallbackDispatcher
|
from tellcore.library import DirectCallbackDispatcher
|
||||||
@ -55,6 +54,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(event):
|
def unload_telldus_lib(event):
|
||||||
|
""" Un-register the callback bindings """
|
||||||
if callback_id is not None:
|
if callback_id is not None:
|
||||||
core.unregister_callback(callback_id)
|
core.unregister_callback(callback_id)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user