Change ACP code_format to None|"Number"|"Any" (#14686)
parent
08fc73aa20
commit
7094d6d61e
|
@ -101,7 +101,7 @@ class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return one or more digits/characters."""
|
"""Return one or more digits/characters."""
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -84,8 +84,8 @@ class AlarmDotCom(alarm.AlarmControlPanel):
|
||||||
if self._code is None:
|
if self._code is None:
|
||||||
return None
|
return None
|
||||||
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
return '.+'
|
return 'Any'
|
||||||
|
|
||||||
@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 '^\\d+$'
|
return 'Number'
|
||||||
|
|
||||||
@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+$'
|
return 'Number'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -129,8 +129,8 @@ class IFTTTAlarmPanel(alarm.AlarmControlPanel):
|
||||||
if self._code is None:
|
if self._code is None:
|
||||||
return None
|
return None
|
||||||
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
return '.+'
|
return 'Any'
|
||||||
|
|
||||||
def alarm_disarm(self, code=None):
|
def alarm_disarm(self, code=None):
|
||||||
"""Send disarm command."""
|
"""Send disarm command."""
|
||||||
|
|
|
@ -206,8 +206,8 @@ class ManualAlarm(alarm.AlarmControlPanel):
|
||||||
if self._code is None:
|
if self._code is None:
|
||||||
return None
|
return None
|
||||||
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
return '.+'
|
return 'Any'
|
||||||
|
|
||||||
def alarm_disarm(self, code=None):
|
def alarm_disarm(self, code=None):
|
||||||
"""Send disarm command."""
|
"""Send disarm command."""
|
||||||
|
|
|
@ -242,8 +242,8 @@ class ManualMQTTAlarm(alarm.AlarmControlPanel):
|
||||||
if self._code is None:
|
if self._code is None:
|
||||||
return None
|
return None
|
||||||
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
return '.+'
|
return 'Any'
|
||||||
|
|
||||||
def alarm_disarm(self, code=None):
|
def alarm_disarm(self, code=None):
|
||||||
"""Send disarm command."""
|
"""Send disarm command."""
|
||||||
|
|
|
@ -122,8 +122,8 @@ class MqttAlarm(MqttAvailability, alarm.AlarmControlPanel):
|
||||||
if self._code is None:
|
if self._code is None:
|
||||||
return None
|
return None
|
||||||
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
return '.+'
|
return 'Any'
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_alarm_disarm(self, code=None):
|
def async_alarm_disarm(self, code=None):
|
||||||
|
|
|
@ -70,7 +70,7 @@ class NX584Alarm(alarm.AlarmControlPanel):
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return one or more digits/characters."""
|
"""Return one or more digits/characters."""
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -66,7 +66,7 @@ class SatelIntegraAlarmPanel(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 the regex for code format or None if no code is required."""
|
||||||
return '^\\d{4,6}$'
|
return 'Number'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -88,8 +88,8 @@ class SimpliSafeAlarm(alarm.AlarmControlPanel):
|
||||||
if self._code is None:
|
if self._code is None:
|
||||||
return None
|
return None
|
||||||
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
return '.+'
|
return 'Any'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
@ -61,7 +61,7 @@ class VerisureAlarm(alarm.AlarmControlPanel):
|
||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
"""Return one or more digits/characters."""
|
"""Return one or more digits/characters."""
|
||||||
return '^\\d+$'
|
return 'Number'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def changed_by(self):
|
def changed_by(self):
|
||||||
|
|
Loading…
Reference in New Issue