diff --git a/homeassistant/components/alarm_control_panel/services.yaml b/homeassistant/components/alarm_control_panel/services.yaml index 4b8f54c3d17..b31cb718b3f 100644 --- a/homeassistant/components/alarm_control_panel/services.yaml +++ b/homeassistant/components/alarm_control_panel/services.yaml @@ -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 diff --git a/homeassistant/components/alarmdecoder/alarm_control_panel.py b/homeassistant/components/alarmdecoder/alarm_control_panel.py index f9bff3bfda7..d2e9fd136a8 100644 --- a/homeassistant/components/alarmdecoder/alarm_control_panel.py +++ b/homeassistant/components/alarmdecoder/alarm_control_panel.py @@ -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): diff --git a/homeassistant/components/alarmdecoder/services.yaml b/homeassistant/components/alarmdecoder/services.yaml index 55451d42f13..12268d48bb7 100644 --- a/homeassistant/components/alarmdecoder/services.yaml +++ b/homeassistant/components/alarmdecoder/services.yaml @@ -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