Skip to content

Commit

Permalink
Merge pull request #60 from ajschmidt8/regex-fix
Browse files Browse the repository at this point in the history
Parse regex result as `int`
  • Loading branch information
f34rdotcom authored May 31, 2021
2 parents 8a1a917 + 674a31b commit bd5762c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion alarmdecoder/zonetracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def update(self, message):
if match is None:
return

zone = match.group(1)
zone = int(match.group(1))

# Add new zones and clear expired ones.
if zone in self._zones_faulted:
Expand Down
2 changes: 1 addition & 1 deletion test/test_zonetracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_ECP_failure(self):
msg = Message('[00000000000000100A--],0bf,[f707000600e5800c0c020000],"CHECK 1 "')
self._zonetracker.update(msg)

self.assertEqual(self._zonetracker._zones['1'].status, Zone.CHECK)
self.assertEqual(self._zonetracker._zones[1].status, Zone.CHECK)

def test_zone_restore_skip(self):
panel_messages = [
Expand Down

0 comments on commit bd5762c

Please sign in to comment.