Change ACP code_format to None|"Number"|"Any" (#14686)

pull/14328/merge
c727 2018-05-31 14:31:40 +02:00 committed by Martin Hjelmare
parent 08fc73aa20
commit 7094d6d61e
12 changed files with 18 additions and 18 deletions

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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."""

View File

@ -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."""

View File

@ -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."""

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):