mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Add active alarm zones as select entity to Overkiz integration (#68997)
* Add active zones as select entity * Clean up for PR
This commit is contained in:
parent
99db2a5afe
commit
1ef0102f12
@ -50,6 +50,17 @@ def _select_option_memorized_simple_volume(
|
|||||||
return execute_command(OverkizCommand.SET_MEMORIZED_SIMPLE_VOLUME, option)
|
return execute_command(OverkizCommand.SET_MEMORIZED_SIMPLE_VOLUME, option)
|
||||||
|
|
||||||
|
|
||||||
|
def _select_option_active_zone(
|
||||||
|
option: str, execute_command: Callable[..., Awaitable[None]]
|
||||||
|
) -> Awaitable[None]:
|
||||||
|
"""Change the selected option for Active Zone(s)."""
|
||||||
|
# Turn alarm off when empty zone is selected
|
||||||
|
if option == "":
|
||||||
|
return execute_command(OverkizCommand.ALARM_OFF)
|
||||||
|
|
||||||
|
return execute_command(OverkizCommand.ALARM_ZONE_ON, option)
|
||||||
|
|
||||||
|
|
||||||
SELECT_DESCRIPTIONS: list[OverkizSelectDescription] = [
|
SELECT_DESCRIPTIONS: list[OverkizSelectDescription] = [
|
||||||
OverkizSelectDescription(
|
OverkizSelectDescription(
|
||||||
key=OverkizState.CORE_OPEN_CLOSED_PEDESTRIAN,
|
key=OverkizState.CORE_OPEN_CLOSED_PEDESTRIAN,
|
||||||
@ -83,6 +94,14 @@ SELECT_DESCRIPTIONS: list[OverkizSelectDescription] = [
|
|||||||
),
|
),
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
),
|
),
|
||||||
|
# StatefulAlarmController
|
||||||
|
OverkizSelectDescription(
|
||||||
|
key=OverkizState.CORE_ACTIVE_ZONES,
|
||||||
|
name="Active Zones",
|
||||||
|
icon="mdi:shield-lock",
|
||||||
|
options=["", "A", "B", "C", "A,B", "B,C", "A,C", "A,B,C"],
|
||||||
|
select_option=_select_option_active_zone,
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
SUPPORTED_STATES = {description.key: description for description in SELECT_DESCRIPTIONS}
|
SUPPORTED_STATES = {description.key: description for description in SELECT_DESCRIPTIONS}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user