Add pin pad to alarm panel (#14178)
* Add pin pad to alarm panel * Add pin pad to alarm panel * Update regex * Update regex * Update regex * Add pin pad to alarm panel * Add pin pad to alarm panel * Add pin pad to alarm panel * Add pin pad to alarm panel * Fix typos * Fix typos * Fix typos * Add pin pad to alarm panel * Fix errors
This commit is contained in:
parent
6c3e2021df
commit
9bc26e93a4
11 changed files with 50 additions and 20 deletions
|
@ -100,8 +100,8 @@ class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return the regex for code format or None if no code is required."""
|
"""Return one or more digits/characters."""
|
||||||
return '^\\d{4,6}$'
|
return '^\\d+$'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -6,6 +6,7 @@ https://home-assistant.io/components/alarm_control_panel.alarmdotcom/
|
||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -79,8 +80,12 @@ class AlarmDotCom(alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return one or more characters if code is defined."""
|
"""Return one or more digits/characters."""
|
||||||
return None if self._code is None else '.+'
|
if self._code is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
|
return '^\\d+$'
|
||||||
|
return '.+'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -80,7 +80,7 @@ class Concord232Alarm(alarm.AlarmControlPanel):
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return the characters if code is defined."""
|
"""Return the characters if code is defined."""
|
||||||
return '[0-9]{4}([0-9]{2})?'
|
return '^\\d+$'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -106,7 +106,7 @@ class EnvisalinkAlarm(EnvisalinkDevice, alarm.AlarmControlPanel):
|
||||||
"""Regex for code format or None if no code is required."""
|
"""Regex for code format or None if no code is required."""
|
||||||
if self._code:
|
if self._code:
|
||||||
return None
|
return None
|
||||||
return '^\\d{4,6}$'
|
return '^\\d+$'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -5,6 +5,7 @@ For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/alarm_control_panel.ifttt/
|
https://home-assistant.io/components/alarm_control_panel.ifttt/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -124,8 +125,12 @@ class IFTTTAlarmPanel(alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return one or more characters."""
|
"""Return one or more digits/characters."""
|
||||||
return None if self._code is None else '.+'
|
if self._code is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
|
return '^\\d+$'
|
||||||
|
return '.+'
|
||||||
|
|
||||||
def alarm_disarm(self, code=None):
|
def alarm_disarm(self, code=None):
|
||||||
"""Send disarm command."""
|
"""Send disarm command."""
|
||||||
|
|
|
@ -7,6 +7,7 @@ https://home-assistant.io/components/alarm_control_panel.manual/
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -201,8 +202,12 @@ class ManualAlarm(alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return one or more characters."""
|
"""Return one or more digits/characters."""
|
||||||
return None if self._code is None else '.+'
|
if self._code is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
|
return '^\\d+$'
|
||||||
|
return '.+'
|
||||||
|
|
||||||
def alarm_disarm(self, code=None):
|
def alarm_disarm(self, code=None):
|
||||||
"""Send disarm command."""
|
"""Send disarm command."""
|
||||||
|
|
|
@ -8,6 +8,7 @@ import asyncio
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -237,8 +238,12 @@ class ManualMQTTAlarm(alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return one or more characters."""
|
"""Return one or more digits/characters."""
|
||||||
return None if self._code is None else '.+'
|
if self._code is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
|
return '^\\d+$'
|
||||||
|
return '.+'
|
||||||
|
|
||||||
def alarm_disarm(self, code=None):
|
def alarm_disarm(self, code=None):
|
||||||
"""Send disarm command."""
|
"""Send disarm command."""
|
||||||
|
|
|
@ -6,6 +6,7 @@ https://home-assistant.io/components/alarm_control_panel.mqtt/
|
||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -117,8 +118,12 @@ class MqttAlarm(MqttAvailability, alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""One or more characters if code is defined."""
|
"""Return one or more digits/characters."""
|
||||||
return None if self._code is None else '.+'
|
if self._code is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
|
return '^\\d+$'
|
||||||
|
return '.+'
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_alarm_disarm(self, code=None):
|
def async_alarm_disarm(self, code=None):
|
||||||
|
|
|
@ -69,8 +69,8 @@ class NX584Alarm(alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return che characters if code is defined."""
|
"""Return one or more digits/characters."""
|
||||||
return '[0-9]{4}([0-9]{2})?'
|
return '^\\d+$'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -5,6 +5,7 @@ For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/alarm_control_panel.simplisafe/
|
https://home-assistant.io/components/alarm_control_panel.simplisafe/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -83,8 +84,12 @@ class SimpliSafeAlarm(alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return one or more characters if code is defined."""
|
"""Return one or more digits/characters."""
|
||||||
return None if self._code is None else '.+'
|
if self._code is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
|
return '^\\d+$'
|
||||||
|
return '.+'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -60,8 +60,8 @@ class VerisureAlarm(alarm.AlarmControlPanel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return the code format as regex."""
|
"""Return one or more digits/characters."""
|
||||||
return '^\\d{%s}$' % self._digits
|
return '^\\d+$'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def changed_by(self):
|
def changed_by(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue