fixes from review

This commit is contained in:
Per Sandström 2015-09-14 17:33:43 +02:00
parent 6c3a78df30
commit 13ca42e187
3 changed files with 10 additions and 9 deletions

View File

@ -1,7 +1,7 @@
"""
homeassistant.components.alarm_control_panel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component to interface with various sensors that can be monitored.
Component to interface with a alarm control panel.
"""
import logging
from homeassistant.helpers.entity import Entity
@ -100,9 +100,9 @@ class AlarmControlPanel(Entity):
raise NotImplementedError()
def alarm_arm_home(self, code):
""" Send pause command. """
""" Send arm home command. """
raise NotImplementedError()
def alarm_arm_away(self, code):
""" Send pause command. """
""" Send arm away command. """
raise NotImplementedError()

View File

@ -49,6 +49,12 @@ class VerisureAlarm(alarm.AlarmControlPanel):
@property
def state(self):
""" Returns the state of the device. """
return self._state
def update(self):
''' update alarm status '''
verisure.update()
if verisure.STATUS[self._device][self._id].status == 'unarmed':
self._state = STATE_ALARM_DISARMED
elif verisure.STATUS[self._device][self._id].status == 'armedhome':
@ -59,11 +65,6 @@ class VerisureAlarm(alarm.AlarmControlPanel):
_LOGGER.error(
'Unknown alarm state %s',
verisure.STATUS[self._device][self._id].status)
return self._state
def update(self):
''' update alarm status '''
verisure.update()
def alarm_disarm(self, code):
""" Send disarm command. """

View File

@ -125,7 +125,7 @@ def setup(hass, config):
# Load components for the devices in the ISY controller that we support
for comp_name, discovery in ((('sensor', DISCOVER_SENSORS),
('switch', DISCOVER_SWITCHES),
('alarm', DISCOVER_ALARMS))):
('alarm_control_panel', DISCOVER_ALARMS))):
component = get_component(comp_name)
_LOGGER.info(config[DOMAIN])
bootstrap.setup_component(hass, component.DOMAIN, config)