Skip to content

Commit

Permalink
update envisalink service domain (#29126)
Browse files Browse the repository at this point in the history
  • Loading branch information
raman325 authored and pvizeli committed Nov 27, 2019
1 parent 1681d36 commit 2d2ab45
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
10 changes: 0 additions & 10 deletions homeassistant/components/alarm_control_panel/services.yaml
Expand Up @@ -60,16 +60,6 @@ alarm_trigger:
description: An optional code to trigger the alarm control panel with.
example: 1234

envisalink_alarm_keypress:
description: Send custom keypresses to the alarm.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
keypress:
description: 'String to send to the alarm panel (1-6 characters).'
example: '*71'

alarmdecoder_alarm_toggle_chime:
description: Send the alarm the toggle chime command.
fields:
Expand Down
14 changes: 9 additions & 5 deletions homeassistant/components/envisalink/alarm_control_panel.py
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 @@ -29,6 +32,7 @@
CONF_PANIC,
CONF_PARTITIONNAME,
DATA_EVL,
DOMAIN,
PARTITION_SCHEMA,
SIGNAL_KEYPAD_UPDATE,
SIGNAL_PARTITION_UPDATE,
Expand All @@ -37,7 +41,7 @@

_LOGGER = logging.getLogger(__name__)

SERVICE_ALARM_KEYPRESS = "envisalink_alarm_keypress"
SERVICE_ALARM_KEYPRESS = "alarm_keypress"
ATTR_KEYPRESS = "keypress"
ALARM_KEYPRESS_SCHEMA = vol.Schema(
{
Expand Down Expand Up @@ -83,7 +87,7 @@ def alarm_keypress_handler(service):
device.async_alarm_keypress(keypress)

hass.services.async_register(
alarm.DOMAIN,
DOMAIN,
SERVICE_ALARM_KEYPRESS,
alarm_keypress_handler,
schema=ALARM_KEYPRESS_SCHEMA,
Expand All @@ -92,7 +96,7 @@ def alarm_keypress_handler(service):
return True


class EnvisalinkAlarm(EnvisalinkDevice, alarm.AlarmControlPanel):
class EnvisalinkAlarm(EnvisalinkDevice, AlarmControlPanel):
"""Representation of an Envisalink-based alarm panel."""

def __init__(
Expand Down Expand Up @@ -124,7 +128,7 @@ def code_format(self):
"""Regex for code format or None if no code is required."""
if self._code:
return None
return alarm.FORMAT_NUMBER
return FORMAT_NUMBER

@property
def state(self):
Expand Down
10 changes: 10 additions & 0 deletions homeassistant/components/envisalink/services.yaml
@@ -1,5 +1,15 @@
# Describes the format for available Envisalink services.

alarm_keypress:
description: Send custom keypresses to the alarm.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
keypress:
description: 'String to send to the alarm panel (1-6 characters).'
example: '*71'

invoke_custom_function:
description: >
Allows users with DSC panels to trigger a PGM output (1-4).
Expand Down

0 comments on commit 2d2ab45

Please sign in to comment.