From 0deb152bb26bfa9e418aa6a34ac19809b937c7e2 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:04:28 +0200 Subject: [PATCH] Move tellstick shared constants to separate module (#126179) --- homeassistant/components/tellstick/__init__.py | 11 +++++++---- homeassistant/components/tellstick/const.py | 8 ++++++++ homeassistant/components/tellstick/cover.py | 4 ++-- homeassistant/components/tellstick/light.py | 4 ++-- homeassistant/components/tellstick/switch.py | 4 ++-- 5 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 homeassistant/components/tellstick/const.py diff --git a/homeassistant/components/tellstick/__init__.py b/homeassistant/components/tellstick/__init__.py index 1a60927e25f..9b55e73841f 100644 --- a/homeassistant/components/tellstick/__init__.py +++ b/homeassistant/components/tellstick/__init__.py @@ -25,16 +25,19 @@ from homeassistant.helpers.dispatcher import ( from homeassistant.helpers.entity import Entity from homeassistant.helpers.typing import ConfigType +from .const import ( + ATTR_DISCOVER_CONFIG, + ATTR_DISCOVER_DEVICES, + DATA_TELLSTICK, + DEFAULT_SIGNAL_REPETITIONS, +) + _LOGGER = logging.getLogger(__name__) -ATTR_DISCOVER_CONFIG = "config" -ATTR_DISCOVER_DEVICES = "devices" CONF_SIGNAL_REPETITIONS = "signal_repetitions" -DEFAULT_SIGNAL_REPETITIONS = 1 DOMAIN = "tellstick" -DATA_TELLSTICK = "tellstick_device" SIGNAL_TELLCORE_CALLBACK = "tellstick_callback" # Use a global tellstick domain lock to avoid getting Tellcore errors when diff --git a/homeassistant/components/tellstick/const.py b/homeassistant/components/tellstick/const.py new file mode 100644 index 00000000000..625621e4615 --- /dev/null +++ b/homeassistant/components/tellstick/const.py @@ -0,0 +1,8 @@ +"""Support for Tellstick.""" + +ATTR_DISCOVER_CONFIG = "config" +ATTR_DISCOVER_DEVICES = "devices" + +DATA_TELLSTICK = "tellstick_device" + +DEFAULT_SIGNAL_REPETITIONS = 1 diff --git a/homeassistant/components/tellstick/cover.py b/homeassistant/components/tellstick/cover.py index cb49d876e71..ee6d2bb2808 100644 --- a/homeassistant/components/tellstick/cover.py +++ b/homeassistant/components/tellstick/cover.py @@ -9,12 +9,12 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType -from . import ( +from . import TellstickDevice +from .const import ( ATTR_DISCOVER_CONFIG, ATTR_DISCOVER_DEVICES, DATA_TELLSTICK, DEFAULT_SIGNAL_REPETITIONS, - TellstickDevice, ) diff --git a/homeassistant/components/tellstick/light.py b/homeassistant/components/tellstick/light.py index acbcf2d6cb5..eba80049cd6 100644 --- a/homeassistant/components/tellstick/light.py +++ b/homeassistant/components/tellstick/light.py @@ -7,12 +7,12 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType -from . import ( +from . import TellstickDevice +from .const import ( ATTR_DISCOVER_CONFIG, ATTR_DISCOVER_DEVICES, DATA_TELLSTICK, DEFAULT_SIGNAL_REPETITIONS, - TellstickDevice, ) diff --git a/homeassistant/components/tellstick/switch.py b/homeassistant/components/tellstick/switch.py index e3eb4825d91..8ea4c82b5e9 100644 --- a/homeassistant/components/tellstick/switch.py +++ b/homeassistant/components/tellstick/switch.py @@ -7,12 +7,12 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType -from . import ( +from . import TellstickDevice +from .const import ( ATTR_DISCOVER_CONFIG, ATTR_DISCOVER_DEVICES, DATA_TELLSTICK, DEFAULT_SIGNAL_REPETITIONS, - TellstickDevice, )