From 3dd1543c17678859039bbce17afd757d4dd22ad4 Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Mon, 31 May 2021 19:09:29 -0400 Subject: [PATCH 1/2] parse regex as int --- alarmdecoder/zonetracking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alarmdecoder/zonetracking.py b/alarmdecoder/zonetracking.py index 13be3c3..ae92eb7 100644 --- a/alarmdecoder/zonetracking.py +++ b/alarmdecoder/zonetracking.py @@ -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: From 674a31b1507a77d1ca754c1e95aa656fdeb0628d Mon Sep 17 00:00:00 2001 From: AJ Schmidt Date: Mon, 31 May 2021 19:17:56 -0400 Subject: [PATCH 2/2] update tests --- test/test_zonetracking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_zonetracking.py b/test/test_zonetracking.py index 6d8f087..0156871 100644 --- a/test/test_zonetracking.py +++ b/test/test_zonetracking.py @@ -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 = [