Move tellstick shared constants to separate module (#126179)

This commit is contained in:
epenet 2024-09-18 11:04:28 +02:00 committed by GitHub
parent 8785a9869e
commit 0deb152bb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 21 additions and 10 deletions

View File

@ -25,16 +25,19 @@ from homeassistant.helpers.dispatcher import (
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.helpers.typing import ConfigType from homeassistant.helpers.typing import ConfigType
from .const import (
ATTR_DISCOVER_CONFIG,
ATTR_DISCOVER_DEVICES,
DATA_TELLSTICK,
DEFAULT_SIGNAL_REPETITIONS,
)
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
ATTR_DISCOVER_CONFIG = "config"
ATTR_DISCOVER_DEVICES = "devices"
CONF_SIGNAL_REPETITIONS = "signal_repetitions" CONF_SIGNAL_REPETITIONS = "signal_repetitions"
DEFAULT_SIGNAL_REPETITIONS = 1
DOMAIN = "tellstick" DOMAIN = "tellstick"
DATA_TELLSTICK = "tellstick_device"
SIGNAL_TELLCORE_CALLBACK = "tellstick_callback" SIGNAL_TELLCORE_CALLBACK = "tellstick_callback"
# Use a global tellstick domain lock to avoid getting Tellcore errors when # Use a global tellstick domain lock to avoid getting Tellcore errors when

View File

@ -0,0 +1,8 @@
"""Support for Tellstick."""
ATTR_DISCOVER_CONFIG = "config"
ATTR_DISCOVER_DEVICES = "devices"
DATA_TELLSTICK = "tellstick_device"
DEFAULT_SIGNAL_REPETITIONS = 1

View File

@ -9,12 +9,12 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import ( from . import TellstickDevice
from .const import (
ATTR_DISCOVER_CONFIG, ATTR_DISCOVER_CONFIG,
ATTR_DISCOVER_DEVICES, ATTR_DISCOVER_DEVICES,
DATA_TELLSTICK, DATA_TELLSTICK,
DEFAULT_SIGNAL_REPETITIONS, DEFAULT_SIGNAL_REPETITIONS,
TellstickDevice,
) )

View File

@ -7,12 +7,12 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import ( from . import TellstickDevice
from .const import (
ATTR_DISCOVER_CONFIG, ATTR_DISCOVER_CONFIG,
ATTR_DISCOVER_DEVICES, ATTR_DISCOVER_DEVICES,
DATA_TELLSTICK, DATA_TELLSTICK,
DEFAULT_SIGNAL_REPETITIONS, DEFAULT_SIGNAL_REPETITIONS,
TellstickDevice,
) )

View File

@ -7,12 +7,12 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import ( from . import TellstickDevice
from .const import (
ATTR_DISCOVER_CONFIG, ATTR_DISCOVER_CONFIG,
ATTR_DISCOVER_DEVICES, ATTR_DISCOVER_DEVICES,
DATA_TELLSTICK, DATA_TELLSTICK,
DEFAULT_SIGNAL_REPETITIONS, DEFAULT_SIGNAL_REPETITIONS,
TellstickDevice,
) )