mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
fixes from review
This commit is contained in:
parent
6c3a78df30
commit
13ca42e187
@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.alarm_control_panel
|
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
|
import logging
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
@ -100,9 +100,9 @@ class AlarmControlPanel(Entity):
|
|||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def alarm_arm_home(self, code):
|
def alarm_arm_home(self, code):
|
||||||
""" Send pause command. """
|
""" Send arm home command. """
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def alarm_arm_away(self, code):
|
def alarm_arm_away(self, code):
|
||||||
""" Send pause command. """
|
""" Send arm away command. """
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
@ -49,6 +49,12 @@ class VerisureAlarm(alarm.AlarmControlPanel):
|
|||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
""" Returns the state of the device. """
|
""" 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':
|
if verisure.STATUS[self._device][self._id].status == 'unarmed':
|
||||||
self._state = STATE_ALARM_DISARMED
|
self._state = STATE_ALARM_DISARMED
|
||||||
elif verisure.STATUS[self._device][self._id].status == 'armedhome':
|
elif verisure.STATUS[self._device][self._id].status == 'armedhome':
|
||||||
@ -59,11 +65,6 @@ class VerisureAlarm(alarm.AlarmControlPanel):
|
|||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
'Unknown alarm state %s',
|
'Unknown alarm state %s',
|
||||||
verisure.STATUS[self._device][self._id].status)
|
verisure.STATUS[self._device][self._id].status)
|
||||||
return self._state
|
|
||||||
|
|
||||||
def update(self):
|
|
||||||
''' update alarm status '''
|
|
||||||
verisure.update()
|
|
||||||
|
|
||||||
def alarm_disarm(self, code):
|
def alarm_disarm(self, code):
|
||||||
""" Send disarm command. """
|
""" Send disarm command. """
|
||||||
|
@ -125,7 +125,7 @@ def setup(hass, config):
|
|||||||
# Load components for the devices in the ISY controller that we support
|
# Load components for the devices in the ISY controller that we support
|
||||||
for comp_name, discovery in ((('sensor', DISCOVER_SENSORS),
|
for comp_name, discovery in ((('sensor', DISCOVER_SENSORS),
|
||||||
('switch', DISCOVER_SWITCHES),
|
('switch', DISCOVER_SWITCHES),
|
||||||
('alarm', DISCOVER_ALARMS))):
|
('alarm_control_panel', DISCOVER_ALARMS))):
|
||||||
component = get_component(comp_name)
|
component = get_component(comp_name)
|
||||||
_LOGGER.info(config[DOMAIN])
|
_LOGGER.info(config[DOMAIN])
|
||||||
bootstrap.setup_component(hass, component.DOMAIN, config)
|
bootstrap.setup_component(hass, component.DOMAIN, config)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user