From 615548f780ca07534e34cce870d26cc7fd96bd43 Mon Sep 17 00:00:00 2001 From: Scott Petersen Date: Thu, 23 Mar 2017 13:03:39 -0700 Subject: [PATCH] Added ability to differentiate between stay and away in on_arm events. --- alarmdecoder/decoder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alarmdecoder/decoder.py b/alarmdecoder/decoder.py index 667ac34..5a88ba2 100644 --- a/alarmdecoder/decoder.py +++ b/alarmdecoder/decoder.py @@ -116,6 +116,7 @@ class AlarmDecoder(object): self._alarm_status = None self._bypass_status = None self._armed_status = None + self._armed_stay = False self._fire_status = (False, 0) self._battery_status = (False, 0) self._panic_status = False @@ -615,10 +616,11 @@ class AlarmDecoder(object): message_status = message.armed_away | message.armed_home if message_status != self._armed_status: self._armed_status, old_status = message_status, self._armed_status + self._armed_stay = message.armed_home if old_status is not None: if self._armed_status: - self.on_arm() + self.on_arm(stay=message.armed_home) else: self.on_disarm()