Move some Alarm Control Panel constants (#69221)
This commit is contained in:
parent
db10c313b5
commit
81ec60b7e4
2 changed files with 14 additions and 8 deletions
|
@ -28,6 +28,11 @@ from homeassistant.helpers.entity_component import EntityComponent
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
|
|
||||||
from .const import ( # noqa: F401
|
from .const import ( # noqa: F401
|
||||||
|
ATTR_CHANGED_BY,
|
||||||
|
ATTR_CODE_ARM_REQUIRED,
|
||||||
|
DOMAIN,
|
||||||
|
FORMAT_NUMBER,
|
||||||
|
FORMAT_TEXT,
|
||||||
SUPPORT_ALARM_ARM_AWAY,
|
SUPPORT_ALARM_ARM_AWAY,
|
||||||
SUPPORT_ALARM_ARM_CUSTOM_BYPASS,
|
SUPPORT_ALARM_ARM_CUSTOM_BYPASS,
|
||||||
SUPPORT_ALARM_ARM_HOME,
|
SUPPORT_ALARM_ARM_HOME,
|
||||||
|
@ -39,13 +44,7 @@ from .const import ( # noqa: F401
|
||||||
|
|
||||||
_LOGGER: Final = logging.getLogger(__name__)
|
_LOGGER: Final = logging.getLogger(__name__)
|
||||||
|
|
||||||
DOMAIN: Final = "alarm_control_panel"
|
|
||||||
SCAN_INTERVAL: Final = timedelta(seconds=30)
|
SCAN_INTERVAL: Final = timedelta(seconds=30)
|
||||||
ATTR_CHANGED_BY: Final = "changed_by"
|
|
||||||
FORMAT_TEXT: Final = "text"
|
|
||||||
FORMAT_NUMBER: Final = "number"
|
|
||||||
ATTR_CODE_ARM_REQUIRED: Final = "code_arm_required"
|
|
||||||
|
|
||||||
ENTITY_ID_FORMAT: Final = DOMAIN + ".{}"
|
ENTITY_ID_FORMAT: Final = DOMAIN + ".{}"
|
||||||
|
|
||||||
ALARM_SERVICE_SCHEMA: Final = make_entity_service_schema(
|
ALARM_SERVICE_SCHEMA: Final = make_entity_service_schema(
|
||||||
|
|
|
@ -1,8 +1,15 @@
|
||||||
"""Provides the constants needed for component."""
|
"""Provides the constants needed for component."""
|
||||||
|
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import Final
|
from typing import Final
|
||||||
|
|
||||||
|
DOMAIN: Final = "alarm_control_panel"
|
||||||
|
|
||||||
|
ATTR_CHANGED_BY: Final = "changed_by"
|
||||||
|
ATTR_CODE_ARM_REQUIRED: Final = "code_arm_required"
|
||||||
|
|
||||||
|
FORMAT_TEXT: Final = "text"
|
||||||
|
FORMAT_NUMBER: Final = "number"
|
||||||
|
|
||||||
|
|
||||||
class AlarmControlPanelEntityFeature(IntEnum):
|
class AlarmControlPanelEntityFeature(IntEnum):
|
||||||
"""Supported features of the alarm control panel entity."""
|
"""Supported features of the alarm control panel entity."""
|
||||||
|
@ -16,7 +23,7 @@ class AlarmControlPanelEntityFeature(IntEnum):
|
||||||
|
|
||||||
|
|
||||||
# These constants are deprecated as of Home Assistant 2022.5
|
# These constants are deprecated as of Home Assistant 2022.5
|
||||||
# Pleease use the AlarmControlPanelEntityFeature enum instead.
|
# Please use the AlarmControlPanelEntityFeature enum instead.
|
||||||
SUPPORT_ALARM_ARM_HOME: Final = 1
|
SUPPORT_ALARM_ARM_HOME: Final = 1
|
||||||
SUPPORT_ALARM_ARM_AWAY: Final = 2
|
SUPPORT_ALARM_ARM_AWAY: Final = 2
|
||||||
SUPPORT_ALARM_ARM_NIGHT: Final = 4
|
SUPPORT_ALARM_ARM_NIGHT: Final = 4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue