mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Update service domain for alarmdecoder from 'alarm_control_panel' to 'alarmdecoder' (#29127)
* update alarmdecoder service domain * update alarmdecoder service name * black formatting
This commit is contained in:
parent
88376bf363
commit
f1a4e212cc
@ -59,13 +59,3 @@ alarm_trigger:
|
||||
code:
|
||||
description: An optional code to trigger the alarm control panel with.
|
||||
example: 1234
|
||||
|
||||
alarmdecoder_alarm_toggle_chime:
|
||||
description: Send the alarm the toggle chime command.
|
||||
fields:
|
||||
entity_id:
|
||||
description: Name of the alarm control panel to trigger.
|
||||
example: 'alarm_control_panel.downstairs'
|
||||
code:
|
||||
description: A required code to toggle the alarm control panel chime with.
|
||||
example: 1234
|
||||
|
@ -3,7 +3,10 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.components.alarm_control_panel as alarm
|
||||
from homeassistant.components.alarm_control_panel import (
|
||||
AlarmControlPanel,
|
||||
FORMAT_NUMBER,
|
||||
)
|
||||
from homeassistant.components.alarm_control_panel.const import (
|
||||
SUPPORT_ALARM_ARM_AWAY,
|
||||
SUPPORT_ALARM_ARM_HOME,
|
||||
@ -18,11 +21,11 @@ from homeassistant.const import (
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import DATA_AD, DOMAIN as DOMAIN_ALARMDECODER, SIGNAL_PANEL_MESSAGE
|
||||
from . import DATA_AD, DOMAIN, SIGNAL_PANEL_MESSAGE
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SERVICE_ALARM_TOGGLE_CHIME = "alarmdecoder_alarm_toggle_chime"
|
||||
SERVICE_ALARM_TOGGLE_CHIME = "alarm_toggle_chime"
|
||||
ALARM_TOGGLE_CHIME_SCHEMA = vol.Schema({vol.Required(ATTR_CODE): cv.string})
|
||||
|
||||
SERVICE_ALARM_KEYPRESS = "alarm_keypress"
|
||||
@ -41,7 +44,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
device.alarm_toggle_chime(code)
|
||||
|
||||
hass.services.register(
|
||||
alarm.DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_ALARM_TOGGLE_CHIME,
|
||||
alarm_toggle_chime_handler,
|
||||
schema=ALARM_TOGGLE_CHIME_SCHEMA,
|
||||
@ -53,14 +56,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
device.alarm_keypress(keypress)
|
||||
|
||||
hass.services.register(
|
||||
DOMAIN_ALARMDECODER,
|
||||
DOMAIN,
|
||||
SERVICE_ALARM_KEYPRESS,
|
||||
alarm_keypress_handler,
|
||||
schema=ALARM_KEYPRESS_SCHEMA,
|
||||
)
|
||||
|
||||
|
||||
class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
|
||||
class AlarmDecoderAlarmPanel(AlarmControlPanel):
|
||||
"""Representation of an AlarmDecoder-based alarm panel."""
|
||||
|
||||
def __init__(self):
|
||||
@ -120,7 +123,7 @@ class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
|
||||
@property
|
||||
def code_format(self):
|
||||
"""Return one or more digits/characters."""
|
||||
return alarm.FORMAT_NUMBER
|
||||
return FORMAT_NUMBER
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
|
@ -7,3 +7,13 @@ alarm_keypress:
|
||||
keypress:
|
||||
description: 'String to send to the alarm panel.'
|
||||
example: '*71'
|
||||
|
||||
alarm_toggle_chime:
|
||||
description: Send the alarm the toggle chime command.
|
||||
fields:
|
||||
entity_id:
|
||||
description: Name of the alarm control panel to trigger.
|
||||
example: 'alarm_control_panel.downstairs'
|
||||
code:
|
||||
description: A required code to toggle the alarm control panel chime with.
|
||||
example: 1234
|
||||
|
Loading…
x
Reference in New Issue
Block a user