Skip to content
Merged

0.53 #9327

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
044b96e
Version bump to 0.53.0.dev0
balloob Aug 25, 2017
8775c54
Refactor mysensors callback and add validation (#9069)
MartinHjelmare Aug 25, 2017
56083c0
Xiaomi Philips Lights integration (#9087)
syssi Aug 26, 2017
0d3fa59
Fix issue #9116 in pushbullet (#9128)
Danielhiversen Aug 26, 2017
f4d464c
Fix import for foscam (#9140)
sdague Aug 26, 2017
493353e
bug fix pushbullet (#9139)
Danielhiversen Aug 26, 2017
c537770
Close stream request once we end up with proxy (#9110)
foxel Aug 26, 2017
c73338b
Backend changes for customize config panel. (#9134)
andrey-git Aug 26, 2017
21bf089
Bump aioautomatic to prevent leaking exceptions (#9148)
emlove Aug 26, 2017
8605098
Wrap state when iterating a domain in templates (#9157)
balloob Aug 27, 2017
ae5fca1
Upgrade async_timeout to 1.3.0 (#9156)
fabaff Aug 27, 2017
7062c2b
Remove links to gitter (#9155)
fabaff Aug 27, 2017
f47de06
Upgrade sphinx-autodoc-typehints to 1.2.3 (#9151)
fabaff Aug 27, 2017
8fdd971
Upgrade uber_rides to 0.5.2 (#9149)
fabaff Aug 27, 2017
c367021
Allow specifying custom html urls to load. (#9150)
andrey-git Aug 27, 2017
5629157
Allow getting number of available states in template (#9158)
balloob Aug 27, 2017
499d54c
upgrade xiaomi lib to 0.3.1 to supprt water sensor (#9168)
Danielhiversen Aug 27, 2017
cd3f0f8
Use node_modules gulp in script/build_frontend (#9170)
emlove Aug 27, 2017
654f689
Mysensors nodes can be renamed in config file (#9123)
EmitKiwi Aug 27, 2017
bf315da
Xiaomi gateway: Device support for the Aqara Water Leak Sensor (senso…
syssi Aug 27, 2017
de48d42
"TypeError: write_to_hub() takes 2 positional arguments but 4 were gi…
syssi Aug 27, 2017
bd039b8
Mycroft notify/component (#9173)
btotharye Aug 27, 2017
f6a701e
Bumped the version of PyISY
rmkraus Aug 28, 2017
2533b49
Merge pull request #9182 from home-assistant/pyisy-update
rmkraus Aug 28, 2017
f9c22b0
bump ecobee version to fix issue 9190 (#9191)
nkgilley Aug 28, 2017
924290a
Update frontend
balloob Aug 28, 2017
cc18b5a
Prevent iCloud exceptions in logfile (#9179)
mjj4791 Aug 28, 2017
e76e9e0
Fix dht22 when no data was read initially #8976 (#9198)
maweki Aug 28, 2017
6505019
Update pushbullet.py (#9200)
bobnwk Aug 29, 2017
0de6a37
fix worldtidesinfo #9184 (#9201)
Aug 29, 2017
75559cb
Add "status" to Sonarr sensor (#9204)
tboyce021 Aug 29, 2017
5d800c1
Prevent error when no forecast data was available (#9176)
mjj4791 Aug 29, 2017
3807150
Fix and optimize digitalloggers platform (#9203)
dale3h Aug 29, 2017
0687a45
Add counter component (#9146)
fabaff Aug 29, 2017
3e0eb87
Support for season sensor (#8958)
Aug 29, 2017
aa8dd8f
Issue #6893 in rfxtrx (#9130)
Danielhiversen Aug 29, 2017
ee28b43
Refactor rfxtrx (#9117)
Danielhiversen Aug 29, 2017
b8d737c
Upgrade pymysensors to 0.11.1 (#9212)
MartinHjelmare Aug 29, 2017
81a00bf
Lint Sonarr tests
balloob Aug 29, 2017
33c906c
Abode push events and lock, cover, and switch components (#9095)
MisterWil Aug 29, 2017
0b58d54
Add cloud auth support (#9208)
balloob Aug 29, 2017
7de73e9
Bayesian Binary Sensor (#8810)
jlmcgehee21 Aug 29, 2017
ebc7ade
directv: extended discovery via REST api, bug fix (#8800)
sielicki Aug 29, 2017
8673e53
Upgrade pyasn1 to 0.3.3 and pyasn1-modules to 0.1.1 (#9216)
fabaff Aug 30, 2017
4aafcfa
Upgrade sendgrid to 5.0.1 (#9215)
fabaff Aug 30, 2017
f76436f
Fix fitbit error when trying to access token after upgrade. (#9183)
tchellomello Aug 30, 2017
56f9ccb
Allow sonos to select album as a source (#9221)
commento Aug 30, 2017
3a0e38a
Add max_age to statistics sensor (#8790)
tinloaf Aug 30, 2017
f2551c0
Egardia package to .19 and change in port number for egardiaserver (#…
jeroenterheerdt Aug 30, 2017
214c92d
pushbullet, send a file from url (#9189)
Danielhiversen Aug 30, 2017
76c7eef
Add Tank Utility sensor (#9132)
krismolendyke Aug 30, 2017
10e8aea
Upgrade shodan to 1.7.5 (#9228)
fabaff Aug 30, 2017
5f445b4
Tesla platform (#9211)
zabuldon Aug 31, 2017
de4a4fe
[light.tradfri] Full range of white spectrum lightbulbs support (#9224)
matemaciek Aug 31, 2017
bb37294
Allow panels with external URL (#9214)
andrey-git Aug 31, 2017
e22ec28
Use ZCL mandatory attribute to determine ZHA light capabilities (#9232)
jkl1337 Aug 31, 2017
d816ff2
A bugfix for pushbullet (#9237)
Danielhiversen Aug 31, 2017
99c1c94
mopar sensor (#9136)
happyleavesaoc Aug 31, 2017
60342b4
Upgrade discord.py to 0.16.11 (#9239)
fabaff Aug 31, 2017
7d281fd
Skip automatic events older than latest data (#9230)
emlove Aug 31, 2017
acb6b7c
title and message was swapped in pushbullet (#9241)
Danielhiversen Aug 31, 2017
274e444
Fix possible KeyError (#9242)
MartinHjelmare Aug 31, 2017
836b528
WIP: Homematic improvments with new hass interfaces (#9058)
pvizeli Aug 31, 2017
0af4f89
Add available to sonos (#9243)
pvizeli Aug 31, 2017
a55895b
Make sure Ring binary_sensor state will update only if device_id mat…
tchellomello Sep 1, 2017
8d5f672
Added configurable timeout for receiver HTTP requests | Additional AV…
scarface-4711 Sep 1, 2017
4cd5173
upgrade xiaomi lib (#9250)
Danielhiversen Sep 1, 2017
713f7fa
Fix nello.io login (#9251)
pschmitt Sep 1, 2017
185d838
This is to fix #6386: Manual Alarm not re-arm after 2nd trigger (#9249)
snjoetw Sep 1, 2017
4defd96
Version bump of DLink switch to v0.6.0 (#9252)
LinuxChristian Sep 1, 2017
8d1f6d3
Upgrade sendgrid to 5.2.0 (#9254)
fabaff Sep 1, 2017
8797932
Upgrade psutil to 5.3.0 (#9253)
fabaff Sep 1, 2017
639eb81
Adding ZWave CentralScene activation handler. (#9178)
sirmalloc Sep 1, 2017
f51163f
Add Geofency device tracker (#9106)
gunnarhelgason Sep 1, 2017
0889e38
flux: fix for when stop_time is after midnight (#8932)
abmantis Sep 2, 2017
a78f5e0
Bump pywemo, handle more ports.
pavoni Sep 3, 2017
db36b5c
Merge pull request #9274 from home-assistant/bump_pywemo
pavoni Sep 3, 2017
7694c31
Change attribute names (#9277)
emlt Sep 3, 2017
68343ac
insteon_plm: fix typo in attributes (#9284)
drkp Sep 3, 2017
38e1b81
discovery: If unknown NetDisco service discovered, log about it. (#9280)
pfalcon Sep 3, 2017
5dfd60a
Upgrade youtube_dl to 2017.9.2 (#9279)
fabaff Sep 3, 2017
7c7a5a4
Upgrade python-telegram-bot to 8.0.0 (#9282)
fabaff Sep 3, 2017
e620768
rfxtrx lib upgrade (#9288)
Danielhiversen Sep 4, 2017
1b5e574
Fixing bug when using egardiaserver - package requirement updated to …
jeroenterheerdt Sep 4, 2017
54de3d8
Added intent_type to exception log (#9289)
andreasjacobsen93 Sep 4, 2017
67828cb
Handle spotify failing to refresh access_token (#9295)
Tommatheussen Sep 4, 2017
ed69989
Core track same state for a period / Allow on platforms (#9273)
pvizeli Sep 5, 2017
c3a9100
Improved Lutron Caseta shade support (#9302)
upsert Sep 5, 2017
984cae5
Upgrade mycroftapi to 2.0 (#9309)
btotharye Sep 5, 2017
5ba39c8
Fix for Honeywell Round thermostats (#9308)
dansarginson Sep 5, 2017
a28ac37
Update jinja to 2.9.6 (#9306)
pvizeli Sep 5, 2017
968ed6e
Ensure display-name does not exceed 12 characters for CecAdapter. (#9…
gollo Sep 5, 2017
0b1677d
Expose hue group 0 (#8663)
filcole Sep 5, 2017
9ede0f5
Added DWD WarnApp Sensor (#8657)
runningman84 Sep 5, 2017
552abf7
Add input_text component (#9112)
BioSehnsucht Sep 5, 2017
e4bb8b0
Introducing a media_player component for Yamaha Multicast devices (#9…
jalmeroth Sep 5, 2017
418ccc8
Handle the case where no registration number is available (instead di…
molobrakos Sep 5, 2017
788275d
Add post_pending_state attribute to manual alarm_control_panel (#9291)
snjoetw Sep 5, 2017
9ade800
Add new config variable to MQTT light (#9304)
belyalov Sep 5, 2017
e7a5f7b
Follow Twitter guidelines for media upload by conforming to the "STAT…
MikeChristianson Sep 6, 2017
5971a7c
Optionally disable ssl certificate validity check. (#9181)
ohmer1 Sep 6, 2017
fad914d
Version bump dlib to 1.0.0 (#9316)
arsaboo Sep 6, 2017
894200d
Fixed bug with devices not being discovered correctly. (#9311)
MisterWil Sep 6, 2017
9a7089b
Platform not ready behavior fixed. (#9325)
syssi Sep 7, 2017
77d0ad1
Stable and asynchronous KNX library. (#8725)
Julius2342 Sep 7, 2017
fc7ffba
Merge branch 'master' into release-0-53
balloob Sep 9, 2017
7036a78
Update frontend
balloob Sep 9, 2017
d2d8769
Fix for potential issue with tesla initialization (#9307)
zabuldon Sep 7, 2017
c539b5c
Adds the AirVisual air quality sensor platform (#9320)
bachya Sep 8, 2017
74bfcde
Cleanup input_text (#9326)
balloob Sep 9, 2017
3065575
Bump pyHik version to add IO support (#9341)
mezz64 Sep 9, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ omit =
homeassistant/components/tellstick.py
homeassistant/components/*/tellstick.py

homeassistant/components/tesla.py
homeassistant/components/*/tesla.py

homeassistant/components/*/thinkingcleaner.py

homeassistant/components/tradfri.py
Expand Down Expand Up @@ -328,6 +331,7 @@ omit =
homeassistant/components/light/tplink.py
homeassistant/components/light/tradfri.py
homeassistant/components/light/x10.py
homeassistant/components/light/xiaomi_philipslight.py
homeassistant/components/light/yeelight.py
homeassistant/components/light/yeelightsunflower.py
homeassistant/components/light/zengge.py
Expand Down Expand Up @@ -380,6 +384,8 @@ omit =
homeassistant/components/media_player/vlc.py
homeassistant/components/media_player/volumio.py
homeassistant/components/media_player/yamaha.py
homeassistant/components/media_player/yamaha_musiccast.py
homeassistant/components/mycroft.py
homeassistant/components/notify/aws_lambda.py
homeassistant/components/notify/aws_sns.py
homeassistant/components/notify/aws_sqs.py
Expand All @@ -397,6 +403,7 @@ omit =
homeassistant/components/notify/llamalab_automate.py
homeassistant/components/notify/matrix.py
homeassistant/components/notify/message_bird.py
homeassistant/components/notify/mycroft.py
homeassistant/components/notify/nfandroidtv.py
homeassistant/components/notify/nma.py
homeassistant/components/notify/prowl.py
Expand All @@ -420,6 +427,7 @@ omit =
homeassistant/components/remote/itach.py
homeassistant/components/scene/hunterdouglas_powerview.py
homeassistant/components/scene/lifx_cloud.py
homeassistant/components/sensor/airvisual.py
homeassistant/components/sensor/arest.py
homeassistant/components/sensor/arwn.py
homeassistant/components/sensor/bbox.py
Expand All @@ -445,6 +453,7 @@ omit =
homeassistant/components/sensor/dovado.py
homeassistant/components/sensor/dte_energy_bridge.py
homeassistant/components/sensor/dublin_bus_transport.py
homeassistant/components/sensor/dwd_weather_warnings.py
homeassistant/components/sensor/ebox.py
homeassistant/components/sensor/eddystone_temperature.py
homeassistant/components/sensor/eliqonline.py
Expand Down Expand Up @@ -480,6 +489,7 @@ omit =
homeassistant/components/sensor/metoffice.py
homeassistant/components/sensor/miflora.py
homeassistant/components/sensor/modem_callerid.py
homeassistant/components/sensor/mopar.py
homeassistant/components/sensor/mqtt_room.py
homeassistant/components/sensor/mvglive.py
homeassistant/components/sensor/netdata.py
Expand Down Expand Up @@ -517,6 +527,7 @@ omit =
homeassistant/components/sensor/swiss_public_transport.py
homeassistant/components/sensor/synologydsm.py
homeassistant/components/sensor/systemmonitor.py
homeassistant/components/sensor/tank_utility.py
homeassistant/components/sensor/ted5000.py
homeassistant/components/sensor/temper.py
homeassistant/components/sensor/time_date.py
Expand Down
4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ of a component, check the `Home Assistant help section <https://home-assistant.i
:target: https://coveralls.io/r/home-assistant/home-assistant?branch=master
.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
:target: https://discord.gg/c5DvZ4e
.. |Join the chat at https://gitter.im/home-assistant/home-assistant| image:: https://img.shields.io/badge/gitter-general-blue.svg
:target: https://gitter.im/home-assistant/home-assistant?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. |Join the dev chat at https://gitter.im/home-assistant/home-assistant/devs| image:: https://img.shields.io/badge/gitter-development-yellowgreen.svg
:target: https://gitter.im/home-assistant/home-assistant/devs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. |screenshot-states| image:: https://raw.github.com/home-assistant/home-assistant/master/docs/screenshots.png
:target: https://home-assistant.io/demo/
.. |screenshot-components| image:: https://raw.github.com/home-assistant/home-assistant/dev/docs/screenshot-components.png
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ def reload_core_config(hass):
hass.services.call(ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG)


@asyncio.coroutine
def async_reload_core_config(hass):
"""Reload the core config."""
yield from hass.services.async_call(ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG)


@asyncio.coroutine
def async_setup(hass, config):
"""Set up general services related to Home Assistant."""
Expand Down
87 changes: 69 additions & 18 deletions homeassistant/components/abode.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/abode/
"""
import asyncio
import logging

import voluptuous as vol
from requests.exceptions import HTTPError, ConnectTimeout
from homeassistant.helpers import discovery
from homeassistant.helpers import config_validation as cv
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD, CONF_NAME
from homeassistant.helpers.entity import Entity
from homeassistant.const import (ATTR_ATTRIBUTION,
CONF_USERNAME, CONF_PASSWORD,
CONF_NAME, EVENT_HOMEASSISTANT_STOP,
EVENT_HOMEASSISTANT_START)

REQUIREMENTS = ['abodepy==0.7.1']
REQUIREMENTS = ['abodepy==0.9.0']

_LOGGER = logging.getLogger(__name__)

CONF_ATTRIBUTION = "Data provided by goabode.com"

DOMAIN = 'abode'
DEFAULT_NAME = 'Abode'
DATA_ABODE = 'data_abode'
DEFAULT_ENTITY_NAMESPACE = 'abode'
DATA_ABODE = 'abode'

NOTIFICATION_ID = 'abode_notification'
NOTIFICATION_TITLE = 'Abode Security Setup'
Expand All @@ -34,19 +38,22 @@
}),
}, extra=vol.ALLOW_EXTRA)

ABODE_PLATFORMS = [
'alarm_control_panel', 'binary_sensor', 'lock', 'switch', 'cover'
]


def setup(hass, config):
"""Set up Abode component."""
import abodepy

conf = config[DOMAIN]
username = conf.get(CONF_USERNAME)
password = conf.get(CONF_PASSWORD)

try:
data = AbodeData(username, password)
hass.data[DATA_ABODE] = data

for component in ['binary_sensor', 'alarm_control_panel']:
discovery.load_platform(hass, component, DOMAIN, {}, config)
hass.data[DATA_ABODE] = abode = abodepy.Abode(
username, password, auto_login=True, get_devices=True)

except (ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Abode: %s", str(ex))
Expand All @@ -58,18 +65,62 @@ def setup(hass, config):
notification_id=NOTIFICATION_ID)
return False

for platform in ABODE_PLATFORMS:
discovery.load_platform(hass, platform, DOMAIN, {}, config)

def logout(event):
"""Logout of Abode."""
abode.stop_listener()
abode.logout()
_LOGGER.info("Logged out of Abode")

hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, logout)

def startup(event):
"""Listen for push events."""
abode.start_listener()

hass.bus.listen_once(EVENT_HOMEASSISTANT_START, startup)

return True


class AbodeData:
"""Shared Abode data."""
class AbodeDevice(Entity):
"""Representation of an Abode device."""

def __init__(self, username, password):
"""Initialize Abode oject."""
import abodepy
def __init__(self, controller, device):
"""Initialize a sensor for Abode device."""
self._controller = controller
self._device = device

self.abode = abodepy.Abode(username, password)
self.devices = self.abode.get_devices()
@asyncio.coroutine
def async_added_to_hass(self):
"""Subscribe Abode events."""
self.hass.async_add_job(
self._controller.register, self._device,
self._update_callback
)

@property
def should_poll(self):
"""Return the polling state."""
return False

_LOGGER.debug("Abode Security set up with %s devices",
len(self.devices))
@property
def name(self):
"""Return the name of the sensor."""
return self._device.name

@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
'device_id': self._device.device_id,
'battery_low': self._device.battery_low,
'no_response': self._device.no_response
}

def _update_callback(self, device):
"""Update the device state."""
self.schedule_update_ha_state()
50 changes: 22 additions & 28 deletions homeassistant/components/alarm_control_panel/abode.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"""
import logging

from homeassistant.components.abode import (DATA_ABODE, DEFAULT_NAME)
from homeassistant.const import (STATE_ALARM_ARMED_AWAY,
from homeassistant.components.abode import (
AbodeDevice, DATA_ABODE, DEFAULT_NAME, CONF_ATTRIBUTION)
from homeassistant.components.alarm_control_panel import (AlarmControlPanel)
from homeassistant.const import (ATTR_ATTRIBUTION, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED)
import homeassistant.components.alarm_control_panel as alarm


DEPENDENCIES = ['abode']

Expand All @@ -20,30 +22,19 @@

def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up a sensor for an Abode device."""
data = hass.data.get(DATA_ABODE)
abode = hass.data[DATA_ABODE]

add_devices([AbodeAlarm(hass, data, data.abode.get_alarm())])
add_devices([AbodeAlarm(abode, abode.get_alarm())])


class AbodeAlarm(alarm.AlarmControlPanel):
class AbodeAlarm(AbodeDevice, AlarmControlPanel):
"""An alarm_control_panel implementation for Abode."""

def __init__(self, hass, data, device):
def __init__(self, controller, device):
"""Initialize the alarm control panel."""
super(AbodeAlarm, self).__init__()
self._device = device
AbodeDevice.__init__(self, controller, device)
self._name = "{0}".format(DEFAULT_NAME)

@property
def should_poll(self):
"""Return the polling state."""
return True

@property
def name(self):
"""Return the name of the sensor."""
return self._name

@property
def icon(self):
"""Return icon."""
Expand All @@ -52,11 +43,11 @@ def icon(self):
@property
def state(self):
"""Return the state of the device."""
if self._device.mode == "standby":
if self._device.is_standby:
state = STATE_ALARM_DISARMED
elif self._device.mode == "away":
elif self._device.is_away:
state = STATE_ALARM_ARMED_AWAY
elif self._device.mode == "home":
elif self._device.is_home:
state = STATE_ALARM_ARMED_HOME
else:
state = None
Expand All @@ -65,18 +56,21 @@ def state(self):
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._device.set_standby()
self.schedule_update_ha_state()

def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._device.set_home()
self.schedule_update_ha_state()

def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._device.set_away()
self.schedule_update_ha_state()

def update(self):
"""Update the device state."""
self._device.refresh()
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
'device_id': self._device.device_id,
'battery_backup': self._device.battery,
'cellular_backup': self._device.is_cellular
}
9 changes: 5 additions & 4 deletions homeassistant/components/alarm_control_panel/egardia.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
CONF_NAME, STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY, STATE_ALARM_TRIGGERED)

REQUIREMENTS = ['pythonegardia==1.0.18']
REQUIREMENTS = ['pythonegardia==1.0.20']

_LOGGER = logging.getLogger(__name__)

Expand All @@ -29,7 +29,7 @@
DEFAULT_NAME = 'Egardia'
DEFAULT_PORT = 80
DEFAULT_REPORT_SERVER_ENABLED = False
DEFAULT_REPORT_SERVER_PORT = 85
DEFAULT_REPORT_SERVER_PORT = 52010
DOMAIN = 'egardia'

NOTIFICATION_ID = 'egardia_notification'
Expand Down Expand Up @@ -154,8 +154,9 @@ def parsestatus(self, status):

def update(self):
"""Update the alarm status."""
status = self._egardiasystem.getstate()
self.parsestatus(status)
if not self._rs_enabled:
status = self._egardiasystem.getstate()
self.parsestatus(status)

def alarm_disarm(self, code=None):
"""Send disarm command."""
Expand Down
16 changes: 15 additions & 1 deletion homeassistant/components/alarm_control_panel/manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
DEFAULT_TRIGGER_TIME = 120
DEFAULT_DISARM_AFTER_TRIGGER = False

ATTR_POST_PENDING_STATE = 'post_pending_state'

PLATFORM_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): 'manual',
vol.Optional(CONF_NAME, default=DEFAULT_ALARM_NAME): cv.string,
Expand Down Expand Up @@ -101,7 +103,9 @@ def state(self):
self._trigger_time) < dt_util.utcnow():
if self._disarm_after_trigger:
return STATE_ALARM_DISARMED
return self._pre_trigger_state
else:
self._state = self._pre_trigger_state
return self._state

return self._state

Expand Down Expand Up @@ -183,3 +187,13 @@ def _validate_code(self, code, state):
if not check:
_LOGGER.warning("Invalid code given for %s", state)
return check

@property
def device_state_attributes(self):
"""Return the state attributes."""
state_attr = {}

if self.state == STATE_ALARM_PENDING:
state_attr[ATTR_POST_PENDING_STATE] = self._state

return state_attr
Loading