Last minute tweaks to deCONZ alarm panel entity service(#49819)

Text for entry and exit delay was wrong
Remove functions that need a bit more investigating
pull/49821/head
Robert Svensson 2021-04-28 18:54:53 +02:00 committed by GitHub
parent e85d58c3a1
commit 311e0e4185
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 63 deletions

View File

@ -32,9 +32,6 @@ from .const import NEW_SENSOR
from .deconz_device import DeconzDevice
from .gateway import get_gateway_from_config_entry
PANEL_ARMING_AWAY = "arming_away"
PANEL_ARMING_HOME = "arming_home"
PANEL_ARMING_NIGHT = "arming_night"
PANEL_ENTRY_DELAY = "entry_delay"
PANEL_EXIT_DELAY = "exit_delay"
PANEL_NOT_READY_TO_ARM = "not_ready_to_arm"
@ -44,9 +41,6 @@ CONF_ALARM_PANEL_STATE = "panel_state"
SERVICE_ALARM_PANEL_STATE_SCHEMA = {
vol.Required(CONF_ALARM_PANEL_STATE): vol.In(
[
PANEL_ARMING_AWAY,
PANEL_ARMING_HOME,
PANEL_ARMING_NIGHT,
PANEL_ENTRY_DELAY,
PANEL_EXIT_DELAY,
PANEL_NOT_READY_TO_ARM,
@ -118,9 +112,6 @@ class DeconzAlarmControlPanel(DeconzDevice, AlarmControlPanelEntity):
self._features |= SUPPORT_ALARM_ARM_NIGHT
self._service_to_device_panel_command = {
PANEL_ARMING_AWAY: self._device.arming_away,
PANEL_ARMING_HOME: self._device.arming_stay,
PANEL_ARMING_NIGHT: self._device.arming_night,
PANEL_ENTRY_DELAY: self._device.entry_delay,
PANEL_EXIT_DELAY: self._device.exit_delay,
PANEL_NOT_READY_TO_ARM: self._device.not_ready_to_arm,

View File

@ -76,17 +76,13 @@ alarm_panel_state:
panel_state:
name: Panel state
description: >-
- "arming_away/home/night": set panel in right visual arming state.
- "entry_delay": make panel beep until panel is disarmed. Beep interval is short.
- "exit_delay": make panel beep until panel is set to armed state. Beep interval is long.
- "entry_delay": make panel beep until panel is disarmed. Beep interval is long.
- "exit_delay": make panel beep until panel is set to armed state. Beep interval is short.
- "not_ready_to_arm": turn on yellow status led on the panel. Indicate not all conditions for arming are met.
required: true
selector:
select:
options:
- "arming_away"
- "arming_home"
- "arming_night"
- "entry_delay"
- "exit_delay"
- "not_ready_to_arm"

View File

@ -6,9 +6,6 @@ from pydeconz.sensor import (
ANCILLARY_CONTROL_ARMED_AWAY,
ANCILLARY_CONTROL_ARMED_NIGHT,
ANCILLARY_CONTROL_ARMED_STAY,
ANCILLARY_CONTROL_ARMING_AWAY,
ANCILLARY_CONTROL_ARMING_NIGHT,
ANCILLARY_CONTROL_ARMING_STAY,
ANCILLARY_CONTROL_DISARMED,
ANCILLARY_CONTROL_ENTRY_DELAY,
ANCILLARY_CONTROL_EXIT_DELAY,
@ -20,9 +17,6 @@ from homeassistant.components.alarm_control_panel import (
)
from homeassistant.components.deconz.alarm_control_panel import (
CONF_ALARM_PANEL_STATE,
PANEL_ARMING_AWAY,
PANEL_ARMING_HOME,
PANEL_ARMING_NIGHT,
PANEL_ENTRY_DELAY,
PANEL_EXIT_DELAY,
PANEL_NOT_READY_TO_ARM,
@ -223,45 +217,6 @@ async def test_alarm_control_panel(hass, aioclient_mock, mock_deconz_websocket):
# Verify entity service calls
# Service set panel to arming away
await hass.services.async_call(
DECONZ_DOMAIN,
SERVICE_ALARM_PANEL_STATE,
{
ATTR_ENTITY_ID: "alarm_control_panel.keypad",
CONF_ALARM_PANEL_STATE: PANEL_ARMING_AWAY,
},
blocking=True,
)
assert aioclient_mock.mock_calls[5][2] == {"panel": ANCILLARY_CONTROL_ARMING_AWAY}
# Service set panel to arming home
await hass.services.async_call(
DECONZ_DOMAIN,
SERVICE_ALARM_PANEL_STATE,
{
ATTR_ENTITY_ID: "alarm_control_panel.keypad",
CONF_ALARM_PANEL_STATE: PANEL_ARMING_HOME,
},
blocking=True,
)
assert aioclient_mock.mock_calls[6][2] == {"panel": ANCILLARY_CONTROL_ARMING_STAY}
# Service set panel to arming night
await hass.services.async_call(
DECONZ_DOMAIN,
SERVICE_ALARM_PANEL_STATE,
{
ATTR_ENTITY_ID: "alarm_control_panel.keypad",
CONF_ALARM_PANEL_STATE: PANEL_ARMING_NIGHT,
},
blocking=True,
)
assert aioclient_mock.mock_calls[7][2] == {"panel": ANCILLARY_CONTROL_ARMING_NIGHT}
# Service set panel to entry delay
await hass.services.async_call(
@ -273,7 +228,7 @@ async def test_alarm_control_panel(hass, aioclient_mock, mock_deconz_websocket):
},
blocking=True,
)
assert aioclient_mock.mock_calls[8][2] == {"panel": ANCILLARY_CONTROL_ENTRY_DELAY}
assert aioclient_mock.mock_calls[5][2] == {"panel": ANCILLARY_CONTROL_ENTRY_DELAY}
# Service set panel to exit delay
@ -286,7 +241,7 @@ async def test_alarm_control_panel(hass, aioclient_mock, mock_deconz_websocket):
},
blocking=True,
)
assert aioclient_mock.mock_calls[9][2] == {"panel": ANCILLARY_CONTROL_EXIT_DELAY}
assert aioclient_mock.mock_calls[6][2] == {"panel": ANCILLARY_CONTROL_EXIT_DELAY}
# Service set panel to not ready to arm
@ -299,7 +254,7 @@ async def test_alarm_control_panel(hass, aioclient_mock, mock_deconz_websocket):
},
blocking=True,
)
assert aioclient_mock.mock_calls[10][2] == {
assert aioclient_mock.mock_calls[7][2] == {
"panel": ANCILLARY_CONTROL_NOT_READY_TO_ARM
}