Fix PEP257 issues
This commit is contained in:
parent
f6bc1a4575
commit
3a4250133a
6 changed files with 32 additions and 21 deletions
|
@ -22,7 +22,7 @@ DEFAULT_TRIGGER_TIME = 120
|
|||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Sets up the manual alarm platform."""
|
||||
"""Setup the manual alarm platform."""
|
||||
add_devices([ManualAlarm(
|
||||
hass,
|
||||
config.get('name', DEFAULT_ALARM_NAME),
|
||||
|
@ -42,7 +42,9 @@ class ManualAlarm(alarm.AlarmControlPanel):
|
|||
When triggered, will be pending for 'trigger_time'. After that will be
|
||||
triggered for 'trigger_time', after that we return to disarmed.
|
||||
"""
|
||||
|
||||
def __init__(self, hass, name, code, pending_time, trigger_time):
|
||||
"""Initalize the manual alarm panel."""
|
||||
self._state = STATE_ALARM_DISARMED
|
||||
self._hass = hass
|
||||
self._name = name
|
||||
|
@ -58,12 +60,12 @@ class ManualAlarm(alarm.AlarmControlPanel):
|
|||
|
||||
@property
|
||||
def name(self):
|
||||
"""Returns the name of the device."""
|
||||
"""Return the name of the device."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""Returns the state of the device."""
|
||||
"""Return the state of the device."""
|
||||
if self._state in (STATE_ALARM_ARMED_HOME,
|
||||
STATE_ALARM_ARMED_AWAY) and \
|
||||
self._pending_time and self._state_ts + self._pending_time > \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue