Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bwalarm.py #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions custom_components/alarm_control_panel/bwalarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

"""

REQUIREMENTS = ['ruamel.yaml==0.15.42']
REQUIREMENTS = ['ruamel.yaml>=0.15.42']

import asyncio
import sys
Expand Down Expand Up @@ -688,7 +688,11 @@ def state_change_listener(self, event):
@property
def code_format(self):
"""One or more characters."""
return None if self._code is None else '.+'
if self._code is None:
return None
if isinstance(self._code, str) and re.search('^\\d+$', self._code):
return alarm.FORMAT_NUMBER
return alarm.FORMAT_TEXT

def alarm_disarm(self, code=None):
#If the provided code matches the panic alarm then deactivate the alarm but set the state of the panic mode to active.
Expand Down