core/homeassistant/components/sia/const.py

39 lines
1.0 KiB
Python
Raw Normal View History

Add SIA Alarm systems (#36625) * initial commit of SIA integration * translations * moved reactions to file, typed everything * fixed no-else-return 3 times * refactored config and fix coverage of test * fix requirements_test * elimated another platform * forgot some mentions of sensor * updated config flow steps, fixed restore and small edits * fixed pylint * updated config_flow with better schema, small fixes from review * final comment and small legibility enhancements * small fix for pylint * fixed init * fixes for botched rebase * fixed port string * updated common strings * rebuild component with eventbus * fixed pylint and tests * updates based on review by @bdraco * updates based on new version of package and reviews * small updates with latest package * added raise from * deleted async_setup from test * fixed tests * removed unused code from addititional account step * fixed typo in strings * clarification and update to update_data func * added iot_class to manifest * fixed entity and unique id setup * small fix in tests * improved unique_id semantics and load/unload functions * added typing in order to fix mypy * further fixes for typing * final fixes for mypy * adding None return types * fix hub DR identifier * rebased, added DeviceInfo * rewrite to clean up and make it easier to read * replaced functions with format for id and name * renamed tracker remover small fix in state.setter * improved readibility of state.setter * no more state.setter and small updates * mypy fix * fixed and improved config flow * added fixtures to test and other cleaner test code * removed timeband from config, will reintro in a options flow * removed timeband from tests * added options flow for zones and timestamps * removed type ignore * replaced mapping with collections.abc
2021-05-24 06:48:28 +00:00
"""Constants for the sia integration."""
from homeassistant.components.alarm_control_panel import (
DOMAIN as ALARM_CONTROL_PANEL_DOMAIN,
)
PLATFORMS = [ALARM_CONTROL_PANEL_DOMAIN]
CONF_ACCOUNT = "account"
CONF_ACCOUNTS = "accounts"
CONF_ADDITIONAL_ACCOUNTS = "additional_account"
CONF_PING_INTERVAL = "ping_interval"
CONF_ENCRYPTION_KEY = "encryption_key"
CONF_ZONES = "zones"
CONF_IGNORE_TIMESTAMPS = "ignore_timestamps"
DOMAIN = "sia"
TITLE = "SIA Alarm on port {}"
SIA_EVENT = "sia_event_{}_{}"
SIA_NAME_FORMAT = "{} - {} - zone {} - {}"
SIA_NAME_FORMAT_HUB = "{} - {} - {}"
SIA_ENTITY_ID_FORMAT = "{}_{}_{}_{}"
SIA_ENTITY_ID_FORMAT_HUB = "{}_{}_{}"
SIA_UNIQUE_ID_FORMAT_ALARM = "{}_{}_{}"
SIA_UNIQUE_ID_FORMAT = "{}_{}_{}_{}"
HUB_SENSOR_NAME = "last_heartbeat"
HUB_ZONE = 0
PING_INTERVAL_MARGIN = 30
DEFAULT_TIMEBAND = (80, 40)
IGNORED_TIMEBAND = (3600, 1800)
EVENT_CODE = "last_code"
EVENT_ACCOUNT = "account"
EVENT_ZONE = "zone"
EVENT_PORT = "port"
EVENT_MESSAGE = "last_message"
EVENT_ID = "last_id"
EVENT_TIMESTAMP = "last_timestamp"