Fix issue #23758 - Restore Canary sensors and ensure alarm con… (#32627)

* Fixed missing Canary sensors and Canary alarm control panel that was not updating correctly

* Resolved pylinting warnings in original tests
This commit is contained in:
chiefdragon 2020-03-11 18:58:42 +00:00 committed by GitHub
parent d28d1ff657
commit 3e8728ad5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 48 deletions

View file

@ -49,7 +49,6 @@ class CanaryAlarm(AlarmControlPanel):
@property
def state(self):
"""Return the state of the device."""
location = self._data.get_location(self._location_id)
if location.is_private:
@ -82,15 +81,16 @@ class CanaryAlarm(AlarmControlPanel):
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._data.set_location_mode(self._location_id, LOCATION_MODE_HOME)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._data.set_location_mode(self._location_id, LOCATION_MODE_AWAY)
def alarm_arm_night(self, code=None):
"""Send arm night command."""
self._data.set_location_mode(self._location_id, LOCATION_MODE_NIGHT)
def update(self):
"""Get the latest state of the sensor."""
self._data.update()