mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
updates to support ui
This commit is contained in:
parent
f28b392f1a
commit
5cf9bd7223
@ -29,9 +29,11 @@ SERVICE_TO_METHOD = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ATTR_CODE = 'code'
|
ATTR_CODE = 'code'
|
||||||
|
ATTR_CODE_FORMAT = 'code_format'
|
||||||
|
|
||||||
ATTR_TO_PROPERTY = [
|
ATTR_TO_PROPERTY = [
|
||||||
ATTR_CODE,
|
ATTR_CODE,
|
||||||
|
ATTR_CODE_FORMAT
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -113,3 +115,11 @@ class AlarmControlPanel(Entity):
|
|||||||
def alarm_arm_away(self, code=None):
|
def alarm_arm_away(self, code=None):
|
||||||
""" Send arm away command. """
|
""" Send arm away command. """
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def state_attributes(self):
|
||||||
|
""" Return the state attributes. """
|
||||||
|
state_attr = {
|
||||||
|
ATTR_CODE_FORMAT: self.code_format,
|
||||||
|
}
|
||||||
|
return state_attr
|
||||||
|
@ -54,7 +54,7 @@ class VerisureAlarm(alarm.AlarmControlPanel):
|
|||||||
@property
|
@property
|
||||||
def code_format(self):
|
def code_format(self):
|
||||||
""" Four digit code required"""
|
""" Four digit code required"""
|
||||||
return '[0-9]{4}'
|
return '^\\d{4}$'
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
''' update alarm status '''
|
''' update alarm status '''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user