Add action enums to nx584 (#191574)

This commit is contained in:
epenet
2026-11-09 13:30:43 +01:00
committed by GitHub
parent 37cb45be49
commit f7e386ea14
+18 -7
View File
@@ -1,5 +1,7 @@
"""Services for the NX584 integration."""
from enum import StrEnum
import probatio
from homeassistant.components.alarm_control_panel import (
@@ -10,9 +12,18 @@ from homeassistant.helpers import config_validation as cv, service
from .const import DOMAIN
SERVICE_BYPASS_ZONE = "bypass_zone"
SERVICE_UNBYPASS_ZONE = "unbypass_zone"
ATTR_ZONE = "zone"
class NX584Service(StrEnum):
"""Store keys for NX584 services."""
BYPASS_ZONE = "bypass_zone"
UNBYPASS_ZONE = "unbypass_zone"
class NX584ServiceArgument(StrEnum):
"""Store keys for NX584 service arguments."""
ZONE = "zone"
@callback
@@ -21,16 +32,16 @@ def async_setup_services(hass: HomeAssistant) -> None:
service.async_register_platform_entity_service(
hass,
DOMAIN,
SERVICE_BYPASS_ZONE,
NX584Service.BYPASS_ZONE,
entity_domain=ALARM_CONTROL_PANEL_DOMAIN,
schema={probatio.Required(ATTR_ZONE): cv.positive_int},
schema={probatio.Required(NX584ServiceArgument.ZONE): cv.positive_int},
func="alarm_bypass",
)
service.async_register_platform_entity_service(
hass,
DOMAIN,
SERVICE_UNBYPASS_ZONE,
NX584Service.UNBYPASS_ZONE,
entity_domain=ALARM_CONTROL_PANEL_DOMAIN,
schema={probatio.Required(ATTR_ZONE): cv.positive_int},
schema={probatio.Required(NX584ServiceArgument.ZONE): cv.positive_int},
func="alarm_unbypass",
)