Initial commit: Main Gate Controller HACS integration
Tests / pytest + ruff (3.12) (push) Has been cancelled
Validate / HACS validation (push) Has been cancelled
Validate / Hassfest validation (push) Has been cancelled

This commit is contained in:
bot
2026-09-07 23:19:12 +02:00
commit 988a30cbf7
27 changed files with 2456 additions and 0 deletions
@@ -0,0 +1,53 @@
"""Constants for the Main Gate Controller integration."""
from __future__ import annotations
from logging import Logger, getLogger
DOMAIN = "main_gate_controller"
LOGGER: Logger = getLogger(__package__)
MANUFACTURER = "Custom"
MODEL = "Main Gate Controller"
# Configuration fields
CONF_NAME = "name"
CONF_SWITCH_ENTITY_ID = "switch_entity_id"
CONF_OPEN_DURATION = "open_duration"
CONF_PULSE_DURATION = "pulse_duration"
CONF_NOTIFY_ENABLED = "notify_enabled"
CONF_NOTIFY_ENTITIES = "notify_entities"
CONF_NOTIFY_OPENING_TEXT = "notify_opening_text"
CONF_NOTIFY_CLOSING_TEXT = "notify_closing_text"
# Defaults
DEFAULT_NAME = "Main Gate"
DEFAULT_OPEN_DURATION = 20
DEFAULT_PULSE_DURATION = 1.0
DEFAULT_NOTIFY_ENABLED = False
DEFAULT_NOTIFY_OPENING_TEXT = "Opening Main Gate (Pedestrians)"
DEFAULT_NOTIFY_CLOSING_TEXT = "Closing Main Gate"
# Validation bounds
MIN_OPEN_DURATION = 1
MAX_OPEN_DURATION = 3600
MIN_PULSE_DURATION = 0.1
MAX_PULSE_DURATION = 10
# Gate states (machine-readable)
GATE_STATE_CLOSED = "closed"
GATE_STATE_OPENING = "opening"
GATE_STATE_OPEN = "open"
GATE_STATE_CLOSING = "closing"
# Sensor attributes
ATTR_REMAINING_SECONDS = "remaining_seconds"
ATTR_DURATION = "duration"
ATTR_RUNNING = "running"
ATTR_STARTED_AT = "started_at"
ATTR_FINISHES_AT = "finishes_at"
# Service targets
SWITCH_DOMAIN = "switch"
NOTIFY_DOMAIN = "notify"
SERVICE_SEND_MESSAGE = "send_message"