Use enum instead of string for button entities key in Overkiz (#133472)

This commit is contained in:
Mick Vleeshouwer 2024-12-18 11:22:22 +01:00 committed by GitHub
parent fa0e54e658
commit 05b0c56191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,41 +28,47 @@ class OverkizButtonDescription(ButtonEntityDescription):
BUTTON_DESCRIPTIONS: list[OverkizButtonDescription] = [
# My Position (cover, light)
OverkizButtonDescription(
key="my",
key=OverkizCommand.MY,
name="My position",
icon="mdi:star",
),
# Identify
OverkizButtonDescription(
key="identify", # startIdentify and identify are reversed... Swap this when fixed in API.
key=OverkizCommand.IDENTIFY, # startIdentify and identify are reversed... Swap this when fixed in API.
name="Start identify",
icon="mdi:human-greeting-variant",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
),
OverkizButtonDescription(
key="stopIdentify",
key=OverkizCommand.STOP_IDENTIFY,
name="Stop identify",
icon="mdi:human-greeting-variant",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
),
OverkizButtonDescription(
key="startIdentify", # startIdentify and identify are reversed... Swap this when fixed in API.
key=OverkizCommand.START_IDENTIFY, # startIdentify and identify are reversed... Swap this when fixed in API.
name="Identify",
icon="mdi:human-greeting-variant",
entity_category=EntityCategory.DIAGNOSTIC,
),
# RTDIndoorSiren / RTDOutdoorSiren
OverkizButtonDescription(key="dingDong", name="Ding dong", icon="mdi:bell-ring"),
OverkizButtonDescription(key="bip", name="Bip", icon="mdi:bell-ring"),
OverkizButtonDescription(
key="fastBipSequence", name="Fast bip sequence", icon="mdi:bell-ring"
key=OverkizCommand.DING_DONG, name="Ding dong", icon="mdi:bell-ring"
),
OverkizButtonDescription(key=OverkizCommand.BIP, name="Bip", icon="mdi:bell-ring"),
OverkizButtonDescription(
key=OverkizCommand.FAST_BIP_SEQUENCE,
name="Fast bip sequence",
icon="mdi:bell-ring",
),
OverkizButtonDescription(
key=OverkizCommand.RING, name="Ring", icon="mdi:bell-ring"
),
OverkizButtonDescription(key="ring", name="Ring", icon="mdi:bell-ring"),
# DynamicScreen (ogp:blind) uses goToAlias (id 1: favorite1) instead of 'my'
OverkizButtonDescription(
key="goToAlias",
key=OverkizCommand.GO_TO_ALIAS,
press_args="1",
name="My position",
icon="mdi:star",