Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions homeassistant/components/alarm_control_panel/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 10 additions & 7 deletions homeassistant/components/alarmdecoder/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

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,
Expand All @@ -18,11 +21,11 @@
)
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"
Expand All @@ -41,7 +44,7 @@ def alarm_toggle_chime_handler(service):
device.alarm_toggle_chime(code)

hass.services.register(
alarm.DOMAIN,
DOMAIN,
SERVICE_ALARM_TOGGLE_CHIME,
alarm_toggle_chime_handler,
schema=ALARM_TOGGLE_CHIME_SCHEMA,
Expand All @@ -53,14 +56,14 @@ def alarm_keypress_handler(service):
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):
Expand Down Expand Up @@ -120,7 +123,7 @@ def should_poll(self):
@property
def code_format(self):
"""Return one or more digits/characters."""
return alarm.FORMAT_NUMBER
return FORMAT_NUMBER

@property
def state(self):
Expand Down
10 changes: 10 additions & 0 deletions homeassistant/components/alarmdecoder/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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