From edb24add6ba3100a1727b035e53beb5211ba7641 Mon Sep 17 00:00:00 2001 From: Daren Lord Date: Fri, 15 Jan 2016 22:15:31 -0700 Subject: [PATCH] Fixed but when alarm is trying to change state the state gets updated and changes the page. --- .../alarm_control_panel/alarmdotcom.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/alarm_control_panel/alarmdotcom.py b/homeassistant/components/alarm_control_panel/alarmdotcom.py index d10afc429e6..f53f7bc3227 100644 --- a/homeassistant/components/alarm_control_panel/alarmdotcom.py +++ b/homeassistant/components/alarm_control_panel/alarmdotcom.py @@ -51,6 +51,8 @@ class AlarmDotCom(alarm.AlarmControlPanel): self._hass = hass self._name = name self._code = str(code) if code else None + self._username = username + self._password = password @property def should_poll(self): @@ -79,19 +81,28 @@ class AlarmDotCom(alarm.AlarmControlPanel): def alarm_disarm(self, code=None): if not self._validate_code(code, 'arming home'): return - self._alarm.disarm() + from pyalarmdotcom.pyalarmdotcom import Alarmdotcom + # Open another session to alarm.com to fire off the command + _alarm = Alarmdotcom(self._username, self._password, timeout=10) + _alarm.disarm() self.update_ha_state() def alarm_arm_home(self, code=None): if not self._validate_code(code, 'arming home'): return - self._alarm.arm_stay() + from pyalarmdotcom.pyalarmdotcom import Alarmdotcom + # Open another session to alarm.com to fire off the command + _alarm = Alarmdotcom(self._username, self._password, timeout=10) + _alarm.arm_stay() self.update_ha_state() def alarm_arm_away(self, code=None): if not self._validate_code(code, 'arming home'): return - self._alarm.arm_away() + from pyalarmdotcom.pyalarmdotcom import Alarmdotcom + # Open another session to alarm.com to fire off the command + _alarm = Alarmdotcom(self._username, self._password, timeout=10) + _alarm.arm_away() self.update_ha_state() def _validate_code(self, code, state):