diff --git a/homeassistant/components/nx584/services.py b/homeassistant/components/nx584/services.py index 93aa755f9042..e83dd1eb7a83 100644 --- a/homeassistant/components/nx584/services.py +++ b/homeassistant/components/nx584/services.py @@ -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", )