Compare commits

...

2236 Commits

Author SHA1 Message Date
Paulus Schoutsen
584bfbaa76 Merge pull request #23864 from home-assistant/rc
0.93.0
2019-05-16 07:08:27 +02:00
Paulus Schoutsen
0f140751b2 Fix PS4 blocking startup (#23893) 2019-05-16 05:43:45 +02:00
Pascal Vizeli
6aa9844f8f Fix auto discovery if the monitor condition (#23880) 2019-05-15 16:28:35 +02:00
Paulus Schoutsen
177594f02c Update sensor.py 2019-05-15 14:00:42 +02:00
Pascal Vizeli
3f841a36a5 Update azure-pipelines.yml for Azure Pipelines
Automated version updates
2019-05-14 22:59:12 +02:00
damarco
80ae02cc49 Fix zha timed off (#23849) 2019-05-14 13:41:27 +02:00
Paulus Schoutsen
421b2962c6 Bumped version to 0.93.0 2019-05-14 13:18:36 +02:00
Paulus Schoutsen
bde5a9ef01 Bumped version to 0.93.0b4 2019-05-14 13:12:30 +02:00
Robbie Trencheny
b79886ad85 Fix improper usage of body attribute on web.Response. Should be text since we arent sending bytes (#23857) 2019-05-14 13:12:24 +02:00
Paulus Schoutsen
f083abbed1 Bumped version to 0.93.0b3 2019-05-14 07:19:37 +02:00
David F. Mulcahey
4dd8423b9b bump zha-quirks (#23855) 2019-05-14 07:19:31 +02:00
David F. Mulcahey
8ba2ab567e Fix ZHA battery when readings produce an unknown value (#23854)
* check for unknown readings

* only publish valid readings

* remove unused constant
2019-05-14 07:19:30 +02:00
David F. Mulcahey
3d821b9148 Correct ZHA illumination conversion (#23853)
* fix illumination values

* correct formula

* update illuminance calculation

* update test
2019-05-14 07:19:30 +02:00
Jason Hunter
04720175b9 fix onvif wsdl import - take 2 (#23807) 2019-05-14 07:19:29 +02:00
Alexei Chetroi
93ad7b2e45 Do not add coordinator to the ZHA entities. (#23803) 2019-05-14 07:19:28 +02:00
Paulus Schoutsen
9b12dd66e4 Updated frontend to 20190514.0 2019-05-14 07:08:06 +02:00
Paulus Schoutsen
6d40980de1 Bumped version to 0.93.0b2 2019-05-10 14:32:51 -07:00
Anders Melchiorsen
d4f79fc88a Synchronize Sonos service calls (#23791) 2019-05-10 14:32:43 -07:00
Paulus Schoutsen
2d724f5cc9 Updated frontend to 20190510.0 2019-05-10 14:23:09 -07:00
Pascal Vizeli
61ed604fda Bump version 0.93.0b1 2019-05-10 06:17:26 +00:00
Paulus Schoutsen
f17259c705 Updated frontend to 20190509.0 2019-05-10 06:16:54 +00:00
Jason Hunter
d5533cc10f Beta Fix: ONVIF (#23787)
* bump package to include wsdl

* update requirements all
2019-05-10 06:16:02 +00:00
dreed47
e6c5cc92d1 Fix for issue #23739. Added unique_id property so (#23769)
that entities will always get mapped to the same
property ZPID code.
2019-05-10 06:16:00 +00:00
cgtobi
0caa27094e Bump pyatmo to v1.11 (#23766) 2019-05-10 06:16:00 +00:00
Steven Looman
01578f78f1 Sort discovered entries by 'st' to ensure getting the same device each discovery (#23763) 2019-05-10 06:15:59 +00:00
Paulus Schoutsen
07b7d7b074 Bumped version to 0.93.0b0 2019-05-08 20:22:36 -07:00
Paulus Schoutsen
fb7343ecd2 Merge remote-tracking branch 'origin/master' into dev 2019-05-08 20:22:08 -07:00
Paulus Schoutsen
e51925fc58 Update translations 2019-05-08 20:20:58 -07:00
Paulus Schoutsen
d507adf13d Updated frontend to 20190508.0 2019-05-08 20:20:26 -07:00
Pascal Vizeli
c5230f7585 Update azure-pipelines.yml for Azure Pipelines 2019-05-08 23:47:01 +02:00
Paulus Schoutsen
cc13713abd No longer rely on requests (#23685)
* No longer rely on requests

* Lint

* Missed a few parts

* Fix types

* Fix more types

* Update __main__.py

* Fix tests

* Lint

* Fix script
2019-05-08 11:15:04 -07:00
Josef Schlehofer
f019e2a204 Upgrade zeroconf to 0.22.0 (#23524) 2019-05-08 08:40:00 -07:00
Jerry Chong
07126266dd Update Sesame component to use Candy House's library using the V3 API (#23621)
* Update Sesame component to use Candy House's library using the V3 API

* Updated requirements_all.txt

* Fix pylint warning

* Revert back to ATTR_DEVICE_ID
2019-05-08 08:34:00 -07:00
Martin Hjelmare
c26af22edd Refactor child validation (#23482)
* Try to make the process more readable and paritioned.
* Validate child values using set message.
* Only validate using relevant schemas.
* Extract node validation.
* Rework const types and schemas.
* Rework child validator.
* Enhance warning logging message.
2019-05-08 08:26:40 -07:00
Ville Skyttä
c384adeef4 Upgrade defusedxml to 0.6.0 (#23651) 2019-05-08 08:04:36 -07:00
Penny Wood
7f0953766b Prompt for pin only on open / unlock (#23751)
* Prompt for pin only on open / unlock

* Fixed test cases
2019-05-08 07:55:30 -07:00
Pascal Vizeli
ce1974b014 Update azure-pipelines.yml for Azure Pipelines 2019-05-08 16:02:19 +02:00
carstenschroeder
8822f0140d New cover platform for ADS integration (#23377)
* new cover platform

* improve logging II

* remove dependencies

* fix comment

* fix review findings
2019-05-08 14:08:26 +02:00
Fabian Affolter
45c041884a Upgrade Mastodon.py to 1.4.0 (#23753) 2019-05-08 11:20:22 +02:00
Fabian Affolter
1ecb3de643 Upgrade numpy to 1.16.3 (#23673) 2019-05-08 09:17:41 +02:00
cgtobi
f0f6787bf9 Merge netatmo_public sensor into the netatmo integration (#23531)
* Merge netatmo public into netatmo integration

* Remove netatmo_public platform

* Remove dev log messages

* Improve error handling

* Check config for unsupported conditions

* Fix linter

* Reduce nested blocks
2019-05-08 08:26:52 +02:00
Paulus Schoutsen
3e788aa1d6 Updated frontend to 20190507.0 2019-05-07 22:55:59 -07:00
Paulus Schoutsen
f4016b4aad Add integration step to onboarding (#23732)
* Return an extra oauth2 auth code during onboarding

* Areas in const

* Add integration step

* Lint

* Fix tests

* Fix test

* Verify integration added to done

* Verify step is marked as done
2019-05-07 22:51:24 -07:00
Paulus Schoutsen
07ee3b2eb9 Add update events to registries (#23746)
* Add update events to registries

* Add to websocket
2019-05-07 20:04:57 -07:00
Steven Looman
6e7a7ba4a0 Fix upnp logger name (#23724)
* Fix upnp logger name

* Fix more loggers
2019-05-07 15:52:48 -07:00
David Bonnes
7181d639fd Add Intergas InComfort Lan2RF gateway (#23736)
* fixed __init__.py

* add sensors

* switch to parent-child architecture

* make binary_sensor the parent

* revert parent - to water_heater

* first working version

* working, delinted (except TODO)

* update to latest client library

* remove debug code

* delint

* tweak device_state_attributes

* tweak device_state_attrbutes

* minor tweaks

* bump client library for bugfix

* improve state attributes for pumping

* update .coverage

* bugfix - binary sensors not updating

* rename to incomfort from intouch

* fix coveragerc regression

* bump client (bugfix for /protected URL)

* bump client (bugfix for /protected URL) 2

* bump client

* remove debug code

* ready for PR

* fix regression

* use xx._boiler instead of xx._objref

* improve current_temperature and delint

* use current_operation instead of state

* refactor vol.Schema

* remove unneeded instance attribute

* remove unneeded instance attribute 2

* refactor device_state_attributes

* change 'boiler' to 'heater'

* change 'boiler' to 'heater' 2

* correct a typo

* bugfix: add missing comma

* small tidy-up
2019-05-07 23:53:55 +02:00
Paulus Schoutsen
0f174250cc Update PR template (#23520)
* Update PR template

* Update config, PR template
2019-05-07 14:18:40 -07:00
Maciej Bieniek
16a27c3f2d Add abbreviation for position_topic (#23740) 2019-05-07 22:20:55 +02:00
Fabian Affolter
b253c7499d Upgrade aiodns to 2.0.0 (#23743) 2019-05-07 15:32:04 -04:00
Markus Jankowski
264e70922b Fix effects on HUE integration for Osram bulbs (#22789)
* Fix hue effect for others

* New suggestion

* switched implementation to remove colorloop for osram bulbs

* Check ATTR_EFFECT in kwargs

* Fix  tests
2019-05-07 09:53:14 -07:00
Richard Mitchell
482cb0146a Fix Hue sensor integration with multiple bridges. (#23713) 2019-05-07 09:45:04 -07:00
Andrew Sayre
02d8731a61 Add HEOS sign-in/out services (#23729)
* Add HEOS sign-in/out services

* Fix typo in comment
2019-05-07 09:39:42 -07:00
Erik Montnemery
102beaa044 Add debug prints to sun (#23598)
* Add debug prints to sun

* Review comment
2019-05-07 09:37:08 -07:00
David Bonnes
6611d585e6 Add water_heater to geniushub, bump client library (#23384)
* add water_heater

* add geniushub/water_heater.py

* de-lint

* de-lint 2

* remove temperature from device state attribs

* update to latest client library

* add me as CODEOWNER

* bump client

* bump client

* delint/refactor

* Update homeassistant/components/geniushub/water_heater.py

Co-Authored-By: zxdavb <david@bonnes.me>
2019-05-07 17:37:47 +02:00
unixko
f386088def add abbreviation for current_temperature_template (#23733) 2019-05-07 08:27:35 +02:00
rolfberkenbosch
c07c557298 Added new binary sensor meteoalarm to get weather alerts in Europe (#23663)
* Added new component meteoalarm

* Update sensor.py

* Update manifest.json

* Update manifest.json

* Update manifest.json

* Added file CODEOWNERS

* Modified some code, thanks @amelchio

* removed Throttle because is not being used anymore

* Update _attributes ad _state

* some cleanup

* Update sensor.py

Change sensor to binarysensor

* Rename sensor.py to binary_sensor.py

rename the file

* Update binary_sensor.py

Removed BinarySensorDevice from class

* Update binary_sensor.py

Made a mistake with BinarySensorDevice

* Update binary_sensor.py

clean up white spaces

* Update binary_sensor.py

Fix BinarySensorDevice

* Update binary_sensor.py

cleanup the import libs

* modified __init__

* fix

* final fix, thanks @amelchio

* forgot to change the sensor.py

* correct some typo in text

* fix typos

* fix another typo

* fix typo
2019-05-07 08:19:29 +02:00
Pawel
1f551e5f6f Add TTL support and custom headers support. (#22988)
* Add TTL custom support and custom headers support.

* fix pywebpush version

* removed whitespaces surrounding docstrings.

* fixes for tests

* priority option to data

* checking of ATTR_ENDPOINT

* change checking of target to vol.Schema

* more tests
2019-05-06 16:37:05 -07:00
Fabian Affolter
b60c815cde Share snmp constants across all platforms (#23678)
* Share constants across all platforms

* Update .coveragerc
2019-05-06 23:31:03 +02:00
Andrew Sayre
074142400a Fix SmartThings Samsung Air Conditioner Support (#23706)
* Bump pysmartthings to 0.6.8

* Fix AC climate device

* Fix stale comment
2019-05-06 10:21:16 -07:00
Daniel Høyer Iversen
d8a219fe0e Upgrade switchbot , fixes #23702 (#23716) 2019-05-06 10:18:50 -07:00
William Scanlon
a0230482bd Use the URL provided by the Wink API for subscriptions. (#23710)
* Use the URL provided by the Wink API for subscriptions.

* Changed python-wink version
2019-05-06 10:18:17 -07:00
Ville Skyttä
b9a72034f9 huawei_lte: handle icons for None sensor values gracefully (#23649) 2019-05-06 10:15:28 -07:00
Andrew Sayre
bf649e373c Update IDs after firmware upgrade in HEOS (#23641)
* Initial work

* Update tests
2019-05-06 17:53:11 +02:00
David F. Mulcahey
73aadbe8bc bump zha-quirks (#23714) 2019-05-06 08:35:11 -04:00
Fabian Affolter
e2afeca4fd Upgrade sendgrid to 6.0.5 (#23711) 2019-05-06 07:13:16 -05:00
Fredrik Erlandsson
0dfa5f9ffd Use local constant in Daikin for STATE_OFF (#23712) 2019-05-06 13:43:35 +02:00
Fabian Affolter
b331b081f0 Catch thethingsnetwork TypeError (#23667)
* Catch TypeError (fixes #23097)

* Re-add return values

* Update homeassistant/components/thethingsnetwork/sensor.py

Co-Authored-By: fabaff <mail@fabian-affolter.ch>
2019-05-06 09:47:46 +02:00
Andrew Sayre
cf03e42773 Bump pyheos to 0.5.2 (#23708) 2019-05-06 07:07:41 +02:00
droopanu
f87209605b Add a TCP timeout of 5 seconds to ffmpeg (#23617)
Add a TCP timeout of 5 seconds to ffmpeg to fix stream getting stuck when network connectivity is lost
https://github.com/home-assistant/home-assistant/issues/22741
2019-05-05 20:59:56 -04:00
ktnrg45
3e59e7f347 Add media_type_app to media_player (#23666)
* Add media_type_app

* Add MEDIA_TYPE_APP

* Bump 0.7.3

* Bump 0.7.3

* Bump 0.7.3

* typo
2019-05-05 18:53:08 -05:00
David F. Mulcahey
3dd1d3c418 Add additional single input cluster entries - ZHA (#23697)
* more profiles

* remove from binary sensor profile

* remove sensor profile mapping
2019-05-05 19:10:19 -04:00
Alexei Chetroi
8328ea6bd7 Bump ZHA modules versions. (#23705)
* Bump ZHA modules versions.

Bump bellows-homeassistant version.
Bump zigpy-homeassistant version.
Bump zigpy-xbee-homeassistant version.

* Update requirements_*.txt
2019-05-05 17:15:34 -04:00
Fredrik Erlandsson
9c1bbd1d9d Add support for SET_AWAY_MODE and TURN_ON/OFF on Daikin Climate (#23585)
* add support for on/off on daikin climate

* add support for away mode on daikin climate
2019-05-05 15:17:01 -05:00
Martin Hjelmare
8500244f8c Move owntracks device tracker test under owntracks (#23701) 2019-05-05 21:39:51 +02:00
Anders Melchiorsen
2efc1de349 Move Sonos services to sonos domain (#23670) 2019-05-05 14:25:57 -05:00
Martin Hjelmare
4796d674e6 Clean up device tracker tests (#23695)
* Clean up device tracker tests

* Fix async load config in device tracker tests.
* Clean up lint in device tracker tests.
* Sort device tracker tests imports.
* Patch config saving in device tracker tests.
* Rename fixture.
* Rename some tests that had long cryptic names.

* Replace calls  to device_tracker.async_setup
2019-05-05 14:14:46 -05:00
Martin Hjelmare
4fe0cd76f8 Clean up mqtt device tracker tests (#23700)
* Move mqtt device tracker test under mqtt dir

* Patch config file load and save

* Clean up

* Sort imports

* Put expected value last in assertions
2019-05-05 11:50:38 -07:00
Julius Mittenzwei
c0f9ccfdbb Update requirements for pyvlx. (#23694) 2019-05-05 19:19:35 +02:00
Martin Hjelmare
b9fda078a4 Clean and fix google calendar tests (#23608)
* Clean and fix google calendar tests

* Extract test calendar constant for google test
* Rewrite google calendar tests
* Clean and fix google calendar tests
* Clean and fix google component tests
* Add google conftest
* Skip flaky google calendar test

* Fix google calendar bug

* Fix yield fixture

* Set fixture names to avoid lint warning

* Fix yield fixture
2019-05-05 18:38:55 +02:00
Austin Drummond
e24d56aa5b Add HomeKit Television functionality (#22968) 2019-05-05 17:51:47 +02:00
UgaitzEtxebarria
8da600adff Add Bizkaibus, Biscays (Spain) bus service component (#22934)
* Updated to the current version of dev

* Added the component to .coveragerc

* Added __init__.py and manifest.json

* Changed the manifest to comply the json format

* Changes in for complete the PEP8 Code

* Fixed the api call to use PyPI package

* Fixed API correrct call

* Fixes for complete the requirements

* Added dependencies in manifest.json

* Changed the __init__.py to complete PEP8

* Simplified the __init__.py

* Runned codeowner script

* executed gen_requirements_all.py

* Direct call for dicts and unit changed to minutes

* Fixed the optional dict call, sorry, my bad, I did not that

* Deleted unused vars

* Changed optional parameter to required

* Remove blank first line
2019-05-05 11:00:15 +02:00
Fabian Affolter
9712bbc91c Upgrade spotcrime to 1.0.4 (fixes #13189) (#23679) 2019-05-05 07:29:04 +02:00
Fabian Affolter
fca0891320 Upgrade pysnmp to 4.4.9 (#23677) 2019-05-05 07:26:13 +02:00
Aaron Bach
1d2c5cb53c Remove extraneous update call in SimpliSafe (#23680) 2019-05-04 17:32:33 -06:00
Fabian Affolter
c309bd9ff0 Upgrade sqlalchemy to 1.3.3 (#23674) 2019-05-05 01:06:47 +02:00
Fabian Affolter
2f416b15c5 Upgrade tapsaff to 0.2.1 (#23676) 2019-05-05 00:07:55 +02:00
Fabian Affolter
85cd4ad022 Upgrade slacker to 0.13.0 (#23672) 2019-05-05 00:06:39 +02:00
Fabian Affolter
c8690865ec Upgrade shodan to 1.13.0 (#23675) 2019-05-05 00:05:01 +02:00
Fabian Affolter
8d8d2b6de9 Upgrade psutil to 5.6.2 (#23671) 2019-05-05 00:04:04 +02:00
SNoof85
97b5a38cb1 Bump pyteleloisirs version (#23661)
* Bump pyteleloisirs version

* requirements update
2019-05-04 12:53:06 +02:00
Geert van Horrik
8fc30569a9 Fix bad request for some IP ONVIF camera (#22972)
* Onvif camera improvements using zeep

* Fix static code checks

* Make obtain_input_uri async

* Convert several methods to async

* Fix static checks

* Fix static checks

* Fix requirements_all.txt

* Lint improvements

* Async services

* Use onvif-zeep-async and check if PTZ service is available before creating it

* Remove some hacks that are now defined in onvif-zeep-async

* Don't log input, it might contain sensitive information

* Static code analysis fixes

* Run requirements stuff

* Fix

* Remove suds requirement

* Onvif camera improvements using zeep

* Fix static code checks

* Make obtain_input_uri async

* Convert several methods to async

* Fix static checks

* Fix static checks

* Fix requirements_all.txt

* Lint improvements

* Async services

* Use onvif-zeep-async and check if PTZ service is available before creating it

* Remove some hacks that are now defined in onvif-zeep-async

* Don't log input, it might contain sensitive information

* Static code analysis fixes

* Run requirements stuff

* Fix

* Remove suds requirement

* Use dt_util.utcnow

* Platform setup should not have a return value

* Remove explicit dependency to zeep[async]

* Bump onvif-zeep-async to 0.1.2

* Update requirements_all.txt

* Add exception handling

* Fix static checks

* Don't catch generic exceptions

* Update camera.py
2019-05-03 10:01:12 -07:00
ThaStealth
0702407fac Added option to select photoblack cartridge (#23433)
* Added option to select photoblack cartridge

* Update sensor.py

* Name change
2019-05-03 18:57:41 +02:00
Robert Svensson
6e34015420 deCONZ - Retry on BridgeBusy errors (#23436) 2019-05-03 17:55:42 +02:00
Philippe Delodder
df9a9a1fec Add "soc-thermal 1" as CPU Temp label to Glances (#23635) 2019-05-03 15:43:51 +02:00
Daniel Høyer Iversen
9761c504eb update switchbot library (#23643) 2019-05-03 08:46:19 -04:00
Andrew Sayre
b30afde8ab Extend play_media support (#23580) 2019-05-02 19:54:36 -05:00
David Bonnes
6130831a43 Refactor evohome to prepare for water_heater (#23489)
* refactor - add const.py, change order of propertys, methods

* import client at top of file

* remove debug line

* de-lint

* delint

* add me as CODEOWNER

* remove lint hint

* delint
2019-05-03 01:43:19 +02:00
Penny Wood
3338f5c9b4 Further patch to fix of #22890 (#23627) 2019-05-02 14:05:16 -07:00
Paulus Schoutsen
592e99947d Convert frontend to do client-side modern JS detection (#23618)
* Convert frontend to do client-side async pick

* Further cleanup

* Updated frontend to 20190502.0

* Fix template caching

* Remove es5 test

* Lint

* Update description
2019-05-02 13:59:24 -07:00
Max
7331eb1f71 Allow removing Telegram reply keyboard (#23467)
*  Allow removing telegram reply keyboard by setting `keyboard` to an empty list

* Telegram keyboard: [] clearing in services.yaml
2019-05-02 15:14:40 -04:00
Ville Skyttä
f434e24252 Upgrade mypy (#23586)
* Upgrade mypy to 0.701

* Enable strict equality checks

* Strict equality error fixes

* StateMachine.is_state docstring fix
2019-05-02 21:18:20 +03:00
Ville Skyttä
b79d71065c Upgrade pytest to 4.4.1 (#23584) 2019-05-02 21:17:36 +03:00
Ville Skyttä
0a75a2c080 Clean up redundant same-package ..package imports (#23587) 2019-05-02 20:11:37 +03:00
Pascal Vizeli
41357965de Update azure-pipelines.yml for Azure Pipelines 2019-05-02 19:00:39 +02:00
Jc2k
1e6babe796 Loosen discovery config validation to avoid breaking changes (#23625)
* Allow optional service handlers to be promoted to config flow without a breaking change

* Updated wording

* Remove period
2019-05-02 16:57:42 +02:00
Daniel Høyer Iversen
04b680d9d0 Updgrade Tibber library (#23630)
* update tibber library

* update tibber library
2019-05-02 16:03:51 +02:00
Fabian Affolter
5267635d2c Polling is default (#23622) 2019-05-02 16:00:32 +02:00
Fabian Affolter
a6b898d702 Order imports (#23623) 2019-05-02 08:36:41 -04:00
Fabian Affolter
5c413eb497 Update docstrings (#23624) 2019-05-02 08:35:22 -04:00
Magnus Brange
21575938ef Prevent turning on tellduslive lights with 0 brightness (#23135)
* Prevent turning on tellduslive lights with 0 brightness

It was possible for the light compontent to get in a state where the last_brightness was set to zero, and when turning on (by calling turn_on) it would call the TellStick with 0 dim level, ergo not turning on the light.

With this, it will fall back on a 75% dim level if the level is set to zero.

* Wrap long log line over two lines

And using a more proper way of formatting the message

* Fallback to 100% instead of 75%
2019-05-02 12:53:32 +02:00
Pascal Vizeli
a7ef1eabb0 Update azure-pipelines.yml for Azure Pipelines 2019-05-02 10:29:16 +02:00
Pascal Vizeli
6124a6f7e5 Update azure-pipelines.yml for Azure Pipelines 2019-05-02 10:04:44 +02:00
Pascal Vizeli
d4ae73ce38 Merge pull request #23620 from home-assistant/rc
0.92.2
2019-05-02 09:49:23 +02:00
Brett T. Warden
2fbf29cda6 Update pyvesync_v2 version to 0.9.7 (#23603) 2019-05-02 09:48:22 +02:00
Erik Montnemery
3c5abcc71a Improve sun automation tests (#23588)
* Improve sun automation tests

* Lint

* Restore timezone after test
2019-05-02 09:46:32 +02:00
Martin Hjelmare
447440adc3 Clean caldav calendar tests (#23609) 2019-05-02 09:46:12 +02:00
Aaron Bach
daa1d103d4 Add support for flow sensor metrics in RainMachine (#23221)
* Initial commit

* In the clear
2019-05-02 09:45:51 +02:00
Paulus Schoutsen
58cde6b497 Bumped version to 0.92.2 2019-05-01 22:43:25 -07:00
Andrew Sayre
741d0fd09b Bump pyheos (#23616) 2019-05-01 22:43:17 -07:00
Robbie Trencheny
bc9548fdaf Fix unexpected error thrown if instance_domain is not set (#23615) 2019-05-01 22:43:17 -07:00
ehendrix23
35e9505ad5 Fix authentication issue (#23600)
Update to pymy1 version 1.2.1 to fix authentication issue
2019-05-01 22:43:16 -07:00
Klaas Schoute
38aa7d2c95 Fix problem with using Traccar event (#23543) 2019-05-01 22:43:15 -07:00
Pascal Vizeli
55a7ea6cc5 Fix media_player alexa power control bug (#23537) 2019-05-01 22:43:14 -07:00
Paulus Schoutsen
04bca7be6b Only include agent user ID in SYNC responses (#23497) 2019-05-01 22:43:14 -07:00
Paulus Schoutsen
8180797d2f Fix Hue sensors returning None value (#23478) 2019-05-01 22:43:13 -07:00
Erik Montnemery
0fe573ecc0 Fix cleanup of dynamic group (#23475) 2019-05-01 22:43:12 -07:00
Erik Montnemery
185595c113 Bump pychromecast (#23463) 2019-05-01 22:43:12 -07:00
cgtobi
ffdf48b15a Fix netatmo_public sensor to use netatmo authentication (#23455) 2019-05-01 22:43:11 -07:00
David Bonnes
fa4264be3f update geniushub client library to fix issue #23444 (#23450) 2019-05-01 22:43:10 -07:00
Steven Looman
c7a34d0222 Don't create connections between sensors. Fixes #22787 (#23202) 2019-05-01 22:43:09 -07:00
Robbie Trencheny
e054d68565 Further improve IndieAuth redirect_uri lookup failure logs (#23183) 2019-05-01 22:43:08 -07:00
Andrew Sayre
f3925b7ede Bump pyheos (#23616) 2019-05-01 22:39:59 -07:00
Robbie Trencheny
d1e44e35df Fix unexpected error thrown if instance_domain is not set (#23615) 2019-05-01 22:35:12 -07:00
Jc2k
0fe21f2015 Support STATE_AUTO in homekit_controller climate (#23583) 2019-05-01 22:44:54 -05:00
Aaron Bach
75abfd49ef Fixed unhandled exception in OpenUV data update (#23611) 2019-05-01 21:15:10 -06:00
4lloyd
f0c582ebbd Added message to data_template at notify REST (#23108)
* Added message to data_template at notify rest

* Added missing newlines
2019-05-01 17:04:05 -06:00
Jc2k
7ff77936ad Add and improve Homekit controller pairing messages and errors (#23532)
* Be clear about pairing code format

* Handle more homekit errors while pairing

* Update en translation

* Fix log message feedback
2019-05-01 17:02:29 -06:00
teliov
44d0d0624b updated manifest.json with correct version of hangup (#23596) 2019-05-01 17:02:03 -06:00
Paul Madden
a8c7804db2 Update bomradarloop to v0.1.3 (#23599) 2019-05-01 17:00:40 -06:00
Cyro
beb678e259 Move I/O to executor thread pool (#23589)
* Move I/O to executor thread pool

* Check if image is in whitelist_external_dir

* Move import to top of file

* Fix bad indentation
2019-05-01 17:00:17 -06:00
ehendrix23
d9d5c91adc Fix authentication issue (#23600)
Update to pymy1 version 1.2.1 to fix authentication issue
2019-05-01 16:05:35 -06:00
Daniel Høyer Iversen
19aee50bbc Ambiclimate (#22827)
* Ambiclimate

* Ambiclimate

* style

* Add config flow to ambicliamte

* Add config flow to ambicliamte

* update requirements_all.txt

* ambiclimate

* tests

* typo

* ambiclimate

* coverage

* add manifest.json

* services

* codeowner

* req

* ambicliamte

* style

* ambicliamte

* add to requirements all tests

* add to requirements all tests

* .coveragerc

* Add tests

* add doc

* style

* fix test

* update tests

* update tests

* update tests

* update tests

* update tests

* tests

* tests

* fix comment
2019-05-01 22:05:40 +02:00
Pascal Vizeli
bb6300efe3 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 21:49:08 +02:00
Markus Jankowski
dd53434742 Redesign AlarmControlPanel for Homematic IP (#23565)
* redesign AlarmControlPanel

* Fix lint

* Fixes after review
2019-05-01 21:35:57 +02:00
cdce8p
db2904624a Fix low_battery_threshold issue HomeKit (#23593) 2019-05-01 16:48:56 +02:00
Pascal Vizeli
d3cbd5b5e4 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 16:46:15 +02:00
Ville Skyttä
f9205d0ccc Simplify Travis cache config (#23592) 2019-05-01 16:08:57 +02:00
Pascal Vizeli
127cc5f942 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 14:49:12 +02:00
Pascal Vizeli
ab60235811 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 14:47:38 +02:00
Pascal Vizeli
7faa061b29 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 14:42:52 +02:00
Pascal Vizeli
c7d49a0c6a Update azure-pipelines.yml for Azure Pipelines 2019-05-01 14:38:51 +02:00
Pascal Vizeli
ac731a817a Update azure-pipelines.yml for Azure Pipelines 2019-05-01 14:28:35 +02:00
Pascal Vizeli
f0a34ddf46 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 14:23:54 +02:00
Pascal Vizeli
918ce74b26 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 14:14:26 +02:00
Pascal Vizeli
e8f496c016 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 14:09:34 +02:00
Pascal Vizeli
9b57075c3b Update azure-pipelines.yml for Azure Pipelines 2019-05-01 13:58:43 +02:00
William Scanlon
09cd302b46 Bumpped the pyeconet version (#23578) 2019-05-01 12:28:37 +02:00
Pascal Vizeli
bf25b74bf1 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 11:04:11 +02:00
Pascal Vizeli
3269da16f6 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 11:01:51 +02:00
Pascal Vizeli
0a428868fe Update azure-pipelines.yml for Azure Pipelines 2019-05-01 10:14:51 +02:00
Pascal Vizeli
8cfc316e06 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 10:06:08 +02:00
Pascal Vizeli
31e3c563b5 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 09:57:21 +02:00
Pascal Vizeli
f28ca34307 Update azure-pipelines.yml for Azure Pipelines 2019-05-01 09:56:09 +02:00
Pascal Vizeli
09296b4fd4 Set up CI with Azure Pipelines
[skip ci]
2019-05-01 09:54:48 +02:00
Fabian Affolter
0b9302ac3d Upgrade youtube_dl to 2019.04.30 (#23579) 2019-05-01 08:31:24 +02:00
Penny Wood
5b9d01139d render_with_collect method for template (#23283)
* Make entity_filter be a modifiable builder

* Add render_with_collect method

* Use sync render_with_collect and non-class based test case

* Refactor: Template renders to RenderInfo

* Freeze with exception too

* Finish merging test changes

* Removed unused sync interface

* Final bits of the diff
2019-05-01 10:54:25 +08:00
etheralm
581b16e9fa Fix failing state update tests (#23575) 2019-04-30 16:47:40 -07:00
Jc2k
1c4367e5a9 Fix min/max temp and humidity for homekit_controller climate (#23421)
* Fix min/max temp and humidity for homekit_controller climate.

* Fix typo
2019-05-01 00:08:30 +02:00
Penny Wood
b0843f4a38 Ptvsd debugger component. (#23336)
* ptvsd debugger component.

* Add test case

* ptvsd as test dependency

* Fix for 3.5

* Fixed bootstrap test

* Use dict direct lookup.

* Don't need to load dependencies.

* Get the test working.

* 3.5 fix

* Set mock return value

* Put tests back, but skip them

* Change log level
2019-05-01 00:07:34 +02:00
Jonas Pedersen
24060e0fb5 Add bypass and automatic bypass switch for Danfor Air. (#23572)
Add bypass and automatic bypass switch for Danfoss Air
2019-04-30 23:07:49 +02:00
Martin Hjelmare
5ded0dd3fa Update mysensors sensor icons (#23491)
* Add some icons.
* Sort sensor types according to mysensors serial api numbering.
2019-04-30 23:06:44 +02:00
Mike Miller
09012e7baa Always pad mac addresses from nmap tracker with leading zeros (#23492) 2019-04-30 22:43:21 +02:00
Cyro
75a2c057f2 Upgrade discord.py to v1.0.1 (#23523) 2019-04-30 22:12:39 +02:00
Sylvia van Os
603e2cd961 Essent sensor (#23513)
* Initial commit for Essent

* Cleanup Essent component

* Update CODEOWNERS

* Move stuff to PyEssent

* Update requirements_all

* Fix PyEssent

* Move meter list to PyEssent library

* Update requirements_all

* Only check for updates once an hour

* Use PyEssent 0.10

* Fixing up Essent component

* Fix crash

* Don't add unused meter/tariff combos

* Fix lint

* Get tariffs per meter

* Don't hammer Essent API

* Fix linting errors

* Fix old description

* Fix old call

* Cleanup Essent component
2019-04-30 21:02:16 +02:00
Andrew Sayre
cfaaae661a Add core APIs to migrate device identifiers and entity unique_id (#23481)
* Add device identifiers migration

* Add entity unique_id migration

* Update per arch issue

* Move to existing update methods
2019-04-30 10:04:37 -07:00
David F. Mulcahey
41f0066e76 bump zha-quirks version (#23568) 2019-04-30 12:57:06 -04:00
Erik Montnemery
407e0c58f9 Migrate tests to pytest (#23544)
* Migrate tests to pytest

* Fixup

* Use loop fixture in test_check_config

* Lint
2019-04-30 09:20:38 -07:00
David F. Mulcahey
d71424f285 Clean up ZHA discovery logic (#23563)
* use domain constants from HA

* cleanup endpoint processing in discovery

* Whitespace.
2019-04-30 10:40:52 -04:00
Anders Melchiorsen
6a6a999833 Upgrade pysonos to 0.0.12 (#23560) 2019-04-30 08:45:56 -04:00
Jc2k
7612703092 Bump homekit_python to 0.14.0 (#23562) 2019-04-30 08:44:48 -04:00
Klaas Schoute
5d5f073cff Fix problem with using Traccar event (#23543) 2019-04-30 08:02:45 +02:00
etheralm
1d70005b01 Add sensor support for dyson 2018 models (#22578)
fix check for already created entities

remove hepa and carbon filter

add AQI attribute

initial commit

fix check for already created entities

remove hepa and carbon filter

add AQI attribute

add air quality component tests

fix method call tests

fix line lengths

fix pylint issues

fix docstrings

revert fan related changes

remove whitespace change

fix fan update state test

add for loop for platform initialization

add requested changes to aiq platform

change string concatenation to new style string formatting

update air quality tests

update air quality tests

refactor sensor component changes

fix pylint issues

fix debug string in the air quality component

replace failing tests for older devices

fix line length fan tests

remove dependencies const and move imports

move back imports to methods

remove whitespace from blank line
2019-04-30 02:24:05 +02:00
Austin Drummond
b4e2a0ef84 Add HomeKit low battery threshold config (#23363) 2019-04-30 02:02:53 +02:00
David F. Mulcahey
2aee31ec6a Don't use zigpy profiles for ZHA entities (#22844)
* don't use zigpy profiles
* use sets as they're the correct structure to use
2019-04-29 19:31:27 -04:00
Erik Montnemery
8d775caaac Always print invalid configuration data (#21972)
* Always print invalide configuration data

* Print offending data as yaml

* Revert "Print offending data as yaml"

This reverts commit 01721a21a9ff918ed2c8595151ebfe55eb2f7d36.

* Do not print sensitive data

* Print MQTT topic

* Add line break

* Review comments

* review comments
2019-04-29 13:45:53 -07:00
Pascal Vizeli
4c4f0e38d4 Fix media_player alexa power control bug (#23537) 2019-04-29 22:40:55 +02:00
Paulus Schoutsen
5e3e730496 Install requirements when checking config (#23500)
* Install requirements when checking config

* PyLint
2019-04-29 09:54:42 -07:00
Erik Montnemery
84f778d23c Improve logging of exceptions in async_create_task (#22689)
* Improve logging of exceptions in async_create_task

* Move wrapping+logging to util.logging

* Minor refactor, fix typing

* Add test

* Remove useless @wraps, fix confusing parameter name

* Review comment
2019-04-29 09:53:22 -07:00
David F. Mulcahey
75f53b2799 Allow direct binding via ZHA for the ZLL profile (#23536)
* allow binding for zll profile
* update check - review comment
2019-04-29 11:35:18 -04:00
Aaron Bach
e08f2ad18d Add current disease data to IQVIA (#23052)
* Add current and historical disease data to IQVIA

* Added fetcher

* Added disease sensor mapping

* Changed incorrect key

* Removed other extraneous const usage
2019-04-29 09:06:23 -06:00
David F. Mulcahey
5aa9a1a7c2 limit concurrent updates to avoid network flood (#23534) 2019-04-29 09:39:37 -04:00
Penny Wood
5e045f3df2 Allow device_class for template covers
* #23486. Allows device_class to be set for template covers
2019-04-29 20:38:59 +08:00
Anders Melchiorsen
471a26bde1 Do not log tracebacks for influxdb write errors (#23522)
* Do not log influxdb write exceptions

* Log exception name
2019-04-29 06:39:45 -05:00
Anders Melchiorsen
2245ee98e3 Ignore stale directories (#23464)
* Ignore stale directories

* Remove redundant tests

* Revert "Remove redundant tests"

* Print warning when skipping directories

* Suggest to remove stale directory
2019-04-29 10:53:27 +02:00
Anders Melchiorsen
0ecf152153 Continuous discovery of Sonos speakers (#23484) 2019-04-29 10:20:09 +02:00
mcc05
5529bcc114 Fixed AlexaPowerController to report power state for thermostats (#23468)
Fixed AlexaPowerController to report power state for thermostats, to look if state is OFF return OFF, otherwise report ON as thermostats have multiple values for ON
2019-04-28 21:29:12 -04:00
Joakim Plate
b4a7980084 Update Philips js to v0.0.8 (#23462)
* Don't send volume on volume set

This needs updated lib

* Bump version and avoid getting channels explicitly

* Add myself as codeowner

* Use version 0.0.8 instead which doesn't reuse session

Some TV's doesn't play nice with HTTP/1.1 connection
re-use.

* Add new requirement to requirements_all.txt
2019-04-28 21:27:35 -04:00
Paulus Schoutsen
0f49a9cb7b Return state when changing optimistic covers (#23498) 2019-04-28 12:09:20 -07:00
Erik Montnemery
2f45a7e3b9 Fix cleanup of dynamic group (#23475) 2019-04-28 12:09:06 -07:00
Wojciech Mamak
b60c7ce479 Fixed bug with max_result (#23507)
The config option 'max_result' was assigned to not existing 'max_result' variable, it should be assigned to 'maxResult'.
The current version causes an error when max_result option is used.
2019-04-28 21:01:33 +02:00
Anders Melchiorsen
41d9bd42af Catch RequestException in influxdb writer (#23508) 2019-04-28 20:57:58 +02:00
Alok Saboo
2fecc7d5a4 Update aiolifx_effects to 0.2.2 (#23473) 2019-04-28 20:46:49 +02:00
Robin
687bbce900 Fixes local_file camera service (#23479)
* Fixes service

Fixes service so only the target camera is updated

* Update test_camera.py

* fix lint
2019-04-28 19:32:02 +01:00
chmielowiec
54c34bb224 Display person component as occupancy sensor HomeKit (#23451) 2019-04-28 18:38:21 +02:00
Anders Melchiorsen
37badbbf09 Skip flaky stream tests (#23493)
* Skip flaky test_hls tests

* Skip flaky test_recorder tests
2019-04-28 13:58:19 +02:00
Paulus Schoutsen
b09f5b6743 Only include agent user ID in SYNC responses (#23497) 2019-04-28 09:42:05 +02:00
Paulus Schoutsen
2dbe6d3289 Updated frontend to 20190427.0 2019-04-27 22:18:18 -07:00
Paulus Schoutsen
300d1f44a6 Updated frontend to 20190427.0 2019-04-27 22:18:05 -07:00
David Bonnes
7458f1f6ef Add a warning that honeywell/EU is to be deprecated (#23469)
* Add a warning that honeywell/EU is to be deprecated

* improve warning
2019-04-27 22:27:41 +02:00
Paulus Schoutsen
26bf1b2173 Fix Hue sensors returning None value (#23478) 2019-04-27 13:27:17 -07:00
Andrew Sayre
f1b2622d78 Use remote image for HEOS (#23420) 2019-04-27 13:02:42 -07:00
Anders Melchiorsen
5efe089699 Improve handling of unavailable Sonos speakers (#23472) 2019-04-27 19:05:50 +02:00
Erik Montnemery
b6a13262da Bump pychromecast (#23463) 2019-04-27 09:17:50 -07:00
Anders Melchiorsen
148860587c No longer promote imports inside methods (#23471) 2019-04-27 09:16:44 -07:00
anrudolph
6be798bffc Added option to use self-signed certificates (#23139)
* Added option to use self-signed certificates

I defined a new option for configuration.yaml, 'verify_ssl', which is set to 'True' by default for obvious security reasons. However, in order to work with self-signed certificates, it is now possible to disable the certificate validation.(eg, I use a nextcloud instance with self-signed certificates)
Credit for code in line 57 goes to user 'gen2' on the homeassistant community, who suggested this solution. 
https://community.home-assistant.io/t/caldav-configuration/38198/25
I only took it a step further and made it a config option.

* Update calendar.py

* Added the import of CONF_VERIFY_SSL

I hope this passes the test now...

* Update homeassistant/components/caldav/calendar.py

Cool! Didn't know about that possibility, my coding experience is literally two weeks. Thanks for sharing!

Co-Authored-By: anrudolph <49680492+anrudolph@users.noreply.github.com>

* Removed some lines of code

I think, in order for the last commit to work, these lines have to be removed. Correct?

* Trying to get this passing the checks

Trying around to get the simplified code to work
2019-04-27 10:40:20 -05:00
Phil Bruckner
1dbfa8f3be Bump amcrest to 1.4.0 and use new storage_all method (#23446)
Improve sdcard sensor so it only sends one command to camera per update as opposed to the four it used to send to reduce network traffic and make data consistent. Also better handle returned values of 'unknown'.
2019-04-27 10:24:07 -05:00
cgtobi
96fb311f6b Fix netatmo_public sensor to use netatmo authentication (#23455) 2019-04-27 10:18:55 -05:00
Aaron Bach
bdc95e76d0 Fix broken forecast trend attribute in IQVIA (#23454) 2019-04-27 10:17:57 -05:00
Anders Melchiorsen
c174b83f54 Return of travis (#23409)
* Return .travis.yml

This reverts commit a5b03541e9.

* Remove coveralls

* Remove deploy

* Support only the extreme Python versions

* Ignore bleeding edge

* Remove docker service
2019-04-27 12:30:24 +02:00
Aaron Bach
bf050adcf3 Remove historical allergen and asthma sensors from IQVIA (#23258)
* Remove historical sensors from IQVIA

* Removed old imports

* Removed "Yesterday" sensors
2019-04-26 23:28:55 -06:00
Ian
c2e7445271 Add new nextbus sensor (#20197)
* Added new nextbus sensor

* Fix order in requirements_all after merge

* Add more flexible parsing of JSON lists

* Undo tox change
2019-04-26 19:51:58 -05:00
David Bonnes
f25183ba30 update geniushub client library to fix issue #23444 (#23450) 2019-04-26 18:18:30 -04:00
Pascal Vizeli
ee107755f8 Merge pull request #23448 from home-assistant/rc
0.92.1
2019-04-26 22:41:20 +02:00
Pascal Vizeli
081a0290ba Bump version 0.91.1 2019-04-26 20:00:33 +00:00
Fredrik Erlandsson
95ed8fb245 Fix point setup (#23441)
Fix point setup
2019-04-26 19:58:46 +00:00
Fredrik Erlandsson
0d4858e296 Fix daikin setup (#23440)
Fix daikin setup
2019-04-26 19:58:46 +00:00
Toon Willems
f6a6be9a22 Fix Flux component (#23431)
* Fix Flux component

* Update manifest.json

* Update manifest.json
2019-04-26 19:58:45 +00:00
cgtobi
065b077369 Refactor netatmo to use hass.data (#23429)
* Refactor NETATMO_AUTH to use hass.data

* Minor cleanup

* Rename conf to auth and other suggestions by Martin

* Revert webhook name change

* Rename constant

* Move auth

* Don't use hass.data.get()

* Fix auth string
2019-04-26 19:58:44 +00:00
Andrew Sayre
1ec08ce243 Fix supported features gates in media_player volume up/down services (#23419)
* Correct media player feature gates

* Fix failing test

* Lint...
2019-04-26 19:58:44 +00:00
Andrew Sayre
46c955a501 Add missing feature support flag (#23417) 2019-04-26 19:58:43 +00:00
Paulus Schoutsen
c1429f5d80 Make setup more robust (#23414)
* Make setup more robust

* Fix typing
2019-04-26 19:58:42 +00:00
Joakim Plate
ed16681b8e Broadlink fixup unintended breakage from service refactor (#23408)
* Allow host/ipv6 address for broadlink service

This matches switch config and is a regression fix

* Restore padding of packets for broadlink

* Drop unused import

* Fix comment on test
2019-04-26 19:58:42 +00:00
Jason Hu
1ab03d9e15 Add error handling for migration failure (#23383) 2019-04-26 19:55:26 +00:00
Chuang Zheng
ffcaeb4ef1 async_setup_component stage_1_domains (#23375) 2019-04-26 19:55:25 +00:00
Andrew Sayre
dd1e352d1d Bump pyheos to 0.4.1 (#23360)
* Bump pyheos==0.4.1

* Refresh player after reconnection
2019-04-26 19:55:24 +00:00
Greg Laabs
3bfb5b119a Bump ecovacs lib 2 (#23354)
* Bump Ecovacs dependency (sucks)

Update to new version of sucks, which switches to a custom-built SleekXMPP that turns off certificate validation. This is to fix issues caused by Ecovacs serving invalid certificates.

* Update requirements file
2019-04-26 19:55:24 +00:00
dreed47
a269603e3b fix for issue #21381 (#23306) 2019-04-26 19:55:23 +00:00
Paulus Schoutsen
d6f6273ac2 Make setup more robust (#23414)
* Make setup more robust

* Fix typing
2019-04-26 21:41:29 +02:00
Fredrik Erlandsson
61ea6256c6 Fix point setup (#23441)
Fix point setup
2019-04-26 20:56:55 +02:00
Fredrik Erlandsson
08c36e0089 Fix daikin setup (#23440)
Fix daikin setup
2019-04-26 20:24:01 +02:00
Aaron Bach
8fe95f4bab Additional cleanup of IQVIA integration (#23403)
* Additional cleanup of IQVIA integration

* Task

* Moved import

* Fixed exception

* Member comments (round 1)

* Member comments (round 2)

* Member comments
2019-04-26 11:06:46 -06:00
Toon Willems
606dbb85d2 Fix Flux component (#23431)
* Fix Flux component

* Update manifest.json

* Update manifest.json
2019-04-26 08:55:30 -07:00
cgtobi
b84ba93c42 Refactor netatmo to use hass.data (#23429)
* Refactor NETATMO_AUTH to use hass.data

* Minor cleanup

* Rename conf to auth and other suggestions by Martin

* Revert webhook name change

* Rename constant

* Move auth

* Don't use hass.data.get()

* Fix auth string
2019-04-26 17:15:37 +02:00
Anders Melchiorsen
5dbf58d67f Remove support for deprecated Sonos configuration (#23385) 2019-04-26 08:56:43 +02:00
Andrew Sayre
d038d2426b Add missing feature support flag (#23417) 2019-04-26 08:47:40 +02:00
Andrew Sayre
b5725f8f19 Fix supported features gates in media_player volume up/down services (#23419)
* Correct media player feature gates

* Fix failing test

* Lint...
2019-04-25 21:42:39 -07:00
Tom Schneider
eefb9406c2 restore battery_quantity for zha devices (#23320) 2019-04-25 22:44:38 -05:00
Robert Svensson
c229a314c6 Bump requirement to v55 (#23410) 2019-04-25 22:42:07 -05:00
Joakim Plate
7d5c1ede72 Broadlink fixup unintended breakage from service refactor (#23408)
* Allow host/ipv6 address for broadlink service

This matches switch config and is a regression fix

* Restore padding of packets for broadlink

* Drop unused import

* Fix comment on test
2019-04-25 21:33:05 -05:00
Evan Bruhn
7a6acca6bb Add device info for Logi Circle camera and sensor entities (#23373) 2019-04-25 15:21:04 -07:00
Markus Jankowski
9d67c9feb6 Add Types to Homematic IP (#23401) 2019-04-25 15:13:07 -07:00
Markus Jankowski
cef7ce11ad check if sabotage attr is in device (#23397) 2019-04-25 15:12:36 -07:00
panosmz
e182b95921 add key parameter (#23381) 2019-04-25 23:35:30 +02:00
cgtobi
d2e0c6dbc2 Bump youtube-dl version to 2019.04.24 (#23398) 2019-04-25 23:21:23 +02:00
Joakim Plate
39932d132d Add device classes for media player and map to google types (#23236)
* Add device classes for media player and map to google types

* Switch default class for media_player to media
2019-04-25 13:12:11 -07:00
Jason Hu
7e8f2d72b6 Add error handling for migration failure (#23383) 2019-04-25 12:58:10 -07:00
Daniel Høyer Iversen
4816a24b3c Update xiaomi library (#23391) 2019-04-25 14:25:32 -04:00
Chuang Zheng
3d91d76d3d async_setup_component stage_1_domains (#23375) 2019-04-25 05:50:28 -07:00
Erik Montnemery
5376e15286 Convert some test helpers to coroutines and adjust tests (#23352)
* Convert some test helpers to coroutines

* Fix tests
2019-04-25 10:14:16 +02:00
Phil Bruckner
86b017e2f0 Add amcrest camera services and deprecate switches (#22949)
* Add amcrest camera services and deprecate switches

- Implement enabling and disabling motion detection from camera platform.
- Add amcrest specific camera services for controlling audio stream, motion recording, continuous recording and camera color mode, as well as moving camera to PTZ preset and starting and stopping PTZ tour function.
- Add camera attributes to indicate the state of the various camera settings controlled by the new services.
- Deprecate switches in favor of camera services and attributes.

* Rename services and move service handling to __init__.py

Rename services from 'camera.amcrest_xxx' to 'amcrest.xxx'. This allows services to be documented in services.yaml.

Add services.yaml.

Reorganize hass.data[DATA_AMCREST] and do some general cleanup to make various platform modules more consistent.

Move service handling code to __init__.py from camera.py.

* Update per review comments, part 1

- Rebase
- Add permission checking to services
- Change cv.ensure_list_csv to cv.ensure_list
- Add comment for "pointless-statement" in setup
- Change handler_services to handled_services
- Remove check if services have alreaday been registered
- Pass ffmpeg instead of hass to AmcrestCam __init__
- Remove writing motion_detection attr from device_state_attributes
- Change service methods from callbacks to coroutines

* Update per review comments, part 2

- Use dispatcher to signal camera entities to run services.
- Reorganize a bit, including moving a few things to new modules const.py & helpers.py.

* Update per review comments, part 3

Move call data extraction from camera.py to __init__.py.
2019-04-24 22:39:49 -07:00
Richard Mitchell
c216ac7260 Fix race condition. (#21244)
If the updater is running at the same time, this can result in this dict changing size during iteration, which Python does not like.
2019-04-24 22:38:10 -07:00
Paulus Schoutsen
de6fdb09f4 Add media player external url (#23337)
* Add media player external url

* Lint

* Simplify

* Update __init__.py

* Update __init__.py

* Use 302
2019-04-24 22:37:29 -07:00
Andrew Sayre
e3e7fb5ff6 Bump pyheos to 0.4.1 (#23360)
* Bump pyheos==0.4.1

* Refresh player after reconnection
2019-04-24 21:31:31 -07:00
Ian
6fb5b8467b Fix tox.ini lint target (#23359)
tox fails due to being unable to reference the `script` module when
trying to run `script/gen_requirements_all.py`. Instead it needs to be
run as a module.
2019-04-24 21:30:46 -07:00
Steven Looman
24766df179 Upgrade to pyubee==0.6 (#23355) 2019-04-24 21:13:31 -07:00
dreed47
ec9db7f9a2 fix for issue #21381 (#23306) 2019-04-24 21:11:07 -07:00
Aaron Bach
0d796a0fb9 Convert Pollen.com sensor into IQVIA component (#22986)
* Moved pollen integration to iqvia

* Stitched in new library

* Added __init__

* Completed component v1

* Updated requirements

* Updated CODEOWNERS

* Updated .coveragerc

* Removed requirements

* Static check
2019-04-24 21:09:01 -06:00
Beat
96735e41af Add support for a wider variety of EnOcean devices (#22052)
* Implement EnOcean temperature and humidity sensors.

* Bump EnOcean version to 0.50
* Refactor components for more generic device handling
* Move radio packet data interpretation to specific devices

* Update CODEOWNERS

* Implement code review changes
2019-04-25 00:30:46 +02:00
Greg Laabs
fef1dc8c54 Bump ecovacs lib 2 (#23354)
* Bump Ecovacs dependency (sucks)

Update to new version of sucks, which switches to a custom-built SleekXMPP that turns off certificate validation. This is to fix issues caused by Ecovacs serving invalid certificates.

* Update requirements file
2019-04-24 14:47:22 -07:00
Niels Mündler
ef5ca63bf0 Fix non-syncthru supporting printers (#21482)
* Fix non syncthru-syncthru supporting printers

* Formatting

* Update requirements_all

* Update syncthru.py

* Fix component to be async (as is the used SyncThru implementation)

* Add async syntax

* Omit loop passing

* Don't await async_add_platform

* Generate new all requirements

* Explain, why exception is caught in setuExplain, why exception is caught in setupp

* Handle failing initial setup correctly

* Formatting

* Formatting

* Fix requested changes

* Update requirements and add nielstron as codeowner

* Run codeowners script

* Make notification about missing syncthru support a warning

* Revert pure formatting

* Fix logging
2019-04-24 23:39:31 +02:00
Paulus Schoutsen
8ae2ce2299 Merge pull request #23353 from home-assistant/rc
0.92.0
2019-04-24 13:37:44 -07:00
Paulus Schoutsen
700b8b2d0c Fix config test when current version is 92 (#23356) 2019-04-24 13:37:19 -07:00
Paulus Schoutsen
d218ba98e7 Fix config test when current version is 92 (#23356) 2019-04-24 13:37:08 -07:00
Paulus Schoutsen
806aba4a1a Bumped version to 0.92.0 2019-04-24 11:25:57 -07:00
Jason Hu
1128cf576f Remove ghost folder (#23350) 2019-04-24 11:25:02 -07:00
Jason Hu
febdb72fb2 Support unicode in configuration migration (#23335) 2019-04-24 11:25:00 -07:00
Paulus Schoutsen
3c0146d382 Add sensor and binary senseor to default expose (#23332) 2019-04-24 11:24:59 -07:00
Paulus Schoutsen
9e76293141 Always set latest pin (#23328) 2019-04-24 11:24:58 -07:00
dreed47
6149c2877d Zestimate - Added check for the existence of data in response (#23310) 2019-04-24 11:24:58 -07:00
Joakim Plate
2efe607b78 Expose door cover/binary_sensor as door type (#23307)
* Expose door cover/binary_sensor as door type

More logical to ask "What doors are open" than "What sensors are open"

* Add test for binary_sensor device_classes

* Cosmetic flake8

* Add test for device class for cover
2019-04-24 11:24:57 -07:00
Paulus Schoutsen
9fc271d178 Updated frontend to 20190424.0 2019-04-24 11:16:30 -07:00
Paulus Schoutsen
d53a00d054 Updated frontend to 20190424.0 2019-04-24 11:15:56 -07:00
Joakim Plate
62fcb1895e Device type garage for binary sensor garage_door (#23345)
* Switch binary sensor to garage for garage_door

* Add test for cover garage device type
2019-04-24 09:56:22 -07:00
Jason Hu
843bad83fa Remove ghost folder (#23350) 2019-04-24 09:55:48 -07:00
Penny Wood
e850ccb82c Fixed test (#23343) 2019-04-24 09:55:37 -07:00
Pascal Vizeli
f4e7364651 Netatmo 5min fetch interval (#23341) 2019-04-24 09:54:51 -07:00
Fabian Affolter
82ff5cbe0f Upgrade ruamel.yaml to 0.15.94 (#23344) 2019-04-24 09:52:29 -07:00
Joakim Plate
e11e6e1b04 Volume trait for google assistant (#23237)
* Add action.devices.traits.Volume

* Drop media player from brightness trait

* Factor out commands into separate functions

* Drop support for explicit mute
2019-04-24 09:08:41 -07:00
Markus Jankowski
2863ac1068 Fix Homematic IP Cloud remaining light imports (#23339)
* Fix missing impor reorg

* Add brackets

* Removed trailing whitespaces
2019-04-24 13:27:45 +02:00
Fabian Affolter
3d04856cbd Upgrade youtube_dl to 2019.04.17 (#23342) 2019-04-24 11:56:43 +02:00
Joakim Plate
7c55b9f087 Expose door cover/binary_sensor as door type (#23307)
* Expose door cover/binary_sensor as door type

More logical to ask "What doors are open" than "What sensors are open"

* Add test for binary_sensor device_classes

* Cosmetic flake8

* Add test for device class for cover
2019-04-23 19:25:20 -07:00
Kyle Pinette
6681605c34 Added override for kwikset 888. (#23327) 2019-04-23 22:24:43 -04:00
Daniel Høyer Iversen
95bbea20a8 Fix Switchbot restore state (#23325)
* switchbot library

* req

* req

* issue #23039
2019-04-23 19:23:52 -07:00
Andre Lengwenus
662375bdd7 Changes due to manifest.json. Awaiting coroutines instead of creating tasks (#23321) 2019-04-23 19:20:20 -07:00
Paulus Schoutsen
aa26f90420 Add sensor and binary senseor to default expose (#23332) 2019-04-23 19:19:23 -07:00
Jason Hu
c61b6cf616 Support unicode in configuration migration (#23335) 2019-04-23 17:47:09 -07:00
Markus Jankowski
16d8e92b06 Reorg Homematic IP Cloud imports and minor fixes (#23330)
* reorg HmiP Imports after introduction of manifests

* add type to some functions

* fix usage of dimLevel (HomematicipDimmer,HomematicipNotificationLight)

* align naming to HomematicipMultiSwitch: channel_index -> channel for (HomematicipNotificationLight)

* fix lint

* Fix is_on for dimmers

* fix lint
2019-04-24 01:47:31 +02:00
ktnrg45
68d3e624e6 Fix ps4 not able to use different PSN accounts (#22799)
* Remove skipping of creds step.

* Check for device added per account

* typo

* lint

* Pylint

* Fix test

* Fix test

* Typo

* Add auto location

* blank space

* Add new identifier handling + fix select source

* Add cred_timeout error

* add credential timeout error

* Fix Tests

* patch decorator

* Update test_config_flow.py

* add test

* Revert

* Rename vars

* fix tests

* Add attr location

* Bump 0.6.0

* Bump 0.6.0

* Bump 0.6.0

* Update handling exception

* Update remove method

* Update tests

* Refactoring

* Pylint

* revert

* chmod

* 0.6.1

* 0.6.1

* 0.6.1

* Remove func

* Add migration

* Version 3

* Remove redefinition

* Add format unique id

* Add format unique id

* pylint

* pylint

* 0.7.1

* 0.7.1

* 0.7.1

* Changes with media_art call

* Add library exception

* 0.7.2

* 0.7.2

* 0.7.2

* Version and entry_version update

* Revert list comprehension

* Corrected exception handling

* Update media_player.py

* Update media_player.py

* white space
2019-04-24 01:32:36 +02:00
Paulus Schoutsen
d505f1c5f2 Always set latest pin (#23328) 2019-04-23 13:13:00 -07:00
dreed47
b252d8e2cd Zestimate - Added check for the existence of data in response (#23310) 2019-04-23 11:44:13 -07:00
Josef Schlehofer
c040f7abc0 Upgrade attrs to 19.1.0 (#23323) 2019-04-23 10:14:02 -07:00
Joakim Sørensen
2871a650f6 Handle traccar connection errors (#23289)
* Handle connection errors

* Fix lint issue E127

* Remove periods from logs

* Merge connection checks

* Fail with bad credentials

* Move stuff around for async_init

* Fix E128 linting issue

* Simplify
2019-04-23 08:46:11 -04:00
Paulus Schoutsen
5b0ee473b6 Add get_states faster (#23315) 2019-04-23 12:46:22 +02:00
Paulus Schoutsen
00d26b3049 Random hassfest fixes (#23314) 2019-04-23 08:34:36 +02:00
Paulus Schoutsen
06f76e8e97 Bumped version to 0.92.0b3 2019-04-22 22:09:33 -07:00
Paulus Schoutsen
d5bd8b9405 Dont cache integrations that are not found (#23316) 2019-04-22 22:09:13 -07:00
Pascal Vizeli
34c03109e5 Fix hass.io panel_custom/frontend (#23313)
* Fix hass.io panel_custom/frontend

* Update manifest.json
2019-04-22 22:09:12 -07:00
Richard Mitchell
df3ceb8d87 Correct calculation and units of light level values. (#23309) 2019-04-22 22:09:12 -07:00
VDRainer
f514d44224 Create services.yaml for input_datetime (#23303)
* Create services.yaml for input_datetime

* HA error while parsing a flow mapping
2019-04-22 22:09:11 -07:00
Austin Mroczek
7fb0055a92 Bump skybellpy to 0.4.0 (#23294)
* Bump skybellpy to 0.4.0

* Bump skybellpy to 0.4.0 in requirements_all.txt
2019-04-22 22:09:10 -07:00
Joakim Sørensen
f81eeded90 Show correct version for stable (#23291) 2019-04-22 22:09:10 -07:00
damarco
6df31da180 Bump zigpy and zigpy-xbee (#23275) 2019-04-22 22:09:09 -07:00
damarco
364f5c8c02 Bump zigpy-deconz (#23270) 2019-04-22 22:09:08 -07:00
Otto Winter
85ac85c959 Fix ESPHome setup errors in beta (#23242)
* Fix ESPHome setup errors in beta

* Update requirements_all.txt
2019-04-22 22:09:08 -07:00
Andrew Sayre
a2565ad3b4 Update pyheos and log service errors in HEOS integration (#23222)
* Update pyheos and command error handling

* Correct comment and remove unnecessary autospec
2019-04-22 22:09:07 -07:00
Joakim Sørensen
ddb5ff3b71 Show correct version for stable (#23291) 2019-04-22 22:07:56 -07:00
Paulus Schoutsen
72bbe2203e Dont cache integrations that are not found (#23316) 2019-04-22 22:06:58 -07:00
Pascal Vizeli
2a720efbd4 Fix hass.io panel_custom/frontend (#23313)
* Fix hass.io panel_custom/frontend

* Update manifest.json
2019-04-22 21:47:12 -07:00
Jc2k
baeb3cddc6 Set placeholders in homekit config flow title (#23311) 2019-04-22 21:32:39 -07:00
VDRainer
ee88433fb1 Create services.yaml for input_datetime (#23303)
* Create services.yaml for input_datetime

* HA error while parsing a flow mapping
2019-04-22 21:29:34 -07:00
Richard Mitchell
845d81bdae Correct calculation and units of light level values. (#23309) 2019-04-22 21:28:40 -07:00
Anders Melchiorsen
d0f9595ad9 Add connection control for netgear_lte (#22946) 2019-04-22 22:44:46 +02:00
Pawel
9007e17c3e MQTT Vacuum State Device (#23171)
* add StateVacuum MQTT
2019-04-22 21:49:15 +02:00
Joakim Plate
e85af58e43 RFC: Upgrade philips_js component version and support channels and sources (#23061)
* Drop unused constant

* Don't default to localhost

A philips tv will never run on localhost

* Use library internal state

* Add play media support for channels

* Control update manually

This allow us to delay update of state when we perform
and action.

* Bump version for support for api v1 again

* Consider missing source and only channels as channels

* Fix some flake8 tasks

* Fix some pylint errors

* Adjust requirements_all file

* Switch to async_add_executor_job

* Assume device turns of off a sucessfull standby call
2019-04-22 12:26:15 -07:00
Otto Winter
0c90bfb936 Fix ESPHome setup errors in beta (#23242)
* Fix ESPHome setup errors in beta

* Update requirements_all.txt
2019-04-22 12:13:21 -07:00
Andrew Sayre
8daba68dc1 Add support to play url (#23273) 2019-04-22 12:10:55 -07:00
Austin Mroczek
e3981b6498 Bump skybellpy to 0.4.0 (#23294)
* Bump skybellpy to 0.4.0

* Bump skybellpy to 0.4.0 in requirements_all.txt
2019-04-22 12:09:55 -07:00
Jc2k
6d31d56c03 Backport missing folder fix from #23191 (#23297) 2019-04-22 12:07:03 -07:00
Erik Montnemery
a89c7f8feb Improve MQTT tests (#23296)
* Improve MQTT tests

* Tweak
2019-04-22 08:48:50 -04:00
Markus Jankowski
357631d659 Add homematicip cloud temperature sensor from thermostats (#23263) 2019-04-22 09:30:49 +02:00
Josef Schlehofer
3b0660ae89 Upgrade pyotp to 2.2.7 (#23274) 2019-04-21 09:03:17 +02:00
Josef Schlehofer
a8632480ff Upgrade xmltodict to 0.12.0 (#23277) 2019-04-21 13:52:20 +09:00
Aaron Bach
80653824d9 Add ctags file to .gitignore (#23279) 2019-04-20 21:15:19 -06:00
damarco
b3c7142030 Bump zigpy and zigpy-xbee (#23275) 2019-04-20 18:04:30 -04:00
damarco
df32830f17 Bump zigpy-deconz (#23270) 2019-04-20 10:12:28 -04:00
Andrew Sayre
b697bb7a26 Update pyheos and log service errors in HEOS integration (#23222)
* Update pyheos and command error handling

* Correct comment and remove unnecessary autospec
2019-04-19 22:22:40 -04:00
Paulus Schoutsen
ef28e2cc2a Bumped version to 0.92.0b2 2019-04-19 17:05:56 -07:00
Andrew Sayre
ff047e1cd1 Return 0 instead of None (#23261) 2019-04-19 17:05:46 -07:00
Paulus Schoutsen
8741a20191 Async fix for bluetooth stopping (#23225) 2019-04-19 17:05:45 -07:00
Paulus Schoutsen
d0c6f0b710 Ask users for a pin when interacting with locks/garage doors (#23223)
* Ask users for a pin when interacting with locks/garage doors

* Deprecate allow_unlock option
2019-04-19 17:05:44 -07:00
cgtobi
15c1213928 Add missing services.yaml file for hue (#23217)
* Add hue services.yaml

* Add lifx services.yaml

* Add lutron services.yaml

* Update lifx services.yaml

* Update hue services.yaml

* Revert lifx services.yaml as it is not necessary

* Remove hue from lights/services.yaml
2019-04-19 17:05:44 -07:00
David F. Mulcahey
f618e7253a fix bindable devices (#23216) 2019-04-19 17:05:43 -07:00
David F. Mulcahey
5df57bbda5 update zha-quirks (#23215) 2019-04-19 17:05:43 -07:00
Paulus Schoutsen
4433ad0a06 Add stub services.yaml and make validation mandatory (#23213) 2019-04-19 17:05:42 -07:00
Alok Saboo
f18a49ce97 create services.yaml for shell_command (#23210) 2019-04-19 17:05:41 -07:00
Alok Saboo
23cb053e82 Create services.yaml for Tuya (#23209) 2019-04-19 17:05:41 -07:00
Richard Mitchell
52eb9e50aa Name sensors correctly (#23208)
* Hue motion senors are motion sensors, not presence sensors.

* Name the sensors 'motion' instead of 'presence' - match the HA paradigm.
2019-04-19 17:05:40 -07:00
Erik Montnemery
35da3f053c Fix clearing error message for MQTT vacuum (#23206)
* Fix clearing error message

* Remove redundant hass.async_block_till_done
2019-04-19 17:05:39 -07:00
Paulus Schoutsen
1a4a9532dd Add services.yaml validator (#23205)
* Add services.yaml validator

* Fix path
2019-04-19 17:05:39 -07:00
Robbie Trencheny
2bb772bbdc Set encoding before connecting (#23204) 2019-04-19 17:05:38 -07:00
Alok Saboo
ad5d4bbf51 Create services.yaml for python_script and script (#23201)
* Create services.yaml for python_script

* Create services.yaml for script
2019-04-19 17:05:38 -07:00
Otto Winter
9c9b25d4b9 Create empty services.yaml for esphome (#23200) 2019-04-19 17:05:37 -07:00
Paulus Schoutsen
89037b367b Don't load component when fetching translations (#23196) 2019-04-19 17:05:37 -07:00
Richard Mitchell
a3c3c41faa Hue motion senors are motion sensors, not presence sensors. (#23193) 2019-04-19 17:05:36 -07:00
Pascal Vizeli
7eebf4631d Hass.io Add-on panel support for Ingress (#23185)
* Hass.io Add-on panel support for Ingress

* Revert part of discovery startup handling

* Add type

* Fix tests

* Add tests

* Fix lint

* Fix lint on test
2019-04-19 17:05:35 -07:00
Dries De Peuter
decaabeb4a Fix niko home control dependency installation (#23176)
* Upgrade niko-home-control library

* Fix additional feedback

* Lint
2019-04-19 17:05:35 -07:00
David Bonnes
df02879c51 Improve configuration schema for Geniushub integration (#23155)
* configuration for hub tokens are now separate from host addresses/credentials

* small change to docstring

* use *args **kwargs
2019-04-19 17:05:34 -07:00
Paulus Schoutsen
dbb49afb3e Updated frontend to 20190419.0 2019-04-19 17:05:08 -07:00
Paulus Schoutsen
a3ecde01ee Updated frontend to 20190419.0 2019-04-19 16:57:45 -07:00
Andrew Sayre
e2ed2ecdc0 Return 0 instead of None (#23261) 2019-04-19 16:56:34 -07:00
Erik Montnemery
1e0bc97f56 Drop unnecessary block_till_done (#23256) 2019-04-19 16:08:11 -07:00
Erik Montnemery
eebb452fb5 Drop unnecessary block_till_done, improve tests for MQTT Cover tests (#23255) 2019-04-19 16:07:28 -07:00
Erik Montnemery
2c42e1a5cb Drop unnecessary block_till_done for MQTT tests (#23254)
* Drop unnecessary block_till_done

* Drop unnecessary block_till_done
2019-04-19 14:59:16 -07:00
Erik Montnemery
28c411c742 Drop unnecessary block_till_done for MQTT fan tests (#23253) 2019-04-19 14:58:44 -07:00
Tomer Figenblat
9d8d8afa82 Added component named switcher_kis switcher water heater integration. (#22325)
* Added component named switcher_kis switcher water heater integration.

* Fixed conflicts.

* Updated requirements.

* Added manifest.json file and updated CODEOWNERS.

* Fixed requirements_all.txt.

* Better component tests.

* Removed unnecessary parameter from fixture function.

* Removed tests section from mypy.ini.

* Remove unused ENTITY_ID_FORMAT.

* Stop udp bridge when failed to setup the component.

* Replace DISCOVERY_ constants prefix with DATA_.

* Various change requests.

* Fixed constant name change remifications.

* Added explicit name to fixture.

* Various change requests.

* More various change requests.

* Added EventType for homeassistant.core.Event.

* Switched from event driven data distribution to dispatcher type plus clean-ups.

* Removed name and icon keys from the component configuration.

* Various change requests.

* Various change reqeusts and clean-ups.

* Removed unnecessary DEPENDENCIES constant from swith platform.

* Replaced configuration data guard with assert.

* Removed unused constants.

* Removed confusing type casting for mypy sake.

* Refactor property device_name to name.

* Removed None guard effecting mypy only.

* Removed unnecessary function from switch entity.

* Removed None guard in use by mypy only.

* Removed unused constant.

* Removed unnecessary context manager.

* Stopped messing around with mypy.ini.

* Referring to typing.TYPE_CHECKING for non-runtime imports.

* Added test requierment correctyly.

* Replaced queue.get() with queue.get_nowait() to avoid backing up intervals requests.

* Revert changes in mypy.ini.

* Changed attributes content to device properties instead of entity properties.

* Fixed typo in constant name.

* Remove unnecessary async keyword from callable.

* Waiting for tasks on event loop to end.

* Added callback decorator to callable.
2019-04-19 16:54:48 -05:00
cgtobi
31e514ec15 Add missing services.yaml file for hue (#23217)
* Add hue services.yaml

* Add lifx services.yaml

* Add lutron services.yaml

* Update lifx services.yaml

* Update hue services.yaml

* Revert lifx services.yaml as it is not necessary

* Remove hue from lights/services.yaml
2019-04-19 14:53:58 -07:00
Erik Montnemery
73a7d5e6f4 Drop unnecessary block_till_done, improve tests (#23252) 2019-04-19 14:52:23 -07:00
Erik Montnemery
f584878204 Drop unnecessary block_till_done (#23251) 2019-04-19 14:51:48 -07:00
Paulus Schoutsen
0533f56fe3 Ask users for a pin when interacting with locks/garage doors (#23223)
* Ask users for a pin when interacting with locks/garage doors

* Deprecate allow_unlock option
2019-04-19 14:50:21 -07:00
Erik Montnemery
416af5cf57 Drop unnecessary block_till_done (#23250) 2019-04-19 14:10:48 -07:00
Erik Montnemery
557211240e Drop unnecessary block_till_done, improve tests (#23249) 2019-04-19 14:08:54 -07:00
Erik Montnemery
13e0691c90 Drop unnecessary block_till_done, improve tests (#23248) 2019-04-19 14:08:02 -07:00
Erik Montnemery
0e429cca33 Drop unnecessary block_till_done, improve tests (#23247) 2019-04-19 12:26:56 -07:00
Erik Montnemery
887e1cd8e3 Drop unnecessary block_till_done, improve tests (#23246) 2019-04-19 12:19:46 -07:00
Richard Mitchell
c899e2a662 Name sensors correctly (#23208)
* Hue motion senors are motion sensors, not presence sensors.

* Name the sensors 'motion' instead of 'presence' - match the HA paradigm.
2019-04-19 11:01:54 -07:00
Jc2k
e7054e0fd2 Avoid calling async code in sync context (#23235) 2019-04-19 10:59:54 -07:00
GoNzCiD
9cf9be8850 Add accuracy and status for Traccar (#23180)
* Fix read gps position accuracy & read device status

* Fix: W291 trailing whitespace & E501 line too long (80 > 79 characters)

* Upgrade pytraccar dependency to 0.7.0

* met snake case
2019-04-19 18:42:27 +02:00
Christopher Viel
b1b269b302 Add more CPU temp. labels to Glances (#23179) 2019-04-19 15:21:16 +02:00
Maciej Bieniek
6e300bd438 Add missing service for persistent_notification (#23230) 2019-04-19 15:14:48 +02:00
Jc2k
21a194f9d8 Review feedback from #23191 (#23233) 2019-04-19 08:39:06 -04:00
Jc2k
b3a8b0056b Add and use an async_fire_service_discovered helper (#23232) 2019-04-19 08:38:50 -04:00
Pascal Roeleven
b2a7699cdf Change configuration for orangepi (#23231) 2019-04-19 13:26:53 +02:00
Pascal Vizeli
3e443d253c Hass.io Add-on panel support for Ingress (#23185)
* Hass.io Add-on panel support for Ingress

* Revert part of discovery startup handling

* Add type

* Fix tests

* Add tests

* Fix lint

* Fix lint on test
2019-04-19 09:43:47 +02:00
Aaron Bach
6a7bd19a5a Remove archived 17track packages from the entity registry (#23049)
* Remove archived 17track packages from the entity registry

* Fix incorrect __init__.py

* Member comments

* Member comments

* Fix too many params

* Member comments

* Member comments
2019-04-19 09:14:14 +02:00
Paulus Schoutsen
dbe0ba87a3 Async fix for bluetooth stopping (#23225) 2019-04-19 08:56:24 +02:00
Erik Montnemery
bea7e2a7fa Fix clearing error message for MQTT vacuum (#23206)
* Fix clearing error message

* Remove redundant hass.async_block_till_done
2019-04-18 21:01:19 -07:00
Tsvi Mostovicz
eac2388d49 Set default value for input_datetime (#21919)
* Set default value for input_datetime

If no initial value is set and no value is available to be restored, set the default value as specified in the docs to 1970-01-01 00:00.

* Use regular if statement

Ternary statements can be tricky if you try to keep the value the same if not something

* Add test for default values

Check that if no initial value is set, state returns 1970-01-01 at 00:00

* Fix tests - was passing wrong args to time/date

* Verify we get a timestamp attribute for input_datetime

This adds a check that when using the default timestamp of 1970-1-1 00:00:00, we
get a timestamp attribute. This is waht prompted this PR in the first place, as
when specifying an automation trying to access the timestamp attribute for a non-
initialized input_datetime HASS wouldn't start.

* Simplify the change for a default value

Based on @balloob comment. Simplifying the code

* Revert "Simplify the change for a default value"

This reverts commit c2d67f19a6.
2019-04-18 21:00:35 -07:00
Erik Montnemery
7a84cfb0be Fix optimistic mode + other bugs, tests (#22976) 2019-04-18 20:59:41 -07:00
Paulus Schoutsen
b0ce3dc683 Only comment with changed coverage on release PRs [skip-ci] (#23224) 2019-04-18 20:58:35 -07:00
Erik Montnemery
70ba5eb0ef Add json_attributes_template (#22981) 2019-04-18 20:55:10 -07:00
Paulus Schoutsen
1761b25879 Remove copy paste error 2019-04-18 20:31:53 -07:00
David F. Mulcahey
c2b4e24372 update zha-quirks (#23215) 2019-04-18 20:23:48 -04:00
David F. Mulcahey
5e363d124e fix bindable devices (#23216) 2019-04-18 20:21:30 -04:00
Paulus Schoutsen
a52f96b23a Add stub services.yaml and make validation mandatory (#23213) 2019-04-18 15:13:35 -07:00
Raman Gupta
620c6a22ac Update vizio component to support latest pyvizio with soundbar support (#22294)
* update vizio component to support latest pyvizio with soundbar support

* Resolved Hound issues

* Additional Hound issue

* Updated based on feedback

* Style updates

* Additional code styling changes

* Added check for auth token not being set for tv device_class

* Limited lines to 80 characters

* moved MAX_VOLUME into base package

* fixed supported commands

* styling changes

* fix styling yet again

* remove unnecessary elif

* removed play/pause since I can't get current state

* changed value access method from config dict

* fixed flake failures

* try to fix docstring

* try to fix docstring

* fixed auth token validation

* rebase and regenerate requirements_all.txt

* updated log text

* line length fix

* added config validation to handle conditionally optional parameter

* updated validate setup log message and string formatting based on review

* fix pylint error

* less ugly
2019-04-18 22:48:05 +02:00
Steven Looman
e1d1f21a74 Don't create connections between sensors. Fixes #22787 (#23202) 2019-04-18 13:47:17 -07:00
Robbie Trencheny
66b2ed930c Set encoding before connecting (#23204) 2019-04-18 13:46:49 -07:00
Paulus Schoutsen
33b8241d26 Add services.yaml validator (#23205)
* Add services.yaml validator

* Fix path
2019-04-18 13:40:46 -07:00
Otto Winter
37cd711c96 Create empty services.yaml for esphome (#23200) 2019-04-18 13:10:36 -07:00
Alok Saboo
0eb8c77889 Create services.yaml for python_script and script (#23201)
* Create services.yaml for python_script

* Create services.yaml for script
2019-04-18 13:10:25 -07:00
Alok Saboo
4be30f7c88 create services.yaml for shell_command (#23210) 2019-04-18 13:10:10 -07:00
Alok Saboo
70c5bd4316 Create services.yaml for Tuya (#23209) 2019-04-18 13:09:41 -07:00
Florian Klien
daf2f30822 set myself as codeowner of xmpp, removed me from notify/* (#23207)
* set myself as codeowner of xmpp, removed me from notify/*

* changed the manifests as well
2019-04-18 12:26:02 -07:00
Paulus Schoutsen
fda483f482 Don't load component when fetching translations (#23196) 2019-04-18 11:11:43 -07:00
Robbie Trencheny
c2cce13e2a Migrating codeowners-mention to Heroku 2019-04-18 11:11:26 -07:00
David F. Mulcahey
38d23ba0af Misc. ZHA changes (#23190)
* handle the off part of on with timed off command

* use correct var

* only bind / configure cluster once

* clean up channel configuration

* additional debug logging

* add guard

* prevent multiple discoveries for a device

* cleanup and still configure on rejoin
2019-04-18 12:24:02 -04:00
Robbie Trencheny
5e1338a9e4 Further improve IndieAuth redirect_uri lookup failure logs (#23183) 2019-04-18 09:03:25 -07:00
Jc2k
4ac9a2e9de Add storage for cacheable homekit entity maps. (#23191) 2019-04-18 08:55:34 -07:00
Richard Mitchell
f57191e8dd Hue motion senors are motion sensors, not presence sensors. (#23193) 2019-04-18 08:53:02 -07:00
David Bonnes
11fb4866a8 Improve configuration schema for Geniushub integration (#23155)
* configuration for hub tokens are now separate from host addresses/credentials

* small change to docstring

* use *args **kwargs
2019-04-18 14:37:52 +02:00
Penny Wood
d9fb3c8c28 Potential None (#23187) 2019-04-18 14:04:30 +02:00
Pascal Roeleven
df475cb797 Adds Orange Pi GPIO platform (#22541)
* Adds Orange Pi GPIO platform

* Add manifest.json

* Remove cover platform

* Apply requested changes

* Remove switch platform

* Update CODEOWNERS

* Remove obsolete dependecies/requirements
2019-04-18 19:43:34 +09:00
Rohan Kapoor
f588fef3b4 Add minimum/maximum to counter (#22608)
* Added minimum/maximum to counter

* Added min/max testcases

* remove duplicate

* cosmetic changes

* removed blank lines at eof

* added newline at eof

* type cv -> vol

* more fixes

* - fixed min/max warnings
- fixed failing tests

* Added linewrap

* - Added cast to int
- Fixed double quotes

* - removed None check in __init__
- fixed failing test

* copy paste fix

* copy paste fix

* Added possibility to change counter properties trough service call

* fixed copy paste errors

* Added '.' to comment

* rephrased docstring

* Fix tests after rebase

* Clean up per previous code review comments

* Replace setup service with configure

* Update services description

* Update tests to use configure instead of setup
2019-04-18 19:02:01 +09:00
Dries De Peuter
6e4083d7f4 Fix niko home control dependency installation (#23176)
* Upgrade niko-home-control library

* Fix additional feedback

* Lint
2019-04-18 10:52:48 +02:00
Paulus Schoutsen
25a5bd32e2 Bumped version to 0.92.0b1 2019-04-17 22:42:41 -07:00
Paulus Schoutsen
3665e87800 Don't warn for missing services (#23182) 2019-04-17 22:42:35 -07:00
Paulus Schoutsen
fa0d538358 Fix empty components (#23177) 2019-04-17 22:42:34 -07:00
Joakim Plate
c508d5905b Google assistant skip missing type (#23174)
* Skip entity if no device type found

* Add test for potentially skipped binary sensors

* Reorg code, add tests to ensure all exposed things have types

* Lint

* Fix tests

* Lint
2019-04-17 22:42:34 -07:00
Richard Mitchell
dc2cb62265 Add basic support for native Hue sensors (#22598)
* Add basic support for native Hue sensors

* Update coveragerc

* Simplify attributes

* Remove config option

* Refactor and document device-ness and update mechanism

* Entity docstrings

* Remove lingering config for sensors

* Whitespace

* Remove redundant entity ID generation and hass assignment.

* More meaningful variable name.

* Add new 'not-darkness' pseudo-sensor.

* Refactor sensors into separate binary, non-binary, and shared modules.

* formatting

* make linter happy.

* Refactor again, fix update mechanism, and address comments.

* Remove unnecessary assignment

* Small fixes.

* docstring

* Another refactor: only call API once and make testing easier

* Tests & test fixes

* Flake & lint

* Use gather and dispatcher

* Remove unnecessary whitespace change.

* Move component related stuff out of the shared module

* Remove unused remnant of failed approach.

* Increase test coverage

* Don't get too upset if we're already trying to update an entity before it has finished adding

* relative imports
2019-04-17 22:42:33 -07:00
Richard Mitchell
d0c3a8ecaf Kill bluetooth LE scanning gracefully when asked to shut down. (#22586)
* Kill bluetooth LE scanning gracefully when asked to shut down.

* Add missing argument.

* Refactor to use data instead of passing nonlocal variables about.

* Fix typo.
2019-04-17 22:42:33 -07:00
Joakim Plate
4a2a130bfa Google assistant skip missing type (#23174)
* Skip entity if no device type found

* Add test for potentially skipped binary sensors

* Reorg code, add tests to ensure all exposed things have types

* Lint

* Fix tests

* Lint
2019-04-17 22:37:39 -07:00
Paulus Schoutsen
ce8ec3acb1 Don't warn for missing services (#23182) 2019-04-17 22:27:11 -07:00
Richard Mitchell
474ac8b09e Add basic support for native Hue sensors (#22598)
* Add basic support for native Hue sensors

* Update coveragerc

* Simplify attributes

* Remove config option

* Refactor and document device-ness and update mechanism

* Entity docstrings

* Remove lingering config for sensors

* Whitespace

* Remove redundant entity ID generation and hass assignment.

* More meaningful variable name.

* Add new 'not-darkness' pseudo-sensor.

* Refactor sensors into separate binary, non-binary, and shared modules.

* formatting

* make linter happy.

* Refactor again, fix update mechanism, and address comments.

* Remove unnecessary assignment

* Small fixes.

* docstring

* Another refactor: only call API once and make testing easier

* Tests & test fixes

* Flake & lint

* Use gather and dispatcher

* Remove unnecessary whitespace change.

* Move component related stuff out of the shared module

* Remove unused remnant of failed approach.

* Increase test coverage

* Don't get too upset if we're already trying to update an entity before it has finished adding

* relative imports
2019-04-17 22:13:03 -07:00
Paulus Schoutsen
77244eab1e Fix empty components (#23177) 2019-04-17 19:17:13 -07:00
Jc2k
6bb4199824 Add @Jc2k to codeowners for homekit_controller (#23173) 2019-04-17 19:16:20 -07:00
Richard Mitchell
f6349a6cf4 Kill bluetooth LE scanning gracefully when asked to shut down. (#22586)
* Kill bluetooth LE scanning gracefully when asked to shut down.

* Add missing argument.

* Refactor to use data instead of passing nonlocal variables about.

* Fix typo.
2019-04-17 13:48:17 -07:00
zewelor
fa73b8e37a Make less imports from yeelight (#23124) 2019-04-17 22:05:49 +02:00
Ingo Theiss
0afa01609c Pass configured host string instead of always forcing an ip-address (#23164)
* Pass host string instead of forcing an ip-address

Pass the configured host (https://www.home-assistant.io/components/homematic/#host) instead of always forcing an ip-address. This is required to get SSL certificate validation working.

* Remove unused 'socket' import
2019-04-17 21:35:16 +02:00
Paulus Schoutsen
723d00d33a Bumped version to 0.93.0.dev0 2019-04-17 10:49:25 -07:00
Paulus Schoutsen
9986df358a Bumped version to 0.92.0b0 2019-04-17 10:32:59 -07:00
Paulus Schoutsen
e75820fc97 Merge remote-tracking branch 'origin/master' into dev 2019-04-17 10:32:37 -07:00
Jasper van der Neut - Stulen
8e4e6a50d8 Only create sensors if the station actually has values for them. (#20643)
Because Luftdaten assigns separate ids for particle and weather
measurements, most if not all stations added with config flow will
have non-functional sensors, as mentioned in #19591. This change
prevents the creation of sensors without data.
2019-04-17 10:27:59 -07:00
Andrey "Limych" Khrolenok
2e57d48191 Adding Telegram bot leave_chat() service (#22259)
* Adding leave_chat() service

* Fix indent
2019-04-17 10:15:33 -07:00
Jc2k
a97fb8fd10 Support fetching/setting humidity of HomeKit controller thermostats (#23040)
* Add support for homekit humidity control

* Add tests
2019-04-17 10:03:32 -07:00
Jc2k
f7afd9d6bc Fix handling of homekit_controler zeroconf c# changes (#22995) 2019-04-17 10:02:51 -07:00
Jc2k
88455a8a8b homekit_controller: Support cover stop (#23046) 2019-04-17 10:02:04 -07:00
pbalogh77
7d4083cdd3 Changed scene unique IDs (#22987)
There was a potential unique ID collission which caused problems for some users, as scenes and devices are enumerated separately, so the same ID could be assigned to in they are unnamed.
So I changed the unique ID generation for scenes to avoid this, which is a breaking change wrt scenes.
2019-04-17 09:56:34 -07:00
Penny Wood
7a9c9031af I think this is a potential bug (#23157) 2019-04-17 09:52:08 -07:00
Paulus Schoutsen
6a40a712cd Install deps and reqs early for config flows (#23169) 2019-04-17 09:49:45 -07:00
Paulus Schoutsen
3d85999258 Updated frontend to 20190417.0 2019-04-17 09:48:59 -07:00
ThaStealth
5b33d952aa Added epson workforce component (#23144)
* Added epson workforce component

* Added __init__ file
2019-04-17 18:33:22 +02:00
Paulus Schoutsen
dcb4eb39fa Update translations 2019-04-17 09:31:34 -07:00
Pascal Vizeli
073f947ca4 Bump Home Assistant Cloud 0.12 (#23159)
* Home Assistant Cloud 0.12

* Fix raising error

* Fix requirements

* Fix lint
2019-04-17 06:57:26 -07:00
Robert Svensson
0b7e62f737 Axis change how new event is signalled (#23152) 2019-04-17 15:21:42 +02:00
Erik Eriksson
e114ae9b53 catch asyncio.TimeoutError (#23156) 2019-04-17 22:00:57 +09:00
trilu2000
b909e5823f Homematic Lock: state_uncertain attribute, Homematic dimmer: Light service transition attribute (#22928)
* STATE_UNCERTAIN for Homematic Lock devices introduced

Homematic Lock devices provides an uncertain flag if the lock was opened manually an the lock is uncertain regards the status.
The other necassary functionality was implemented in pyhomematic by Daniel earlier...

* enabled attribute transition in light service for homematic dimmer devices

* Update light.py

* Revert "Update light.py"

This reverts commit f5565a006d.

* Revert "Revert "Update light.py""

This reverts commit 2c264826ef.

* fix for line too long error

* trailing whitespace
2019-04-17 14:30:53 +02:00
Paulus Schoutsen
37ca9cabd1 Fix check config script (#23151)
* Fix check config script

* Fix typings

* Fix test
2019-04-16 17:14:25 -07:00
Joakim Plate
1bfccd803f Allow switches to be represented as outlets on google assistant (#23149)
* Add device class support for switch to support outlet type

* Add a test for cover device class sync

* Drop remnant unused import
2019-04-16 17:07:14 -07:00
GeoffAtHome
e02a5f0b31 Genius hub (#21598)
* Adding Genius Hub

* Added Genius hub

* Correct hound errors

* Correct hound errors.

* Correct tox errors.

* Fix travis errors

* Correct sensor names

* Correct travis errors

* Correct hound  errors

* Follow up from code review by Martin Hjelmare

* More changes from code review.

* Attempt to resolve conflicts in requirements_all

* de-lint for the houndci-bot

* better logging message, and small tidy-up

* minor refactor and de-lint

* domain name should be the same as the component name

* use self where appropriate

* minor de-lint

* add entities as a single call

* de-lint

* all read-only attrs almost done

* refactor - near the end

* change state/,ode mapping

* override temp from curr_temp

* all read-only properties working

* working now

* ready for PR, but need to remove logging

* de-lint

* de-linted, ready for merge

* de-linted, ready for merge 2

* didn't like import in climate/__init__

* improve footprint logic

* add manifest.json

* add manifest.json 2

* correct a regression

* fix regression with device.is_on()

* use latest client library

* update to latest client library, 3.3.6

* delint and shoudl be OK to go
2019-04-16 23:54:46 +02:00
Joakim Plate
4ed1d9ba8e Add target_temp_high/low and current_temperature (#21393)
* Add target_temp_high/low and current_temperature

water_heater piggy back on climate(thermostat) component in gui,
so these things are already supported by frontend for display
purposes.

* Drop support tags for target high/low
2019-04-16 14:37:27 -07:00
Mike Megally
d7183d642e update caldav to fix calendar issues with synology clients (#23145) 2019-04-16 14:30:40 -07:00
Jason Hu
308d1fbba0 Rename google/tts.py to google_translate/tts.py (#23090)
* Rename google/tts.py to google_translate/tts.py

* Move config migration before load config file

Migrate default config google tts to google_translate tts

* Revert change in process component config

* Fix tests
2019-04-16 14:27:07 -07:00
Paulus Schoutsen
ca524233ec Update components that can be used without being set up (#23133) 2019-04-16 14:11:58 -07:00
Otto Winter
3186109172 Simplify esphome (#22868)
* Add ESPHome climate support

* Adjust line length

* Update .coveragerc

* Update climate.py

* Simplify esphome integration

* Undo change

* Update cover.py
2019-04-16 13:48:46 -07:00
Paulus Schoutsen
10e8f4f70a Add support for after_dependencies (#23148)
* Add support for after_dependencies

* Remove assert false"

* Fix types
2019-04-16 13:40:21 -07:00
Nikolay Vasilchuk
7b1cbeaf80 Fix verify_ssl configuration (#23146)
Fix verify_ssl configuration
2019-04-16 11:55:12 -07:00
Dries De Peuter
45e5f5de78 Fix niko_home_control integration (#23093)
Update base library and only pull for state once.
2019-04-16 11:47:16 -07:00
Villhellm
177ae3fd32 Added state workaround exception for Kwikset 99100-078 (#23130)
I have verified that this does work with my lock.
2019-04-16 08:19:31 -04:00
Pascal Vizeli
6bb95f6b58 Merge pull request #23137 from home-assistant/rc
0.91.4
2019-04-16 10:53:12 +02:00
Pascal Vizeli
c90219ad2e Bumped version to 0.91.4 2019-04-16 08:47:36 +00:00
Robert Svensson
a45df7aac9 Axis - improved internal parameter handling (#23122)
Will result in faster startup per entry due to less network data
2019-04-16 10:46:29 +02:00
Pascal Vizeli
0e7a2f163c Fix ingress bug with Firefox (#23121)
* Fix ingress bug with Firefox

* Fix mock

* Fix tests

* Fix test lint
2019-04-16 08:44:30 +00:00
Jason Hunter
e7102eaf30 only preload when stream is setup (#23134) 2019-04-15 22:36:57 -07:00
Paulus Schoutsen
8b86bf7dd2 Load integrations only once (#23132) 2019-04-15 20:38:24 -07:00
Teemu R
f48eb913b3 Bump pyhs100 requirement for tplink integration (#23065)
* bump pyhs100 requirement for tplink integration

* Fixes #20994

* Run script/gen_requirements_all.py
2019-04-15 20:29:31 -04:00
Sidney
48138189b3 Fix flux_led only-white controllers (and remove explicit declaration as RGBW in automatic add) (#22210)
* Remove explicit declaration of automatic found devices as RGBW

* fixes for Magic Home only-white controllers

* mode is now set to None instead of removed entirely

* flux_led now changes no values when turned on from off state.

* better checking for changed values in turn_on

* Reduce waiting time to 1 second

* Correction of turn on logic

* Remove accidentally inserted 'not'

* Remove lint

* Remove redundant code
2019-04-15 17:07:15 -07:00
Paulus Schoutsen
6a2da9f9a5 load cleanups (#23112)
* load cleanups

* Remove unused methods

* Allow importing requirements at the top of a file

* Fix test

* Lint

* Install reqs ASAP when loading platforms
2019-04-15 16:45:46 -07:00
Fredrik Erlandsson
4d080f8b17 skip non existing zones (#23113) 2019-04-15 16:41:33 -07:00
Tim Lyakhovetskiy
9e15fc1376 Update Leviton Decora WiFi library version. (#23125) 2019-04-15 16:15:51 -07:00
zewelor
7bed448100 Update yeelight lib (#23123)
* Update yeelight lib

* Run gen requirements
2019-04-15 16:10:26 -07:00
Pascal Vizeli
7a78d65633 Fix ingress bug with Firefox (#23121)
* Fix ingress bug with Firefox

* Fix mock

* Fix tests

* Fix test lint
2019-04-15 15:27:13 -07:00
Robert Svensson
60c787c2e6 Axis component support unloading entries (#22692)
* Add support for unloading entries

* Improve config entry tests

* Improve coverage for device

* Remove callback when relevant
2019-04-15 15:06:45 -07:00
Andrew Loe
dbcdc32f05 Ensure Boolean configuration values are handled correctly. (#22810) 2019-04-15 14:24:20 -07:00
Michał Węgrzynek
7251e29e60 Add basic Supla cover support (#22133)
* Added basic Supla (https://www.supla.org) support (covers)

* PySupla upgrade, minor spelling corrections and .coveragerc update

* Linter errors cleanup

* More linter cleanups.

* Documentation link removal and import sorting

* Docstring formatting

* PR suggestions

* Styling and linting

* PySupla version update

* Removal of ALLOW_EXTRA in SERVER_CONFIG

* Return False on failed connection validation, function order cleanup

* Component manifest

* Missing return None and different way of setting unique_id

* CODEOWNERS update

* CircleCI nudge
2019-04-15 13:20:08 -07:00
Pascal Vizeli
8a4dd093f8 Add pvizeli/danielperna84 to code owner of homematic (#22989)
* Add pvizeli/danielperna84 to code owner of homematic

* Update CODEOWNERS

* Run hassfest
2019-04-15 13:13:29 -07:00
giefca
497038b332 Add Google Assistant garage type (#23115)
* Tests

* Add Google Assistant GARAGE type

* Update test_trait.py

* Key device class by domain

* Update smart_home.py
2019-04-15 13:05:53 -07:00
cgtobi
f5878e1f22 Clean coveragerc of removed integrations (#23118) 2019-04-15 10:58:37 -07:00
cgtobi
6ab158ba88 Bump pyatmo version (#23116) 2019-04-15 10:58:02 -07:00
Tsvi Mostovicz
d894025365 Lower verbosity of command line sensor (#23120)
The command line sensor prints every minute the command that is run. This fills up the log.
The command run should be a debug statement.
2019-04-15 10:56:32 -07:00
Jeff Irion
c341e33749 Handle missing 'serialno' of Android TV (#22996)
* Handle missing 'serialno' for unique ID

* Use None for unique_id if serialno is missing

* Remove name from unique ID

* Use serialno as unique_id
2019-04-15 10:28:58 -07:00
Robert Svensson
ec171b9928 Axis - start stream when system is ready (#23119)
* Make sure that event stream doesn't start until event listeners are ready

* Change order
2019-04-15 09:20:01 -07:00
Jc2k
e97b2b7015 Fix homekit_controller climate supported operation_list being blank (#23095)
* Fix tado supported operation modes when used with homekit_controller

* Replace with list comp as requested in review

* More list comps
2019-04-15 17:09:21 +02:00
Jason Hu
2f89f88d23 Load component which contains data entry flow handler (#23107)
* Load component which contains data entry flow handler

* Use integration.get_component()

* Add error log
2019-04-14 23:24:47 -07:00
Paulus Schoutsen
b0d893afc9 Remove loader.get_component (#23111)
* Remove get_component

* Lint
2019-04-14 22:31:01 -07:00
Robert Svensson
23cb579f9f Support updating deCONZ host address (#22784)
* Update config flow to support updating host address
Improve tests

* Update gateway to handle new address signal

* Improve description why whe need to keep step_init
2019-04-14 21:50:01 -07:00
Maikel Punie
96f689a70f Upgraded python-velbus package, this fixes a lot of problems with the… (#23100)
* Upgraded python-velbus package, this fixes a lot of problems with the velbus component

* updated manifest.json
2019-04-14 21:42:30 -07:00
giefca
b804919eaa Fix for stateless covers (#22962)
* Corrections and test

* Raise error if does not support setting position

* Raising error for stateless and assumed state covers

* Fix pylint

* Tests

* Update test_trait.py
2019-04-14 19:52:00 -07:00
Paulus Schoutsen
d722f4d64a Further integration load cleanups (#23104)
* Further integration load cleanups

* Fix tests

* Unflake MQTT vacuum command test
2019-04-14 19:07:05 -07:00
Alexei Chetroi
930f75220c Await merge_packages_config(). (#23109) 2019-04-14 19:02:49 -07:00
Paulus Schoutsen
6b0180f753 Fix demo (#23087)
* Fix demo

* Fix types

* Fix all the things

* Fix type

* Fix test

* Lint
2019-04-14 16:59:06 -07:00
Pawel
1d2e9b6915 Add support for params in send_command (#23071)
* add support for params in send_command

* add more tests
2019-04-14 11:09:46 -07:00
ActuallyRuben
df580b2322 Add URL query parameters to webhook trigger result data (#23043)
* Added query parameters to webhook data

* Added test for query webhook

* Add second blank line in new test for webhook trigger
2019-04-14 10:53:35 -07:00
Jason Hu
d1398e24be Increase timeout (#23098) 2019-04-14 10:18:45 -07:00
Paulus Schoutsen
3368e30279 Migrate packages and check config (#23082)
* Migrate packages and check config

* Fix typing

* Fix check config script
2019-04-14 07:23:01 -07:00
Jason Hu
95662f82d4 Remove validate from aws_config (#23084) 2019-04-14 07:21:47 -07:00
choss
c314220167 Ignore secrets.yaml when using include_dir_named (#22929)
* ignore secrets.yaml in include_dir_named include

* updating test for include_dir_named secrets ignore
2019-04-13 21:24:06 -07:00
Erik Montnemery
c6bc47b32d Refactor MQTT climate to deduplicate code (#23044) 2019-04-13 20:34:39 -07:00
Erik Montnemery
b390de1598 Fix bugs in MQTT vacuum (#23048) 2019-04-13 20:29:01 -07:00
Erik Montnemery
d99637e51b Deprecate implicit state_topic for MQTT discovery (#22998)
* Deprecate implicit state_topic for MQTT discovery

* Lint

* Add comments

* Modernize tests
2019-04-13 20:25:45 -07:00
Aaron Bach
56b08a6ddb Ensure OpenUV service checks permissions (#22668)
* Create decorator to check service permissions

* Ensure OpenUV service has proper user permissions

* Reverting strange changes
2019-04-13 16:50:19 -06:00
Martin Fuchs
0a0975b5d9 Add support for Stiebel Eltron heat pumps (#21199)
* Start with Stiebel Eltron heatpump

* STE HP

* Add read of operating mode

* Add read-write operation mode

* Further extract ModBus access

* Separation of platform and API

* Last changes

* Use modbus hub

* Update module doc with config

* Clean up platform code

* Cleanup and update to dev2 of pystiebeleltron

* Remove slave configuration

* Add translation of states

* Make name parameter optional

* Consolidate platform

* Correct .coveragerc after conflict

* Prepare component for sensor platform

* Fix issues found in review

* Remove custom states and map to existing HA states

* Force update, when values are modified

* Update CODEOWNERS and requirements_all.txt

* Fix .coveragerc file

* Exclude stiebel_eltron components in .coveragerc

* Break out to module level constant

* Rename constant

* Removed REQ and DEP constant.
2019-04-13 23:53:36 +02:00
Teemu R
39264af310 Add missing async for tplink's async_setup_platform methods (#23066)
* add missing async for tplink's async_setup_platform methods

thanks to @MartinHjelmare for spotting this, related to #21916

* fix line lengths
2019-04-13 23:50:21 +02:00
Andrew Sayre
8c89e260df HEOS confirm discovered devices before adding (#23063)
* Add host selection step to discovery

* Review feedback

* Fix failing test
2019-04-13 16:44:45 -05:00
Aaron Bach
46ee7d7b22 Fix test (#23081) 2019-04-13 14:32:07 -07:00
Paulus Schoutsen
e8343452cd Validate component usage (#23037)
* Update manifest validator

* Update circle

* Update text

* Typo

* fix link to codeowners

* Merge CODEOWNERS into hassfest

* Annotate errors with fixable

* Convert error to warning

* Lint

* Make abs path

* Python 3.5...

* Typo

* Fix tests
2019-04-13 13:17:01 -07:00
Aaron Bach
fc481133e7 Create decorator to check service permissions (#22667)
* Create decorator to check service permissions

* Typing

* Linting

* Member comments

* Linting

* Member comments

* Updated import

* Owner comments

* Linting

* Linting

* More work

* Fixed tests

* Removed service helper tests in RainMachine

* Linting

* Owner comments

* Linting

* Owner comments

Co-Authored-By: bachya <bachya1208@gmail.com>
2019-04-13 13:54:29 -06:00
Joakim Plate
7a6950fd72 Validate data packet format on config validation (#23062) 2019-04-13 10:58:12 -07:00
Penny Wood
2527731865 Fix websocket connection sensor (#22923)
* Fix for #22890

* Singleton count
2019-04-13 10:48:40 -07:00
Alexei Chetroi
479511ee42 Bugfix ZHA device_removed() handler. (#23074) 2019-04-13 12:57:22 -04:00
c-soft
2f17529f28 Add Satel_integra switchable outputs and multiple partitions (#21992)
* Added editable outputs and multiple zones.

* Updated requirements_all.txt

* Linter fixes.

* Post-review changes

* Fixed too many lines separation error

* Passing satel controller as parameter to entities.

* Fixed linter error.

* Fixed forgotten requirements update.

* Fixed satel_integra version (again!?!)

* Fixed manifest.json.

* Fixed passing non-serializable controller

* Removed unnecessary isinstance check.

* Post review changes
2019-04-13 14:24:12 +02:00
Josef Schlehofer
18cf8275b8 Upgrade python-slugify to 3.0.2 (#22997) 2019-04-13 11:29:44 +02:00
Jason Hu
73a473ac29 Allow aws credential skip validation (#22991)
* Allow aws credential skip validation

* Don't validate the auto-created default profile
2019-04-12 17:19:05 -07:00
Paulus Schoutsen
3f69d0283d Convert translation helper to use async_get_integration (#23054)
* Convert translation helper to use async_get_integration

* Simplify after comments

* Lint

* Fix typing

* Typo
2019-04-12 17:10:19 -07:00
Paulus Schoutsen
b767232e50 Only load stream when av package available (#23058) 2019-04-12 17:09:58 -07:00
Aaron Bach
05f267de6e Update RainMachine sensors in parallel (#23057) 2019-04-12 17:44:04 -06:00
Diogo Gomes
51508d69ad Bandage telegram bot (#23022)
* Bandage

* lint

* move everything into __init__.py

* fix lint
2019-04-12 14:28:59 -07:00
Joakim Plate
0a3e11aa12 Move Broadlink services to component (#21465)
* Register services in broadlink domain

* Add tests for broadlink services

* Resolve review comments

* One more review fix

* Restore auth retry

* Drop unused constants

* Fix flake8 errors
2019-04-12 20:11:36 +02:00
Paulus Schoutsen
f269135ae9 Migrate check-config to use get_integration (#23026)
* Migrate check-config to use get_integration

* ImportError
2019-04-12 10:14:16 -07:00
cgtobi
2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Paulus Schoutsen
f7d4c48199 Convert service helper to use async_get_integration (#23023)
* Convert service helper to use async_get_integration

* Fix tests
2019-04-12 10:09:17 -07:00
Charles Garwood
c8375be4b1 Replace get_platform (#23014)
* Update Z-Wave to use async_get_integration

* Change load method per PR comments

* update tests
2019-04-12 12:22:56 -04:00
Aaron Bach
7d46ed0bf9 Remove expired 17track.net packages from entity registry (#23001)
* Remove expired 17track.net packages from entity registry

* Reverse order
2019-04-12 08:03:14 -06:00
Austin Drummond
3d441dffad Update HAP-python to 2.5.0 (#23031) 2019-04-12 13:26:52 +02:00
Malte Franken
6c51592e34 Instituto Geográfico Nacional Sismología (Earthquakes) Feed platform (#22696)
* wip

* added new requirements

* fixed tests

* improved test coverage

* added feed entry's title

* added manifest

* updated codeowners

* generated requirements
2019-04-12 09:01:28 +02:00
Paulus Schoutsen
c94b031db1 Fix unnecessary hass.components interaction (#23029)
* Fix wemo

* Fix bloomsky

* Fix netatmo

* Fix one more reference
2019-04-11 23:37:45 -07:00
Paulus Schoutsen
57f17707c6 Specify configurator as dependency (#23030) 2019-04-11 20:11:56 -07:00
Robbie Trencheny
7303d56a55 Mobile App: Remove component loading support (#23025)
Loading a component defined in a registration didn't actually work and was undocumented, so let's just remove it instead of fixing #23005.

## Checklist:
  - [X] The code change is tested and works locally.
  - [X] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [X] There is no commented out code in this PR.
2019-04-11 19:06:36 -07:00
Paulus Schoutsen
7e39e14086 Merge remote-tracking branch 'origin/master' into dev 2019-04-11 16:06:31 -07:00
Ian Richardson
8bfe77a1a0 Add aftership package details and add/remove services (#22275)
* 📦 Package details and add/remove services

* lint

* Cleanup

* lint

* Fix add tracking service call

* cleanup

* Make data easier to consume on the front-end

* lint

* Add expected delivery date

* call update after add/remove

* lint

* cleanup

* Add last_checkpoint

* address review comments

* remove formatting changes

* lint

* Address review comments

* address review comments

* address review comments

* lint

* lint
2019-04-11 15:57:48 -07:00
Jason Hu
ac7f1a7a37 Fix test failed in py35 (#23002) 2019-04-11 12:52:02 -07:00
Stephan Beier
02347df140 Prevent the projector to toogle on/off (#22985) 2019-04-11 11:32:25 -05:00
Markus Jankowski
d078e50fb8 Add device HmIP-MIOB to Homematic IP Cloud (#22975)
* Update upstream dependency

* Add two switches
2019-04-11 10:49:02 +02:00
Rohan Kapoor
6ba9ccf052 Load requirements and dependencies from manifests. Fallback to current REQUIREMENTS and DEPENDENCIES (#22717)
* Load dependencies from manifests. Fallback to current DEPENDENCIES

* Fix typing

* Ignore typing correctly

* Split out dependency processing to a new method

* Fix tests

* Only pull from manifest if dependencies is non empty

* Inline temporary function

* Fix light tests [skip ci]

* Fix tests/common

* Fix some mqtt tests [skip ci]

* Fix tests and component manifests which have only one platform

* Fix rflink tests

* Fix more tests and manifests

* Readability over shorthand format

* Fix demo/notify tests

* Load dependencies from manifests. Fallback to current DEPENDENCIES

* Load requirements from manifests. Fallback to current REQUIREMENTS

* Fix typing

* Ignore typing correctly

* Split out dependency processing to a new method

* Only pull from manifest if dependencies is non empty

* Inline temporary function

* Fix tests and component manifests which have only one platform

* Fix rflink tests

* Readability over shorthand format

* Clean up requirements

* Use integration to resolve deps/reqs

* Lint

* Lint

* revert a change

* Revert a test change

* Fix types

* Fix types

* Add back cache for load component

* Fix test_component_not_found

* Move light.test and device_tracker.test into test package instead with manifest to fix tests

* Fix broken device_tracker tests

* Add docstrings to __init__

* Fix all of the light tests that I broke earlier

* Embed the test.switch platform to fix other tests

* Embed and fix the test.imagimage_processing platform

* Fix tests for nx584

* Add dependencies from platform file's DEPENDENCIES

* Try to setup component when entity_platform is setting up

Fix tests in helpers folder

* Rewrite test_setup

* Simplify

* Lint

* Disable demo component if running in test

Temp workaround to unblock CI tests

* Skip demo tests

* Fix config entry test

* Fix repeat test

* Clarify doc

* One extra guard

* Fix import

* Lint

* Workaround google tts
2019-04-11 01:26:36 -07:00
Miroslav Ždrale
8a81286abb Bump pyubee version to support more models and detect model automatically (#22450)
* Bump pyubee to 0.4, support more models and detect model automatically

* Update requirements_all.txt

* Check for supported models

* Add model aliases

* Code clean-up

* Updated code to meet reviewer's requests.

* Updated code to meet reviewer's requests.

* Minor update

* Minor update

* Populate mac2name dict

* Return list of MAC addresses, not dict

Co-Authored-By: mzdrale <mzdrale@gmail.com>

* Minor update
2019-04-11 10:25:46 +02:00
Robbie Trencheny
f5c677146a Make inlined JSON example valid 2019-04-10 21:58:50 -07:00
Paulus Schoutsen
f33bf718c7 Google Assistant: Migrate light setting trait to use HSV color spectrum (#22980)
* Migrate light setting trait to use HSV

* Fix tests

* Fix all the typos
2019-04-10 21:35:37 -07:00
cgtobi
c2cfc4a813 Stream support for Netatmo cameras (#22952)
* Add stream feature

* Add a missing slash

* Get config parameter

* Get default quality
2019-04-10 16:10:14 -07:00
Paulus Schoutsen
373b2009c9 Catch connection reset (#22982) 2019-04-10 15:42:10 -07:00
Paulus Schoutsen
e9d9861bda Update translations 2019-04-10 15:01:32 -07:00
Paulus Schoutsen
c81b1956da Updated frontend to 20190410.0 2019-04-10 15:01:14 -07:00
Aaron Bach
153c6957b9 Add watchdog reset to on_connect in Ambient (#22956) 2019-04-10 15:25:19 -06:00
ehendrix23
7862fdd27e Fix myq increasing number of network connections (#22432)
* Fix for network issues

Fix for network issues

* Further changes to network connection

* websession is created in pymyq

websession is created in pymyq instead.
Added call on stop event to close web session.

* Updated requirements file

* Added comment

* Changed back to use aiohttp_client

* Cleanup closed sockets in aiohttp

Enable automatic cleanup of closed sockets in aiohttp client helper.

* Updated manifest & requirements

* Updated comment block
2019-04-10 14:24:12 -07:00
Erik Montnemery
38d92b2abf Fix optimistic mode and add tests (#22899) 2019-04-10 13:56:34 -07:00
Robert Svensson
6463b8165f Fix deCONZ change entity_id bug (#22974)
Fix deCONZ change entity_id bug
2019-04-10 22:35:28 +02:00
Otto Winter
72af4276b9 Add ESPHome climate support (#22859)
* Add ESPHome climate support

* Adjust line length

* Update .coveragerc

* Update climate.py

* Rename
2019-04-10 22:13:13 +02:00
Andrew Sayre
7624d0e79f Check for supported features in media_player services (#22878)
* Add check for supported features

* Move logic to service helper

* Fix hacked in test for seek

* Test for service required features
2019-04-10 09:44:58 -07:00
Pascal Vizeli
fc7a187dd6 Update uvloop 0.12.2 2019-04-10 16:46:23 +02:00
Pascal Vizeli
536356ceec Merge pull request #22969 from home-assistant/rc
0.91.3
2019-04-10 16:42:00 +02:00
Pascal Vizeli
984af45bb2 Bumped version to 0.91.3 2019-04-10 13:22:19 +00:00
Pascal Vizeli
eab575e65d Bugfix: pass protocol out of header to application layer (#22955) 2019-04-10 13:19:54 +00:00
Robbie Trencheny
e7a17b710d Add cloudhook and remote UI vals to get_config (#22921) 2019-04-10 13:19:54 +00:00
Robbie Trencheny
a267df2abb More Mobile app sensor fixes (#22914)
* Ensure we only add a sensor once

* Ensure that we dont process updates for entities that arent what we were setup for

* Add debug logging to ease development of apps

* Use str representation
2019-04-10 13:19:53 +00:00
Fabian Affolter
f531ca61c6 Set pytz>=2019.01 (#22966) 2019-04-10 15:18:30 +02:00
John Raahauge
9e56283eaf Fix position of add_entities of binary sensor (#22866)
* Bugfix - binary_sensor.py

* Added features to Concord232 Alarm Panel

* Added New Line End Of File

* Deleted Whitespace

* Back to original

Removed added feature and sticking to bugfix
2019-04-10 13:18:10 +00:00
Fabian Affolter
be51a3ae12 Upgrade ruamel.yaml to 0.15.91 (#22965) 2019-04-10 15:15:12 +02:00
Fabian Affolter
f4309dfcc6 Add missing attribution (#22964) 2019-04-10 14:51:42 +02:00
Fabian Affolter
691271147e Update ordering (#22963) 2019-04-10 14:35:57 +02:00
Fabian Affolter
3d5ee0eb58 Upgrade youtube_dl to 2019.04.07 (#22961) 2019-04-10 13:05:16 +02:00
Fabian Affolter
6156bb4e5b Upgrade Sphinx to 2.0.1 (#22960) 2019-04-10 13:03:30 +02:00
Ville Skyttä
7058249c01 Uprade asynctest to 0.12.3 (#22824) 2019-04-10 11:17:02 +02:00
Ville Skyttä
fa8a4de019 Upgrade pytest to 4.4.0 (#22822) 2019-04-10 11:16:52 +02:00
Erik Montnemery
bc5f0ff0b3 Use dict[key] for required config keys and keys with default values of MQTT light (#22834)
* Use dict[key] for required config keys and keys with default values.

* Improve tests

* Lint

* Improve tests of JSON data
2019-04-10 11:16:41 +02:00
mgiako
bbedf091aa Add functionality to the version sensor (#22896)
* Update manifest.json

* Update sensor.py

* new version option
2019-04-10 09:55:39 +02:00
Fredrik Erlandsson
5d3aac8130 Use ConfigEntryNotReady when setting up Daikin (#22901)
* raise ConfigEntryNotReady

* better debugging
2019-04-10 09:44:00 +02:00
Anders Melchiorsen
a833736a1e Add sms_total sensor to netgear_lte (#22954) 2019-04-10 09:41:57 +02:00
cdce8p
6d2412022b Fix HomeKit fan speed conversion (#22951)
* Check that speed value from state is not 'None'
* Added tests
2019-04-10 08:35:17 +02:00
Paulus Schoutsen
51e6d5380e Add color setting trait (#22894) 2019-04-09 20:17:13 -07:00
Pascal Vizeli
37f3eccb1e Bugfix: pass protocol out of header to application layer (#22955) 2019-04-09 20:13:39 -07:00
Paulus Schoutsen
e48ef7f441 Fix broken platform components (#22943)
* Fix broken platform components

* Lint
2019-04-09 15:42:44 -07:00
Paulus Schoutsen
8582e390f8 Remove introduction component (#22944)
* Remove introduction component

* Remove more usage
2019-04-09 14:45:09 -07:00
Austin Drummond
c4e31bc4df Add linked battery sensor to HomeKit (#22788) 2019-04-09 23:13:48 +02:00
Anders Melchiorsen
6244a397b1 Hide unsupported Sonos favorites (#22940) 2019-04-09 23:09:18 +02:00
Jason Hu
c82d2cb11c Cherry pick test fix (#22939) 2019-04-09 13:59:15 -07:00
Anders Melchiorsen
58ec77b017 Binary sensors for netgear_lte (#22902)
* Binary sensors for netgear_lte

* Move LTEEntity to component

* Revert unrelated manifest changes

* Address review comments

* Remove unused import
2019-04-09 20:28:20 +02:00
Justin Vanderhooft
4803f319b6 bump raincloudy to 0.0.7 (#22935) 2019-04-09 19:00:50 +02:00
Paulus Schoutsen
cac00f5b26 Test for circular dependencies using manifests (#22908)
* Integration dependencies

* Lint

* Lint

* Fix one test

* Lint

* Fix load custom component integration

Fix async issue
Add circular dependency detection in manifest validation

* Fix test

* Address review comment

* Apply suggestions from code review

Co-Authored-By: balloob <paulus@home-assistant.io>
2019-04-09 09:30:32 -07:00
Andrew Sayre
4110bd0acf Add support for when device is not logged in to HEOS (#22913) 2019-04-09 18:21:00 +02:00
Paulus Schoutsen
0d2646ba25 Update translations 2019-04-09 08:34:20 -07:00
Phil Bruckner
34bb31f4ec Add amcrest binary_sensors (#22703)
* Add amcrest binary_sensors

Add binary_sensors with option motion_detected. Deprecate motion_detector sensor.

* Update per review

* Update per review

Add custom validators to make sure camera names are unique, and to issue warning if deprecated sensors option motion_detector is used.

async_setup_platform should not return a value.

* Another review update

Since there is only one type of binary_sensor, remove type test in update method.
2019-04-09 15:21:47 +02:00
Evan Bruhn
a48c0f2991 Logi Circle public API refactor and config flow (#20624)
* Logi Circle now uses OAuth2 for authentication, added config flow.

* Service calls now dispatched to camera entities via signalled events

* Update from PR review

* Add unit tests for config flow

* Updated CODEOWNERS

* Reverted change to .coveragerc

* Improved test coverage of config flow
2019-04-09 14:26:58 +02:00
Ben Dews
f81ce0b720 Add 'Assumed State' property to Somfy MyLink covers (#22922)
* Explicitly return none for is_closed property

* Set the assumed_state property to true

* Added period to docstring
2019-04-09 05:58:09 -04:00
Paul Madden
88694c978b Camera component for BOM integration (#22816)
* Work on PR comments

* Work on PR comments

* Update imports

* Work on schema validation

* Fix package

* Add bomradarcam to .coveragerc

* Improve error message for location

* Delinting

* Correct module name in .coveragerc

* Add manifest.json

* Update requirements_all.txt

* Merge bomradarcam into existing bom integration
2019-04-09 05:56:04 -04:00
John Raahauge
d48fe4cebc Added features to Concord232 Alarm Panel (#22892)
* Added features to Concord232 Alarm Panel

* Update homeassistant/components/concord232/alarm_control_panel.py

Deleted 'or None' as per @syssi suggestion.
2019-04-09 05:49:48 -04:00
Robbie Trencheny
fd8d9747ef More Mobile app sensor fixes (#22914)
* Ensure we only add a sensor once

* Ensure that we dont process updates for entities that arent what we were setup for

* Add debug logging to ease development of apps

* Use str representation
2019-04-09 05:48:59 -04:00
Alexei Chetroi
64ea13104e Fix ZHA Light color conversion. (#22909) 2019-04-09 05:48:17 -04:00
Robbie Trencheny
75bed93d3d Add cloudhook and remote UI vals to get_config (#22921) 2019-04-09 05:47:57 -04:00
Ben Dews
6ee23bdf4e Add Somfy MyLink support for Covers (#22514)
* Added MyLink component

* Updated requirements.txt

* Fix lint issues

* Removed ‘Scene’ functionality

* Removed state restoration, as state is no longer tracked

* Add component manifest

* Remove documentation links in Docstring

* Removed redundant try/except block

* Removed default dict

* Removed features already implemented in default CoverDevice

* Removed attributes for tracking state

* Simplified loading of covers

No options exist other than reversal, so just check reversal status directly and update if needed

* Reimplemented is_closed property

* Import ENTITY_ID_FORMAT from base component

* Removed misc unused vars

* Update module docstrings to one line

* Removed too many blank lines, giving one back :)

* Return none on TimeoutError

* Added component to .coveragerc
2019-04-09 08:31:34 +02:00
Jason Hunter
43487aa0d6 Stream Timestamp Fixes (#22912)
* reset timestamps for streams that do not do so when first requested

* update inline comments to be more descriptive
2019-04-08 23:24:51 -07:00
Paulus Schoutsen
590eead128 Test fixes (#22911)
* Fix light tests [skip ci]

* Fix tests/common

* Fix some mqtt tests [skip ci]

* Fix tests and component manifests which have only one platform

* Fix more tests and manifests

* Fix demo/notify tests

* Rollback test for demo.geo_location
2019-04-08 23:16:55 -07:00
pbalogh77
1a05f7b04d Initial Fibaro HC Climate support (#20256)
* Initial version of climate

* initial commit of climate device support

* Fixed opmode and fanmode

* Cleanup

* meh

* added back all other components

Oops

* wider support for thermostats

Added one more identifier for thermostats to broaden compatibility

* Added even more climate types

* Reworked detection mechanism

Better support for combined devices

* Added additional modes

* force visibility on climate

* Changed logging of device data

* Improved operatingmode support

Improved operatingmode support

* Updated logic for opmode/fanmode list creation

Implemented a universal mapping logic for opmode and fanmode, to make it more widely compatible
Improved mapping of Fibaro FGT devices

* Lint fixes

* bump

* Fixes based on code review

* Fixes

* Moved to fibaro folder

* lint inspired cosmetic changes

* Mapped all operating modes to existing HA ones

Mapped all operating modes to existing HA ones

* Improved compatibility with Heatit thermostats

Thanks to astrandb for testing, debugging and fixing my code

* Changes based on code review

Changes based on code review

* more fixes based on more code review

more fixes based on more code review
2019-04-09 06:24:57 +02:00
Andrew Sayre
38f063a158 Fix HEOS discovery could result in multiple config entries (#22903)
* Prevent duplicate entries from discovery

* Update reqs files

* Prevent duplicate entries from discovery
2019-04-08 21:24:40 -05:00
Anders Melchiorsen
d577955d1e Fix Sonos handling of unsupported favorites (#22906) 2019-04-08 19:32:56 -05:00
Fredrik Erlandsson
55c8417ec0 fix aiohttp ServerDisconnectedError in Daikin (#22880) 2019-04-08 10:08:03 -07:00
Erik Montnemery
49a2f5a40b Use dict[key] for required config keys and keys with default values. (#22832) 2019-04-08 08:47:40 -07:00
Otto Winter
5727beed8e Add ESPHome Cover position/tilt support (#22858)
## Description:

Add ESPHome cover position and tilt support.

The aioesphomeapi also received a small refactor for these changes and those are part of this PR (constants were refactored into enums and optimistic was renamed to assumed_state). If possible, I'd like to include those in this PR because:

 1. It's mostly just very simple changes
 2. Because of the new position change the dev branch would be in a non-working state for a while until the split PR is merged (unless I write some temporary glue logic, but I'd prefer to avoid that)

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

If the code communicates with devices, web services, or third-party tools:
  - [x] [_The manifest file_][manifest-docs] has all fields filled out correctly ([example][ex-manifest]).
  - [x] New dependencies have been added to `requirements` in the manifest ([example][ex-requir]).
  - [x] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.

[ex-manifest]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/mobile_app/manifest.json
[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/mobile_app/manifest.json#L5
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
[manifest-docs]: https://developers.home-assistant.io/docs/en/development_checklist.html#_the-manifest-file_
2019-04-08 15:44:24 +02:00
Rohan Kapoor
6c53528ae8 Update harmony manifest to match REQUIREMENTS in module (#22826) 2019-04-08 06:43:38 -07:00
Otto Winter
c9ec166f4b Add MQTT climate two-point target temperature support (#22860)
* Add MQTT climate two-point target temperature support

* Sort

* Fix test
2019-04-08 06:28:42 -07:00
Matt Snyder
36c135c785 Stream support for Doorbird component (#22876)
* Support stream source for doorbird live camera

* Support stream source for doorbird live camera

* Support stream component on Doorbird camera entities

* Bump library version

* Update manifest

* Lint

* Correct parameter order
2019-04-08 09:22:31 -04:00
akasma74
d8c7160377 force_update=False (not None) (#22867)
because force_update: boolean
2019-04-08 06:21:13 -07:00
cgtobi
8cc5cc7f43 Add zwave network key validator (#22785)
* Add zwave network key validator

* Move validator to zwave component

* Move validator to zwave component

* Move stuff

* Move stuff

* Remove helper and replace with voluptuous method

* Add test

* Fix long line

* Improve tests

* Add more negative tests

* Remove unnecessary assertion

* Make the linter happy

* Remove print
2019-04-08 06:18:52 -07:00
John Raahauge
45a43592bd Fix position of add_entities of binary sensor (#22866)
* Bugfix - binary_sensor.py

* Added features to Concord232 Alarm Panel

* Added New Line End Of File

* Deleted Whitespace

* Back to original

Removed added feature and sticking to bugfix
2019-04-08 08:53:00 -04:00
Finbarr Brady
a0d6e08421 Bump pypi module version for enigma2 (#22886)
* Bug fix for #22727

* Update requirements_all.txt

* Update manifest.json
2019-04-08 08:49:52 -04:00
Finbarr Brady
a4ffc9e37a add myself as codeowner (#22885) 2019-04-08 08:48:19 -04:00
Pascal Vizeli
8f9c2000ce Merge pull request #22883 from home-assistant/rc
0.91.2
2019-04-08 11:27:14 +02:00
Robbie Trencheny
a04d44d97a Minor sensor fixes (#22884)
* Minor sensor fixes

* Fix tests
2019-04-08 08:17:11 +00:00
Robbie Trencheny
137d80452d Minor sensor fixes (#22884)
* Minor sensor fixes

* Fix tests
2019-04-08 01:13:26 -07:00
Pascal Vizeli
3f73973970 Bumped version to 0.91.2 2019-04-08 08:00:22 +00:00
Pascal Vizeli
3a79e37cde Fix content_type handling ingress (#22864) 2019-04-08 07:59:05 +00:00
zewelor
3f15b6b2d3 Fix yeelight possible array change during iteration (#22849) 2019-04-08 07:59:04 +00:00
zewelor
c5d4b7c243 Use relative imports in yeelight (#22839) 2019-04-08 07:59:04 +00:00
Robbie Trencheny
236e484dc2 Fix for rate limits should be optional (#22823) 2019-04-08 07:59:02 +00:00
Jason Hunter
f51e8c3012 coerce duration and lookback to int so they can be used in template automation (#22819) 2019-04-08 07:59:01 +00:00
Robbie Trencheny
474fc21c66 Fix for optional values in the update_location webhook call (#22817)
* Fix for optional values in the update_location webhook call

* Square brackets instead of .get
2019-04-08 07:59:00 +00:00
Robbie Trencheny
82f6bed3a3 Add a new mobile_app webhook command to get config (#22813)
* Add a new mobile_app webhook command to get config

* Limit fields returned
2019-04-08 07:58:59 +00:00
zewelor
abb531c06b Improve yeelight imports (#22804) 2019-04-08 07:58:10 +00:00
Chris Helming
7a8aa79f19 Add optional rtsp_port for Foscam (#22786)
* add optional rtsp port for config

* getting rid of default=None

* removing vol.Any
2019-04-08 07:56:56 +00:00
Robbie Trencheny
ed9d1e776f Add new mobile_app webhook command: get_zones (#22604)
## Description:

Adds a new `mobile_app` webhook command, `get_zones`, which just returns all zones.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-04-08 07:56:55 +00:00
Wolfgang Malgadey
d8119b2281 Fix tado turn on off (#22291)
* fix for turn on and off, with new pyTado

missing blank line

* removed, because can't push

* uploaded the file through github again
2019-04-08 07:54:58 +00:00
Pascal Vizeli
2d287d2abe Fix content_type handling ingress (#22864) 2019-04-08 09:22:55 +02:00
Aaron Bach
4982c0b196 Added REQUIREMENTS back to Ambient (#22875) 2019-04-07 21:02:03 -07:00
cdce8p
8bebd8583f Fix manifest codeowners (#22871)
* Added individual files section
* Replaced some manifest/codeowners
2019-04-07 21:01:05 -07:00
David F. Mulcahey
3086e1d39d get temp and color for light during init and poll (#22847) 2019-04-07 22:03:38 -04:00
Aaron Bach
a40a0c4042 Bump aioambient to 0.3.0 (#22855)
* Bump aioambient to 0.3.0

* Updated requirements

* Removed old REQUIREMENTS reference
2019-04-07 14:21:29 -06:00
zewelor
e407226afc Fix yeelight possible array change during iteration (#22849) 2019-04-07 14:05:38 -06:00
Jason Hu
abe85c73ae Fix flaky test (#22850) 2019-04-07 12:42:16 -07:00
Jason Hunter
3fde1d3bab coerce duration and lookback to int so they can be used in template automation (#22819) 2019-04-07 13:08:08 -04:00
roblandry
c7a49e0820 Fix glances docker container errors (#22846)
* Fix unavailable container errors

* Update to dev

* Use const
2019-04-07 13:07:05 -04:00
Robbie Trencheny
02b7fd93ed Fix for rate limits should be optional (#22823) 2019-04-07 07:37:27 -07:00
Erik Montnemery
fa2e07d7c5 Use dict[key] for required config keys and keys with default values. (#22830) 2019-04-07 10:11:45 -04:00
Erik Montnemery
58220a9448 Use dict[key] for required config keys and keys with default values. (#22829) 2019-04-07 10:11:20 -04:00
Erik Montnemery
dbb42e5890 Use dict[key] for required config keys and keys with default values. (#22838) 2019-04-07 10:10:57 -04:00
Erik Montnemery
2a62906965 Use dict[key] for required config keys and keys with default values. (#22837) 2019-04-07 10:10:13 -04:00
Erik Montnemery
b1213b7a2d Use dict[key] for required config keys and keys with default values. (#22836) 2019-04-07 10:09:43 -04:00
Erik Montnemery
a4e7708450 Use dict[key] for required config keys and keys with default values. (#22833) 2019-04-07 10:08:47 -04:00
Erik Montnemery
439197ea3e Use dict[key] for required config keys and keys with default values. (#22828) 2019-04-07 10:08:04 -04:00
zewelor
f62d1d8d09 Optimize yeelight signal handling (#22806) 2019-04-07 16:07:50 +02:00
zewelor
a91e79ee77 Improve yeelight imports (#22804) 2019-04-07 16:07:34 +02:00
zewelor
bb5c18f7be Use relative imports in yeelight (#22839) 2019-04-07 16:07:15 +02:00
Erik Montnemery
842534d472 Use dict[key] for required config keys and keys with default values. (#22831) 2019-04-07 10:00:40 -04:00
Erik Montnemery
83fb3637d9 Sort configuration schema. (#22835) 2019-04-07 09:56:38 -04:00
Robbie Trencheny
6492809a7e Fix for optional values in the update_location webhook call (#22817)
* Fix for optional values in the update_location webhook call

* Square brackets instead of .get
2019-04-07 01:17:14 -07:00
Robbie Trencheny
3ce6be6297 Add a new mobile_app webhook command to get config (#22813)
* Add a new mobile_app webhook command to get config

* Limit fields returned
2019-04-07 01:16:54 -07:00
Markus Jankowski
c8eebb6b4a Add HmIP-SMO to Homematic IP (#22802) 2019-04-07 00:43:07 -07:00
Justin Vanderhooft
8c17b2f7dd Bump raincloud dependency to fix broken integration: Fixes #22422 (#22805)
* Bump raincloud dependency to fix broken integration: Fixes #22422

* bump requirements_all

* bump CODEOWNERS

* edit codeowners in response to PR feedback
2019-04-06 20:33:28 -07:00
Erik Montnemery
353fca3b6e Raise severity of MQTT callback deprecation warning (#22792) 2019-04-06 20:31:39 -07:00
Erik Montnemery
55619da722 Remove unused group status (#22791) 2019-04-06 20:31:21 -07:00
Andrew Hayworth
87cabc933c Update version of python_awair to 0.0.4 (#22809)
The awair API has changed again, this time substituting 'lat' and 'lon'
for 'latitude' and 'longitude'.
2019-04-06 18:55:15 -07:00
Jeff Irion
a747eaa3ba Remove pycryptodome requirement for Android TV (#22552)
* Bump androidtv to 0.0.15

* Bump androidtv to 0.0.15 in manifest.json
2019-04-06 16:18:50 +01:00
panosmz
6351c5c6ab Add OASA Telematics greek public transport sensor component (#22196)
* add telematics sensor

* add missing final newline

* code cleanup & add manifest

* fixes from review

* fix flake8 warning

* rerun gen_requirements_all.py script
2019-04-06 15:20:51 +02:00
Pascal Vizeli
8b3cf2d493 Update homeassistant-pyozw 0.1.4 (#22794) 2019-04-06 12:09:15 +02:00
Chris Helming
2b490e4486 Add optional rtsp_port for Foscam (#22786)
* add optional rtsp port for config

* getting rid of default=None

* removing vol.Any
2019-04-05 23:02:38 -04:00
Alexei Chetroi
a69b1a359d ZHA Light debug logging. (#22776) 2019-04-05 17:06:59 -07:00
David F. Mulcahey
f004f440d3 make the custom polling actually request state (#22778) 2019-04-05 17:01:06 -07:00
Nate Clark
dbe53a3947 Fix konnected unique_id computation for switches (#22777) 2019-04-05 16:52:30 -07:00
Rohan Kapoor
a44966f483 Correctly load Mopar's config (#22771) 2019-04-05 16:52:29 -07:00
David F. Mulcahey
192ed90773 make the custom polling actually request state (#22778) 2019-04-05 16:50:20 -07:00
Alexei Chetroi
8dfbfae270 ZHA Light debug logging. (#22776) 2019-04-05 19:06:41 -04:00
Nate Clark
144632a81b Fix konnected unique_id computation for switches (#22777) 2019-04-06 00:22:57 +02:00
Robert Svensson
d1bf470899 deCONZ multiple gateways fixup (#22774)
* Initial PR was merged before a proper review was performed
* These fixes follow Martins review comments after merge
2019-04-05 22:21:06 +02:00
Per Osbäck
7a33dc5cec update core dependencies due to pywebpush update (#22767) 2019-04-05 12:22:24 -07:00
Robert Svensson
008b641c56 Axis - support stream (#22593)
* Add support for new stream component
2019-04-05 19:14:54 +02:00
teliov
b3e60df82a Add google hangouts manual authentication option (#22158)
* Added option to use manual authentication for google hangout component
See: https://hangups.readthedocs.io/en/latest/user_guide.html#logging-in for manual log in example

Bumped up version of hangups to 0.4.9

* Updated components/hangouts/strings.json and generated translation string by running script/translations_develop
Reduced verbosity of modifications to components/hangouts/config_flow.py

* Added option to use manual authentication for google hangout component
See: https://hangups.readthedocs.io/en/latest/user_guide.html#logging-in for manual log in example

Bumped up version of hangups to 0.4.9

* Updated components/hangouts/strings.json and generated translation string by running script/translations_develop
Reduced verbosity of modifications to components/hangouts/config_flow.py

* fixing missing rebase
2019-04-05 10:11:04 -07:00
Rohan Kapoor
879967bed2 Correctly load Mopar's config (#22771) 2019-04-05 18:15:35 +02:00
carstenschroeder
323dc5b78a Improve exception handling in ADS integration (#22627)
* add exception handling

* fix hound findings

* improve logging

* improve logging II

* fix try..except to large
2019-04-05 17:14:44 +02:00
Pascal Vizeli
c209236f47 Merge pull request #22755 from home-assistant/rc
0.91.1
2019-04-05 15:44:21 +02:00
zewelor
9eb32728f1 Fix yeelight recorder warning (#22756) 2019-04-05 13:33:10 +02:00
zewelor
5e7fdb479b Fix yeelight recorder warning (#22756) 2019-04-05 13:32:46 +02:00
Pascal Vizeli
9198047ad5 Cleanup cookie handling (#22757) 2019-04-05 13:31:17 +02:00
Pascal Vizeli
4b877dd96f Cleanup cookie handling (#22757) 2019-04-05 13:29:43 +02:00
Paulus Schoutsen
cd3f51f7b1 Bumped version to 0.91.1 2019-04-04 23:49:37 -07:00
Fredrik Erlandsson
e9d55bf1c0 fixes configuration flow #22706 (#22754) 2019-04-04 23:49:12 -07:00
Jason Hunter
5252c92670 use the input stream codec as the template for the output streams (#22747) 2019-04-04 23:49:12 -07:00
Chris Helming
dc185b994d Update Foscam stream for newer models (#22744)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models

* changing logic for success and return none

* Update Foscam stream for newer models

* change if to or
2019-04-04 23:49:11 -07:00
Aaron Bach
74a7d4117e Bump aioambient to 0.2.0 (#22736) 2019-04-04 23:49:10 -07:00
Aaron Bach
bab966fb29 Fix incorrect "Unavailable" Ambient sensors (#22734)
* Fix incorrect "Unavailable" Ambient sensors

* Removed unnecessary cast
2019-04-04 23:49:10 -07:00
Pascal Vizeli
79facb82c6 Fix chunk streaming (#22730)
* Fix chunk streaming

* Cleanup a print

* Better error handling

* Fix import order
2019-04-04 23:49:09 -07:00
Pascal Vizeli
ec07affe0d Fix ingress routing with / (#22728) 2019-04-04 23:49:08 -07:00
David F. Mulcahey
193b608ee0 fix device class lookup for binary sensors (#22724) 2019-04-04 23:49:08 -07:00
Pascal Vizeli
8eb93a8bea Change URL handling (#22713) 2019-04-04 23:49:07 -07:00
Fredrik Erlandsson
876b5fbe96 fixes configuration flow #22706 (#22754) 2019-04-04 23:48:41 -07:00
Pascal Vizeli
71e120ce97 Fix chunk streaming (#22730)
* Fix chunk streaming

* Cleanup a print

* Better error handling

* Fix import order
2019-04-04 23:41:13 -07:00
Chris Helming
82a1c0d0e8 Update Foscam stream for newer models (#22744)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models

* changing logic for success and return none

* Update Foscam stream for newer models

* change if to or
2019-04-04 23:40:47 -07:00
Jason Hunter
8c657d4254 use the input stream codec as the template for the output streams (#22747) 2019-04-04 23:40:22 -07:00
Jason Hunter
a75b151dfa fix flaky test (#22748) 2019-04-04 23:39:19 -07:00
Erik Montnemery
563e4fbfca Add deprecation warning to embedded broker (#22753) 2019-04-04 23:38:10 -07:00
Robbie Trencheny
8b77298908 More fallout from #22737 and b130c433c9 2019-04-04 21:57:34 -07:00
Rohan Kapoor
d15eedc0fb Generate requirements_* from manifests (#22718)
## Description:
Generate requirements_* from manifests (if present). If not, fallback to the current approach of reading `REQUIREMENTS` from the module attribute. I disabled exploring the children of the `homeassistant.components.*` packages since that will just add a dependency (from the manifest) due to each of the python files in the package. Just having one for the top level package should be sufficient.

**Related issue (if applicable):** relates to #22700 

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23


Co-authored-by: Jason Hu <awaregit@gmail.com>
2019-04-04 21:29:29 -07:00
Robbie Trencheny
6c5f0b7434 It doesnt count as a fail if you catch it within 2 minutes 2019-04-04 21:27:18 -07:00
Rohan Kapoor
be579b783a Update PR template requirements to point to the manifest (#22751)
## Description:
Update the PR template to point requirements to the new manifest requirements.

**Related issue (if applicable):** relates to #22700

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** https://github.com/home-assistant/developers.home-assistant/pull/214

## Example entry for `configuration.yaml` (if applicable):
```yaml

```

## Checklist:
  - [ ] The code change is tested and works locally.
  - [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [ ] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [ ] New files were added to `.coveragerc`.

If the code does not interact with devices:
  - [ ] Tests have been added to verify that the new code works.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-04-04 21:24:55 -07:00
Robbie Trencheny
b130c433c9 Update pywebpush version in manifest.json
Missed during #22737
2019-04-04 20:50:07 -07:00
Markus Jankowski
eadc1e037a add device class signal strength (#22738) 2019-04-04 21:37:59 -04:00
Wolfgang Malgadey
6996fec809 Fix tado turn on off (#22291)
* fix for turn on and off, with new pyTado

missing blank line

* removed, because can't push

* uploaded the file through github again
2019-04-04 17:52:06 -07:00
Robert Svensson
b50afec5f1 Support multiple deCONZ gateways (#22449)
* Store gateways inside a dict in deconz domain

* Make reachable events gateway specific

* Gateway shall always exist

* Adapt new device signalling to support multiple gateways

* Services follow gateway master

* Working on unload entry

* Make unload and master handover work
Improve tests for init

* Fix config flow

* Fix linting

* Clean up init tests

* Clean up hassio discovery to fit with the rest

* Store gateways inside a dict in deconz domain

* Make reachable events gateway specific

* Gateway shall always exist

* Adapt new device signalling to support multiple gateways

* Services follow gateway master

* Working on unload entry

* Make unload and master handover work
Improve tests for init

* Fix config flow

* Fix linting

* Clean up init tests

* Clean up hassio discovery to fit with the rest

* Add support for services to specify bridgeid
2019-04-04 17:48:24 -07:00
Per Osbäck
b9ec623ad9 Bump pywebpush to latest 1.9.2 (#22737) 2019-04-04 14:19:29 -07:00
Aaron Bach
96adbfdc36 Fix incorrect "Unavailable" Ambient sensors (#22734)
* Fix incorrect "Unavailable" Ambient sensors

* Removed unnecessary cast
2019-04-04 13:50:10 -06:00
Aaron Bach
0438dffe25 Bump aioambient to 0.2.0 (#22736) 2019-04-04 13:43:21 -06:00
Markus Ressel
07d739c14e Add N26 component (#22684)
* upgraded n26 dependency
removed card_id config parameter (unnecessary)
get_token is now a public method inside n26 dependency

* Add manifest.json
2019-04-04 10:18:54 -07:00
Pascal Vizeli
9bb88a6143 Fix ingress routing with / (#22728) 2019-04-04 17:43:18 +02:00
David F. Mulcahey
e29eb4fa23 fix device class lookup for binary sensors (#22724) 2019-04-04 09:06:54 -04:00
Eliran Turgeman
172ede217a Add 10 additional language options to DarkSky (#22719) 2019-04-04 14:23:31 +02:00
Martin Hjelmare
5d7c29dee2 Only post coverage comment if coverage changes (#22721) 2019-04-04 04:01:56 -07:00
Robbie Trencheny
754c4d205b Allow users to set encoding of mikrotik connection (#22715)
## Description:

Mikrotik does some stupid stuff with character encoding that can screw up the DHCP responses. See #15257 for more detail. 

**Related issue (if applicable):** fixes #15257

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-04-04 02:15:20 -07:00
Pascal Vizeli
beb6ddfa68 Change URL handling (#22713) 2019-04-04 11:10:44 +02:00
Paulus Schoutsen
d231d59896 Remove deprecated Insteon components (#22710) 2019-04-04 00:46:20 -07:00
Robbie Trencheny
704983a64f Fix hassio CODEOWNER to be the actual team name, hass-io 2019-04-04 00:34:34 -07:00
Robbie Trencheny
f9564400e8 Activate codeowners-mention via GitHub actions 2019-04-03 23:53:17 -07:00
Paulus Schoutsen
d5307c03d8 Generate codeowners based on manifests (#22705)
* Gen codeowners

* Update manifest_helper.py
2019-04-03 23:46:06 -07:00
Paulus Schoutsen
0c284161eb Validate manifests in CI (#22708)
* Validate manifests

* Fix mode

* Activate venv

* Validate manifests after installing HA which includes voluptuous
2019-04-03 23:45:09 -07:00
Rohan Kapoor
afac09932f Remove all config deprecations invalidated in 0.91 (#22704)
* Remove all config deprecations invalidated in 0.91

* Fix lint
2019-04-03 23:31:55 -07:00
Markus Jankowski
8e39939b7e Add device_class_power to sensor (#22691)
* Add device_class_power to sensor

* Fix comment
2019-04-03 21:52:23 -07:00
Kyle Niewiada
a5a926bcc6 Raise ConfigEntryNotReady for MQTT connection exception (#22540)
* Raise ConfigEntryNotReady for connection exception

Raise ConfigEntryNotReady for the connection exception like if the MQTT Server container/device is being restarted or was unavailable on boot.

* Add new exception

* grammar fix

* Possibly resolve hound comments

* raise `ConfigEntryNotReady` for mqtt connection error

* revert exceptions.py

* Update exceptions.py

* modify test to handle exception

* use constants to control exception scope

* Raise ConfigEntryNotReady for connection exception

Raise ConfigEntryNotReady for the connection exception like if the MQTT Server container/device is being restarted or was unavailable on boot.

* Add new exception

* Add new exception

* grammar fix

* Possibly resolve hound comments

* raise `ConfigEntryNotReady` for mqtt connection error

* revert exceptions.py

* Update exceptions.py

* modify test to handle exception

* use constants to control exception scope

* revert test change as it's not the same thing

* Update test_init.py

* Add test for MQTT OSError

* revert file changes from a bad rebase

* Rewrite test with valid syntax

* rewrite test to be less ambiguous

* add empty line

* add back 'axis'

* Remove empty line

* Update tests and undo merge from earlier

* correctly restore test for no connect broker

* fix test mock correctly

* line was too long. hit enter.
2019-04-03 21:51:01 -07:00
Robbie Trencheny
d81a627739 Add a .codecov.yml to control coverage statuses and enable notifications (#22707)
* Add a .codecov.yml to control coverage statuses and enable notifications

* Comment about Slack/Discord notification
2019-04-03 21:44:15 -07:00
Paulus Schoutsen
cfe4cf30ad Add manifests (#22699)
* Add manifests

* Update auto name

* Update codeowners

* Add requirements from platforms

* Minor cleanup

* Incorporate changes from awarecan PR
2019-04-03 21:14:45 -07:00
Jason Hu
6aac49de7e Remove aws_* notify platforms (#22698) 2019-04-03 20:14:02 -07:00
ehendrix23
a85bcce857 Fix connection loss issues for Harmony (#22687)
* Increase aioharmony version to 0.1.11

Update aioharmony version to 0.1.11, this new update contains fixes for websocket connection losses.

* Update requirements_all
2019-04-03 19:29:49 -05:00
Paulus Schoutsen
360caa3b1f Merge pull request #22688 from home-assistant/rc
0.91.0
2019-04-03 14:39:21 -07:00
Erik Montnemery
98644135fa Update light/services.yaml (#22662) 2019-04-03 20:30:03 +02:00
Paulus Schoutsen
63d8dd9f7a Bumped version to 0.91.0 2019-04-03 11:27:57 -07:00
Paulus Schoutsen
685de23a4e Run PyLint under Python 3.5 (#22642)
* Run PyLint under Python 3.5

* Remove -q from pip install to debug

* Upgrade setuptools before install

* Use correct cache key for pylint
2019-04-03 11:27:50 -07:00
Jason Hu
b30c140648 Require static-check success first for rest of workflow (#22635)
* Require static-check success first

* Update config.yml
2019-04-03 11:27:49 -07:00
Jason Hu
2c10563205 Config CircleCI workflow (#22590)
* Add mypyrc to control typing check, add mypy to circle

* Add translation upload circlci job
2019-04-03 11:27:49 -07:00
Jason Hu
5dd444fcd8 Set up Circleci workflow (#22519)
* Set up Circleci workflow

* Update python tag

* Add pre-test job to cache the requirements

* Upgrade pip itself

* Use 3.7 for lint

* Parallelize pylint

* Tweak run gen_requirements_all

* tweak cache key
2019-04-03 11:27:48 -07:00
Jason Hu
273007fa19 Fix Circleci config (#22509)
* Add libav depends on circleci

* tweak circleci config
2019-04-03 11:27:48 -07:00
Jason Hu
2e8c690033 A very basic Circleci setup (#22503)
* Add circleci support

* Add buildpack-deps

* Install libudev-dev

* sudo

* always run test

* Add test report

* no sugar

* quite pytest

* better junit test result

* Add $CODE_COVERAGE env var
2019-04-03 11:27:47 -07:00
Pascal Vizeli
836aab283f Fix ffmpeg default extra options (#22682) 2019-04-03 11:25:38 -07:00
Paulus Schoutsen
7cf92c2210 Deal with cover assumed state (#22673)
* Deal with cover assumed state

* Add docs
2019-04-03 11:25:38 -07:00
Jason Hu
9eb4f89da4 Fix trusted networks auth provider warning message (#22671)
* Fix trusted networks auth provider warning message

* Update auth.py
2019-04-03 11:25:37 -07:00
Diogo Gomes
167d8cbaba Fix #22648 - Utility_meter would try to cancel a non existing task (#22669)
* don't cancel tariff that are paused

* test tariffs
2019-04-03 11:25:36 -07:00
mvn23
e90d980e67 Don't use room setpoint override in climate.opentherm_gw (#22656)
* Dont use DATA_ROOM_SETPOINT_OVRD in climate.opentherm_gw as it is unreliable with some thermostats.

* Show new target temperature immediately until the backend notices a change

* Only update target temp on the gateway if the value differs from the current target_temperature.
2019-04-03 11:25:36 -07:00
Pascal Vizeli
81a659be0d Hass.io discovery flow deconz (#22623)
* Add Hass.io deCONZ discovery flow

* add bridge ID

* fix attribute

* fix strings

* Address comments

* Add test

* Add only instance / changed maybe later
2019-04-03 11:25:35 -07:00
Robbie Trencheny
51c7cbc6b9 Add mobile_app notify platform (#22580)
* Add mobile_app notify platform

* Requested changes

* Fix incorrect param for status code

* Move push_registrations to notify platform file

* Trim down registration information sent in push

* quotes

* Use async version of load_platform

* Add warning for duplicate device names

* Switch to async_get_service

* add mobile_app.notify test

* Update tests/components/mobile_app/test_notify.py

* Update tests/components/mobile_app/test_notify.py
2019-04-03 11:25:34 -07:00
Paulus Schoutsen
14da2fd8c9 Google Assistant: Add support for open/close binary sensors (#22674)
* Google Assistant: Add support for binary sensors

* Update test
2019-04-03 10:20:56 -07:00
Martin Hjelmare
3872ac9bf9 Fix citybikes (#22683)
* Move asyncio condition to instance from class, to be able to pass in
  lopp.
* Avoid not needed sife effects in init methods.
* Clean up.
2019-04-03 09:05:18 -07:00
Jason Hu
b4fc1d77ea Fix trend binary sensor and tests (#22686) 2019-04-03 09:04:30 -07:00
Tobias Sauerwein
048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Alexei Chetroi
625c8e0cee Shutdown ZHAGateway on hass closing. (#22646)
* Shutdown ZHAGateway on hass stop.
* Cleanup ZHA event leftovers.
2019-04-03 09:40:48 -04:00
Robbie Trencheny
b797b1513a Add mobile_app notify platform (#22580)
* Add mobile_app notify platform

* Requested changes

* Fix incorrect param for status code

* Move push_registrations to notify platform file

* Trim down registration information sent in push

* quotes

* Use async version of load_platform

* Add warning for duplicate device names

* Switch to async_get_service

* add mobile_app.notify test

* Update tests/components/mobile_app/test_notify.py

* Update tests/components/mobile_app/test_notify.py
2019-04-03 08:21:25 -04:00
Paulus Schoutsen
b1cca25299 Deal with cover assumed state (#22673)
* Deal with cover assumed state

* Add docs
2019-04-03 13:53:44 +02:00
Pascal Vizeli
7066fb0d10 Fix ffmpeg default extra options (#22682) 2019-04-03 13:46:41 +02:00
Pascal Vizeli
58a89640bb Update uvloop to 0.12.2 (#22681) 2019-04-03 12:20:05 +02:00
Diogo Gomes
7c5846aed2 Fix #22648 - Utility_meter would try to cancel a non existing task (#22669)
* don't cancel tariff that are paused

* test tariffs
2019-04-03 08:49:53 +02:00
Finbarr Brady
a7d49e40c0 Rebrand Cisco Spark notify to be Cisco Webex Teams (#21938)
* Rebrand Cisco Spark notify to be Cisco Webex Teams

* Remove property from class

* Switch to use html for api

* Update notify.py

* Rename CONF_ROOMID to CONF_ROOM_ID

* updated

* Fix lint errors

* Update notify.py

* Update notify.py

* Also validate room  ID

* Update notify.py

* Update .coveragerc

* Update notify.py
2019-04-02 23:25:02 -07:00
Jason Hu
6a411710df Fix trusted networks auth provider warning message (#22671)
* Fix trusted networks auth provider warning message

* Update auth.py
2019-04-02 21:23:59 -07:00
Johann Kellerman
f2941522ca Person tests - split from #21703 (#22663) 2019-04-03 05:35:33 +02:00
emontnemery
e736521e9f Fix regression from PR #22396 (#22661)
* Fix regression from PR #22396

* Fix test
2019-04-02 19:58:28 -07:00
emontnemery
4f2435103b Cast: Fix next/previous track (#22634)
* Fix next/previous track

* Bump pychromecast

* Update test, fixup
2019-04-02 19:58:02 -07:00
Johann Kellerman
3453d67cfe Person schema for merge_packages #21307 (#21703)
* Person schema for merge_packages #21307

* empty list

* skip empty persons

* hound

* test schema

* ensure_none

* remove any test changes

* remove_falsy validator

* nice!

* coretests
2019-04-02 19:43:06 -07:00
Pascal Vizeli
5613e8bb60 Hass.io discovery flow deconz (#22623)
* Add Hass.io deCONZ discovery flow

* add bridge ID

* fix attribute

* fix strings

* Address comments

* Add test

* Add only instance / changed maybe later
2019-04-02 19:23:33 -07:00
mvn23
22d93a74a4 Don't use room setpoint override in climate.opentherm_gw (#22656)
* Dont use DATA_ROOM_SETPOINT_OVRD in climate.opentherm_gw as it is unreliable with some thermostats.

* Show new target temperature immediately until the backend notices a change

* Only update target temp on the gateway if the value differs from the current target_temperature.
2019-04-02 13:57:38 -07:00
Andrew Sayre
5651db4b5c Add discovery support to HEOS component (#22652)
* Add discovery entry point

* Fix test

* Correct test call method

* Update netdisco to 2.6.0
2019-04-02 15:22:49 -05:00
Paulus Schoutsen
3357596215 Bumped version to 0.91.0b5 2019-04-02 11:42:01 -07:00
Jc2k
31ac965b16 Fix racy homekit_controller platform setup caused by #22368 (#22655) 2019-04-02 11:41:56 -07:00
Chris Helming
e3ca1e6203 Return 0 for failed Foscam streams (#22651)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models

* changing logic for success and return none
2019-04-02 11:41:55 -07:00
Pascal Vizeli
6d741d68b7 Support GET params for websocket ingress path (#22638) 2019-04-02 11:41:55 -07:00
Daniel Høyer Iversen
a5c7f131ee Handle disonnect bug in Tibber library (#22629) 2019-04-02 11:41:54 -07:00
Paulus Schoutsen
c7576999ca Disable Z-Wave autoheal (#22628) 2019-04-02 11:41:53 -07:00
Pascal Vizeli
56c75d7706 Update face_recognition to 1.2.3 (#22622) 2019-04-02 11:41:53 -07:00
Chris Helming
e0b4e88544 Update Foscam component to support stream source (#22568)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models
2019-04-02 11:41:52 -07:00
Pascal Vizeli
6f345c55c9 Hass.io ingress (#22505)
* Fix API stream of snapshot / Add ingress

* fix lint

* Fix stream handling

* Cleanup api handling

* fix typing

* Set proxy header

* Use header constant

* Enable the ingress setup

* fix lint

* Fix name

* Fix tests

* fix lint

* forward params

* Add tests for ingress

* Cleanup cookie handling with aiohttp 3.5

* Add more tests

* Fix tests

* Fix lint

* Fix header handling for steam

* forward header too

* fix lint

* fix flake
2019-04-02 11:41:51 -07:00
Jason Hu
5cb69cf163 Add trusted networks deprecating warning (#22487)
* Add trusted networks deprecating warning

* Update auth.py

* Update auth.py

* Update auth.py

* Update auth.py

* Tweak
2019-04-02 11:41:51 -07:00
Alex Bahm
471afb4702 Add color support to emulated hue (#19590)
* [Hue API] Add color support

Adds color support to the hue api (specifically hue/saturation). Switched from using a tuple to convey state internally to using a dict to make adding new fields easier.

* [Hue API] Add unit test for color support
2019-04-02 11:25:58 -07:00
OleksandrBerchenko
8a86a79040 Add missing properties and scenes support to Osram Lightify (#22597)
* Rewrite Osram Lightify component

* Update python-lightify version to 1.0.7.2

* Remove unneeded code

* 1. Remove changes in light/__init__.py, 2. Set properties to None by default

* Fix typo

* Implement missing features (including scenes)

* Make input parameters to setup_platform standardized
2019-04-02 11:14:46 -07:00
Robert Svensson
8a0b210f87 Axis discovery updates host address (#22632)
* Discovery can update host on existing entries

* Add support in device to update host on entry update

* Fix tests and listener

* Fix hound comment

* Fix failing tests from cleanup
2019-04-02 11:13:11 -07:00
Markus Jankowski
6c14e7afa7 Add battery sensor to Homematic IP (#22630) 2019-04-02 10:29:48 -07:00
Chris Helming
429e2cdde8 Return 0 for failed Foscam streams (#22651)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models

* changing logic for success and return none
2019-04-02 09:59:38 -07:00
Jason Hu
d6e2862115 Ignore code coverages for component without test (#22653) 2019-04-02 09:51:44 -07:00
Paulus Schoutsen
e00ae35e07 Admin service to automatically add empty schema (#22637)
* Admin service to automatically add empty schema

* Lint
2019-04-02 09:34:11 -07:00
cgtobi
b8b3f4e88f Fix pytest durations parameter (#22658)
* Fix durations parameter

* Update config.yml
2019-04-02 09:31:29 -07:00
Alexei Chetroi
0427154963 Don't force updates on ZHA Electrical Measurement sensor. (#22647) 2019-04-02 08:28:55 -07:00
David Bonnes
3bd37d6a65 Improve evohome exception handling and fix bugs (#22140)
* Use latest client library, evohomeclient v0.3.1

* Fix issue #22097: Failed to call service climate/turn_on...

* BUGFIX: handle case where a Zone doesn't have a temperature

* BUGFIX: missing exception handler, and inappropriate delint hints

* Improve exception handling, and also better messages

* improve code (REDACT secrets); remove TODOs

* minor refactor - improve error message

* more refactoring - improve error message

* remove TODOs

* update to latest evohomeclient library

* Use latest client library, evohomeclient v0.3.1

* Fix issue #22097: Failed to call service climate/turn_on...

* BUGFIX: handle case where a Zone doesn't have a temperature

* BUGFIX: missing exception handler, and inappropriate delint hints

* Improve exception handling, and also better messages

* improve code (REDACT secrets); remove TODOs

* minor refactor - improve error message

* more refactoring - improve error message

* remove TODOs

* update to latest evohomeclient library

* fix requests for houndci-bot

* Tidy up requests exception handling

* Correct lint error

* update to latest client library

* minor de-lint

* more cleanup of exceptions, messages

* refactored for new exception

* fix error in requirements*_all.txt

* de-lint

* delint unused import

* import 3rd-party library only inside methods

* change honeywell tests

* delint, fix typo

* we dont log usernames, passwords, etc.

* de-lint
2019-04-02 15:11:26 +02:00
Jc2k
16e0953f26 Fix racy homekit_controller platform setup caused by #22368 (#22655) 2019-04-02 09:57:58 +02:00
Paulus Schoutsen
48189dd152 Run PyLint under Python 3.5 (#22642)
* Run PyLint under Python 3.5

* Remove -q from pip install to debug

* Upgrade setuptools before install

* Use correct cache key for pylint
2019-04-01 21:51:43 -07:00
Johann Kellerman
2578c8525b Qwikswitch fix listen loop (#22600)
* Qwikswitch fix listen loop
* 0.93 fix qwikcord upstream
2019-04-02 05:57:25 +02:00
Jason Hu
7646dc00e0 Add codecov (#22649) 2019-04-01 20:31:05 -07:00
Jason Hu
39eaa7fc8d Add trusted networks deprecating warning (#22487)
* Add trusted networks deprecating warning

* Update auth.py

* Update auth.py

* Update auth.py

* Update auth.py

* Tweak
2019-04-01 17:43:29 -07:00
Jason Hu
1e26151069 Require static-check success first for rest of workflow (#22635)
* Require static-check success first

* Update config.yml
2019-04-01 17:42:04 -07:00
Pascal Vizeli
e708032669 Support GET params for websocket ingress path (#22638) 2019-04-01 17:41:08 -07:00
Malte Franken
a7e613616c change library to georss_generic_client (#22615) 2019-04-01 19:27:58 -04:00
Phil Bruckner
82296aeb71 Amcrest: Add on/off support & attributes. Bump amcrest to 1.3.0 (#22418)
* Amcrest: Add on/off support & attributes to camera entity. Bump amcrest package to 1.3.0.

Add support for turn_on & turn_off services.

Add implementation of is_recording method, as well as brand, model, hardware_version, machine_name, serial_number, software_build and software_version attributes.

Bump amcrest package to 1.3.0 required for above changes and also handles errors in storage commands which resolves #19982.

* Update per review

Rebase to upstream/dev.

Remove video_enabled property and setter and replace with _enable_video_stream
method.

Remove static attributes from camera and sensors.
2019-04-01 17:36:29 -05:00
etheralm
e78709c5f5 Add support for Dyson Purecool 2018 Air Purifiers models TP04 and DP04 (#22215)
* initial commit

initial commit

rewrite tests

fix merge issue with fan component

fix merge issue with fan component

* correct line length

* change to sync_setup_component for tests

* rename services and move services.yaml

* move hepa and carbon filter state from sensor to fan

* add test for duplicate entities

* fix method call tests

* fix docstring
2019-04-01 19:57:11 +02:00
René-Marc Simard
1ce622469d Fix GTFS variable type mismatch (#22624) 2019-04-01 10:49:53 -07:00
Anna Prosvetova
ab2ac60d12 Fix xiaomi vacuum resume functionality (#22626) 2019-04-01 10:44:46 -07:00
Daniel Høyer Iversen
2e02efed10 Handle disonnect bug in Tibber library (#22629) 2019-04-01 10:33:38 -07:00
Paulus Schoutsen
bbc4775eab Disable Z-Wave autoheal (#22628) 2019-04-01 10:20:13 -07:00
VDRainer
431cc63aaf Trend binary sensor check for state unavailable (#22621)
* Trend binary sensor check for state unavailable

Fixes: https://github.com/home-assistant/home-assistant/issues/20210

* Fix pylint
2019-04-01 10:03:18 -07:00
Fredrik Erlandsson
0056fcf904 Make platform setup a coroutine (#22620)
* make setup_platform a coroutine

* Update homeassistant/components/tellduslive/sensor.py

Co-Authored-By: fredrike <fredrik.e@gmail.com>
2019-04-01 10:01:31 -07:00
Pascal Vizeli
1e96d69688 Update face_recognition to 1.2.3 (#22622) 2019-04-01 10:00:25 -07:00
Andrew Sayre
9f2c5b7231 Add source selection to Heos component (#22592)
* Add select source support

* Review feedback changes

* Removed unused import

* Ignore 'umused' import used in typing

* Only include trace back on useful errors

* Remove return from play_source
2019-04-01 11:58:52 -05:00
Pascal Vizeli
a5b03541e9 Delete .travis.yml 2019-04-01 17:16:56 +02:00
Jason Hu
de4d1f2c19 Config CircleCI workflow (#22590)
* Add mypyrc to control typing check, add mypy to circle

* Add translation upload circlci job
2019-04-01 07:12:59 -07:00
Pascal Vizeli
6829ecad9d Hass.io ingress (#22505)
* Fix API stream of snapshot / Add ingress

* fix lint

* Fix stream handling

* Cleanup api handling

* fix typing

* Set proxy header

* Use header constant

* Enable the ingress setup

* fix lint

* Fix name

* Fix tests

* fix lint

* forward params

* Add tests for ingress

* Cleanup cookie handling with aiohttp 3.5

* Add more tests

* Fix tests

* Fix lint

* Fix header handling for steam

* forward header too

* fix lint

* fix flake
2019-04-01 14:16:16 +02:00
Paulus Schoutsen
42e3e878df Cloudhooks for webhook config flows (#22611) 2019-04-01 14:07:12 +02:00
Paulus Schoutsen
c96804954c Only allow admins to enable remote connection (#22609)
* Only allow admins to enable remote connection

* Protect WS API

* Lint
2019-04-01 10:22:51 +02:00
Anders Melchiorsen
282fd225c9 Add netgear_lte connection sensors (#22558) 2019-03-31 23:47:29 -07:00
N1nja98
a61181b10c Fixed brightness reducing after each light change (#22606)
self._brightness max is 255 and hsv brightness max is 100. Assigning 255 based brightness value directly with 100 based hsv reduces brightness eventually to zero.
2019-03-31 23:27:47 -07:00
Robbie Trencheny
7bd8c0d39a Add new mobile_app webhook command: get_zones (#22604)
## Description:

Adds a new `mobile_app` webhook command, `get_zones`, which just returns all zones.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-31 21:30:45 -07:00
Paulus Schoutsen
fbb28c401e Bumped version to 0.91.0b4 2019-03-31 20:30:30 -07:00
carstenschroeder
734a67ede0 Refactor of ADS integration and introduce ADSEntity (#22583)
* Prevent toogle to false at restart

* change to asyncio.run_coroutine_threadsafe

* refactor ADS platforms; introduce AdsEntity

* fix hound findings

* some formatting

* remove redundant def.

* fix useless super delegation

* fix inconsistent ADS data type for brightness

* fix requested changes

* fix comment
2019-03-31 20:28:43 -07:00
Paulus Schoutsen
0e42cb64d6 Add stream to the default config (#22602) 2019-03-31 20:02:01 -07:00
drjared88
2e61ead4fd Update ONVIF component to SUPPORT_STREAM (#22569)
* Update Onvif component to SUPPORT_STREAM

* Update camera.py

* Update camera.py

* Update camera.py

Remove extra spaces.

* lookup URL when camera is added to hass and add extra guards
2019-03-31 20:02:00 -07:00
Jason Hu
de16059365 Fix name conflict in tests (#22556)
* Fix name conflict in tests

* Lint

* Lint
2019-03-31 20:01:59 -07:00
drjared88
a71fcfb6e5 Update Amcrest component to SUPPORT_STREAM (#22553)
* Update camera.py

Update Amcrest component to SUPPORT_STREAM to allow streaming in the UI and Google Assistant.

* Update camera.py
2019-03-31 20:01:59 -07:00
giefca
8af70d5d19 Google assistant: add blinds trait for covers (#22336)
* Update const.py

* Update smart_home.py

* Update trait.py

* Update test_trait.py

* Update smart_home.py

* Update test_trait.py

* Update trait.py

* Update trait.py

* Update test_trait.py

* Update test_trait.py

* Update __init__.py

* Update test_trait.py

* Change email

* Trying to correct CLA

* Update __init__.py

* Update trait.py

* Update trait.py

* Update trait.py

* Update trait.py

* Update __init__.py

* Update test_trait.py

* Update test_google_assistant.py

* Update trait.py

* Update trait.py

* Update test_trait.py

* Update test_trait.py
2019-03-31 20:01:59 -07:00
Paulus Schoutsen
ec9a58442b Updated frontend to 20190331.0 2019-03-31 20:01:35 -07:00
Paulus Schoutsen
804f1d1cc8 Update translations 2019-03-31 20:01:23 -07:00
Paulus Schoutsen
9a4b0cfb9b Updated frontend to 20190331.0 2019-03-31 19:52:44 -07:00
Aaron Bach
3d8efd4200 Add permission checking to all RainMachine services (#22399)
* Add permission checking to all RainMachine services

* Linting

* Some initial work

* Owner comments

* Test in place (I think)

* Linting

* Update conftest.py
2019-03-31 19:32:55 -07:00
Paulus Schoutsen
50a0504e07 Add stream to the default config (#22602) 2019-03-31 17:14:19 -07:00
drjared88
e085383d2d Update ONVIF component to SUPPORT_STREAM (#22569)
* Update Onvif component to SUPPORT_STREAM

* Update camera.py

* Update camera.py

* Update camera.py

Remove extra spaces.

* lookup URL when camera is added to hass and add extra guards
2019-03-31 15:12:55 -07:00
René-Marc Simard
755571abe3 Fix gtfs typing and logger issues (#22572)
## Description:
Some code cleanup requests where raised in the [latest merged GTFS commit](9153e3b671). This new PR aims to address them, including:
- Clear all typing issues.
- Respect logger levels and format.
- Simplify some non-pythonic lines.

This sensor now passes `mypy` testing, but does so by ignoring two lines with `# type: ignore`.

**Related issue (if applicable):** fixes issues raised by @MartinHjelmare in #20966

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-31 14:21:45 -07:00
Sander Cornelissen
7d7b931163 Retrying connecting Influxdb at setup (#22567)
* Also retry Influxdb at setup()

* Use event.call_later() for retry setup Influxdb

* Fix max line length in setup() in Influxdb

* Add extra space before comment

* Fix sec -> seconds and add return True
2019-03-31 16:00:48 -04:00
Markus Jankowski
5abfc84382 Clean up homematicip cloud (#22589)
* Code Cleanup

- removed unused constants
- more icons on binary_sensor groups
- alligned  code for device_state_attributes
- fixed temperature unit origin for weather

* removed icons
2019-03-31 21:18:45 +02:00
OleksandrBerchenko
842a36dc9e Rewrite Osram Lightify component (#22184)
* Rewrite Osram Lightify component

* Update python-lightify version to 1.0.7.2

* Remove unneeded code

* 1. Remove changes in light/__init__.py, 2. Set properties to None by default

* Fix typo
2019-03-31 21:02:45 +02:00
Anders Melchiorsen
1b0b5b4b8c Fix lightwave config validation (#22576) 2019-03-31 09:19:39 -05:00
OleksandrBerchenko
800b1c7fe6 Fix typo in light/__init__.py (#22581) 2019-03-31 13:43:54 +02:00
Jason Hu
388d614e30 Ignore flaky test (#22563) 2019-03-30 21:10:32 -07:00
emontnemery
4d1633807c Turn light off if brightness is 0 (#22400)
* Turn light off if brightness is 0

* Lint

* Review comments

* Lint

* Fixup, add tests

* Fix trådfri light + test
2019-03-30 21:04:32 -07:00
Chris Helming
f6e9dd4832 Update Foscam component to support stream source (#22568)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models
2019-03-30 21:01:58 -07:00
emontnemery
54777a81bc Forward media control to playing group (#22566)
* Forward media control to playing group

* Fix forwarding control to dynamic group

* Fix, add tests
2019-03-30 20:07:01 -07:00
Pascal Vizeli
71ecaa4385 Delete main.workflow 2019-03-30 21:59:15 +01:00
Paulus Schoutsen
e70931da67 Delete azure-pipelines.yml 2019-03-30 12:30:35 -07:00
Greg Dowling
9bf0f60784 Bump pyloopenergy library to 0.1.2 (#22561) 2019-03-30 12:52:54 -05:00
Klaudiusz Staniek
2eafa5f81a Ampio Smog Air Quality Sensor (#21152)
* Initial commit for Ampio Smog Air Quality Sensor

* coveragerc and requirements_all update

* Lint fixed

* Moved to vendor folder

* Updated according to review

* Docs string fix

* Docstring fix

* Docstring fix

* Requirements fixed

* Lint fix

* .coveragerc updated
2019-03-30 18:49:59 +01:00
carstenschroeder
34324afbde Prevent toogle to false at restart of ADS platforms (#22522)
* Prevent toogle to false at restart

* change to asyncio.run_coroutine_threadsafe
2019-03-30 18:47:39 +01:00
emontnemery
2e375aa802 Improve handling of audio groups (#22396)
* Improve handling of audio groups

* Review comments

* Fix tests

* Add tests

* Review comment

* Bump pychromecast
2019-03-30 10:19:18 -07:00
Jason Hu
64306922b1 Fix name conflict in tests (#22556)
* Fix name conflict in tests

* Lint

* Lint
2019-03-30 08:30:21 -07:00
Andrew Sayre
ecba87179f Add Heos config flow (#22554)
* Add UI initiated config flow

* Fix alpha order
2019-03-30 08:52:17 -05:00
Marco Orovecchia
b6ac964df3 Added support for transitions for nanoleaf light (#22192)
* Added transition support for nanoleaf

* Formatting for comments

* Inline comment instead of additional line

* Set color_temp before starting transition
2019-03-30 12:08:30 +01:00
Jc2k
906f0113ad Add more HomeKit device enumeration tests (#22194)
* Test that Aqara Gateway, Ecobee 3 and Lennox E30 is correctly enumerated

* Move json to fixtures directory

* Move IO to executor
2019-03-30 11:21:11 +01:00
Anders Melchiorsen
1a39fb4de7 Add table with netgear_lte sensor units (#22508) 2019-03-30 10:09:36 +01:00
Kevin Cooper
4b9e3258dc Add command_template and value_template for MQTT alarm (#21438)
* Option to send pin code with the MQTT payload for MQTT alarm

* publish code via json

Add publish code via json
add code_disarm_required

* publish code via json

Add publish code via json
add code_disarm_required

* implemented command_template

* Fix issue with night arm and add template test

* implemented value_template for mqtt alarm

* Fixed merge errors

* Requested changes

* Resolve lint errors

* Resolve hound issues

* Fix test formatting
2019-03-30 07:36:10 +01:00
Andrew Sayre
1bfe86b30d Change HEOS component library and add basic config flow (#22517)
* Update heos lib

* Update requirements files

* Removed unecessary mock_coro usage

* Remove assert_called_once usage

* Updates from review feedback

* Remove extra param to error format
2019-03-29 21:10:00 -07:00
drjared88
fe8e51e2e9 Update Amcrest component to SUPPORT_STREAM (#22553)
* Update camera.py

Update Amcrest component to SUPPORT_STREAM to allow streaming in the UI and Google Assistant.

* Update camera.py
2019-03-29 20:53:01 -07:00
giefca
b04fd08cea Google assistant: add blinds trait for covers (#22336)
* Update const.py

* Update smart_home.py

* Update trait.py

* Update test_trait.py

* Update smart_home.py

* Update test_trait.py

* Update trait.py

* Update trait.py

* Update test_trait.py

* Update test_trait.py

* Update __init__.py

* Update test_trait.py

* Change email

* Trying to correct CLA

* Update __init__.py

* Update trait.py

* Update trait.py

* Update trait.py

* Update trait.py

* Update __init__.py

* Update test_trait.py

* Update test_google_assistant.py

* Update trait.py

* Update trait.py

* Update test_trait.py

* Update test_trait.py
2019-03-29 20:51:47 -07:00
Paulus Schoutsen
95a7077b41 Move core services.yaml file to Home Assistant integration (#22489)
* Move services.yaml to correct dir

* Remove special case for HA servicesgs
2019-03-29 20:48:45 -07:00
Julien Roy
8e975395be upgrade pylinky to 0.3.3 (#22544) 2019-03-29 19:22:28 -07:00
Paulus Schoutsen
b1a6539290 Bumped version to 0.91.0b3 2019-03-29 17:05:40 -07:00
Paulus Schoutsen
3ad4419cb6 Fix platform warnings (#22551) 2019-03-29 17:05:30 -07:00
Paulus Schoutsen
f9f100b575 Add support for streaming to ffmpeg (#22549) 2019-03-29 17:05:29 -07:00
Paulus Schoutsen
cc886821bc Fix platform warnings (#22551) 2019-03-29 17:04:59 -07:00
Paulus Schoutsen
c05bff7d17 Add support for streaming to ffmpeg (#22549) 2019-03-29 17:03:02 -07:00
Paulus Schoutsen
65c47824a0 Updated frontend to 20190329.0 2019-03-29 16:47:27 -07:00
Paulus Schoutsen
fbb9097f6c Updated frontend to 20190329.0 2019-03-29 16:46:15 -07:00
Jason Hu
e81e5ea796 Set up Circleci workflow (#22519)
* Set up Circleci workflow

* Update python tag

* Add pre-test job to cache the requirements

* Upgrade pip itself

* Use 3.7 for lint

* Parallelize pylint

* Tweak run gen_requirements_all

* tweak cache key
2019-03-29 16:37:45 -07:00
Paulus Schoutsen
c4a4af7c29 Bumped version to 0.91.0b2 2019-03-29 14:07:22 -07:00
damarco
24095c0d7b Bump zigpy (#22545) 2019-03-29 14:07:18 -07:00
Steven Looman
ae18705c45 Upgrade to async_upnp_client==0.14.7 (#22543) 2019-03-29 14:07:17 -07:00
Jason Hu
ab642ca4eb Fix tts Great Migration issue (#22539) 2019-03-29 14:07:16 -07:00
David F. Mulcahey
b7bc520a0e clean up channel configuration (#22534) 2019-03-29 14:07:16 -07:00
ktnrg45
53595e76d8 PS4 bump to 0.5.2 (#22523)
* Bump pyps4 to 0.5.2

* Bump pyps4 to 0.5.2

* Bump pyps4 to 0.5.2
2019-03-29 14:07:15 -07:00
David F. Mulcahey
173ef7cac5 Do not use zha default light polling (#22513)
* don't use default light polling

* review comment
2019-03-29 14:07:15 -07:00
Jason Hu
9f72764cff Fix lint on dev (#22512)
## Description:

Fix a lint issue in credstash script.


**Related issue (if applicable):** fixes #<home-assistant issue number goes here>

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

## Example entry for `configuration.yaml` (if applicable):
```yaml

```

## Checklist:
  - [ ] The code change is tested and works locally.
  - [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [ ] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [ ] New files were added to `.coveragerc`.

If the code does not interact with devices:
  - [ ] Tests have been added to verify that the new code works.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-29 14:07:14 -07:00
Jason Hu
77f7a53d9f Remove botocore dependency from credstash script (#22511)
* Remove botocore dependency from credstash script

* Update requirements_all.txt

* Update pylintrc

* Update credstash.py
2019-03-29 14:07:13 -07:00
zewelor
fae8265a37 Fixes for yeelight availbility state (#22502) 2019-03-29 14:07:13 -07:00
mvn23
a95fb809a5 Update pyotgw to 0.4b3 (#22496) 2019-03-29 14:07:12 -07:00
Jason Hu
21917f4dc4 Fix dev branch (#22493) 2019-03-29 14:07:12 -07:00
Sebastian Muszynski
9aa5b904c6 Fix regression of the xiaomi_aqara config validation (#22435)
* Fix regression of the xiaomi_aqara config validation

* Make the key optional again

* Add base schema

* Remove the GW_MAC default
2019-03-29 14:07:11 -07:00
damarco
c0ce86fa8e Bump zigpy (#22545) 2019-03-29 14:01:51 -07:00
Steven Looman
613c356c5f Upgrade to async_upnp_client==0.14.7 (#22543) 2019-03-29 13:41:50 -07:00
Sebastian Muszynski
f46a8378b0 Fix regression of the xiaomi_aqara config validation (#22435)
* Fix regression of the xiaomi_aqara config validation

* Make the key optional again

* Add base schema

* Remove the GW_MAC default
2019-03-29 13:41:13 -07:00
David F. Mulcahey
6401920019 clean up channel configuration (#22534) 2019-03-29 16:41:04 -04:00
ktnrg45
a07919ced2 PS4 bump to 0.5.2 (#22523)
* Bump pyps4 to 0.5.2

* Bump pyps4 to 0.5.2

* Bump pyps4 to 0.5.2
2019-03-29 12:10:28 -07:00
Yaroslav
daf6b01b98 Ring camera improvements (#22526)
* Ring camera improvements

Expose last_video_id attribute.
Fix missing last_video_url
Only update last_video_id when video is ready

* Fix formatting
2019-03-29 12:10:00 -07:00
Jason Hu
c31ab7a175 Fix tts Great Migration issue (#22539) 2019-03-29 11:45:02 -07:00
zewelor
4e78d895d9 Fixes for yeelight availbility state (#22502) 2019-03-29 18:43:29 +01:00
Paulus Schoutsen
ec076c7c10 Azure Pipelines: No Python 3.5.3 available, use any 3.5 version [skip ci] 2019-03-29 09:21:20 -07:00
Paulus Schoutsen
e7d3b22b46 Add lint task to Azure Pipelines [skip ci] 2019-03-29 09:18:25 -07:00
Paulus Schoutsen
75eeeae920 Set up CI with Azure Pipelines [skip ci] 2019-03-29 09:11:13 -07:00
David F. Mulcahey
6dc127780e Do not use zha default light polling (#22513)
* don't use default light polling

* review comment
2019-03-29 16:52:13 +01:00
Kyle Niewiada
1050baa9cc throw PlatformNotReady if unable to connect (#22515)
Throw `PlatformNotReady` for when the device disconnects, or when the Home Assistant is booting and the ADB server is not ready yet.
2019-03-29 08:08:36 -07:00
Robert Svensson
5f6037d563 Axis component reflect device availability (#22401) 2019-03-29 15:20:12 +01:00
Aaron Bach
f4625fd561 Speed up status updating in SimpliSafe (#22506)
* Speed up status updating in SimpliSafe

* Linting

* Member comments
2019-03-29 01:38:58 -07:00
mvn23
424543f34a Update pyotgw to 0.4b3 (#22496) 2019-03-29 08:28:50 +01:00
Andrew Sayre
78047c8c3c Fix .coveragerc from merge/rebase (#22516)
* Fix coveragerc

* Fix coveragerc
2019-03-28 20:01:53 -07:00
yosilevy
e14dbfb006 Add google calendar max_results config option (#21874)
* Added max_results config capability to google calendar (people are creating custom components just to override that)

* Dummy commit

* Dummy commit 2

* Changed to positive_int

* Removed double imports
2019-03-28 19:56:12 -07:00
Andreas Rydbrink
01052f516b Add HEOS media player component (#21721)
## Description:
Denon HEOS media player.

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#8848

## Example entry for `configuration.yaml` (if applicable):
```yaml
heos:
  host: HEOS-1                              
```

## Checklist:
  - [X] The code change is tested and works locally.
  - [X] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [X] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [X] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [X] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [X] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [X] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [X] New files were added to `.coveragerc`.

If the code does not interact with devices:
  - [ ] Tests have been added to verify that the new code works.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23


Co-authored-by: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com>
2019-03-28 19:03:02 -07:00
Jason Hu
709419e465 Fix lint on dev (#22512)
## Description:

Fix a lint issue in credstash script.


**Related issue (if applicable):** fixes #<home-assistant issue number goes here>

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

## Example entry for `configuration.yaml` (if applicable):
```yaml

```

## Checklist:
  - [ ] The code change is tested and works locally.
  - [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [ ] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [ ] New files were added to `.coveragerc`.

If the code does not interact with devices:
  - [ ] Tests have been added to verify that the new code works.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-28 15:33:21 -07:00
Andre Lengwenus
ee8cd861e0 Add LCN binary_sensor component (#22341) 2019-03-28 23:09:45 +01:00
Jason Hu
821a90fa54 Remove botocore dependency from credstash script (#22511)
* Remove botocore dependency from credstash script

* Update requirements_all.txt

* Update pylintrc

* Update credstash.py
2019-03-28 14:37:44 -07:00
Jason Hu
8874422e8a Fix Circleci config (#22509)
* Add libav depends on circleci

* tweak circleci config
2019-03-28 14:37:10 -07:00
Jason Hu
59476ab475 A very basic Circleci setup (#22503)
* Add circleci support

* Add buildpack-deps

* Install libudev-dev

* sudo

* always run test

* Add test report

* no sugar

* quite pytest

* better junit test result

* Add $CODE_COVERAGE env var
2019-03-28 09:54:49 -07:00
Jason Hu
8d86722c0e Fix dev branch (#22493) 2019-03-28 11:09:12 +01:00
Paulus Schoutsen
615b1cbfc7 Bumped version to 0.91.0b1 2019-03-27 23:50:58 -07:00
Paulus Schoutsen
3a406f5677 Fix YAML 2019-03-27 23:49:34 -07:00
Paulus Schoutsen
4db224ceb5 Fix YAML 2019-03-27 23:49:10 -07:00
Paulus Schoutsen
5d8d905822 Version bump to 0.92.0dev0 2019-03-27 22:10:35 -07:00
Paulus Schoutsen
a2c9834852 Bumped version to 0.91.0b0 2019-03-27 22:09:25 -07:00
Paulus Schoutsen
4f820aef83 Merge remote-tracking branch 'origin/master' into dev 2019-03-27 22:08:48 -07:00
Jason Hu
6ba2891604 Add trusted_users in trusted networks auth provider (#22478) 2019-03-27 21:53:11 -07:00
Jason Hunter
26726af689 Stream Record Service (#22456)
* Initial commit of record service for live streams

* fix lint

* update service descriptions

* add tests

* fix lint
2019-03-27 21:47:07 -07:00
Paulus Schoutsen
9d21afa444 Update translations 2019-03-27 21:32:58 -07:00
Paulus Schoutsen
05cdab03b1 Updated frontend to 20190327.0 2019-03-27 21:32:40 -07:00
Clifford W. Hansen
ece9c62ee8 Add game and app media types (#22459)
* Added game and app media types

* Changed media type to game from music

* Removed app type as it is not used yet
2019-03-27 21:20:43 -07:00
Paulus Schoutsen
a69080ba73 Print error instead of warning for custom platforms in legacy format (#22486)
* Legacy platform format prints error

* Enforce no partial overlays
2019-03-27 20:52:28 -07:00
Robbie Trencheny
7741ec4d5a Great migration notify (#22406)
* Move notify platforms into components

* Move notify tests

* Fix notify tests

* More fixes

* Update requirements

* Update .coveragerc

* Run gen reqs
2019-03-27 20:36:13 -07:00
Paulus Schoutsen
92457ca5ca Fix syntax error 2019-03-27 20:16:00 -07:00
Aaron Bach
8777146053 Fix too-abrubt SimpliSafe data refresh termination on error (#22466) 2019-03-27 20:14:49 -07:00
Rohan Kapoor
c4eab21736 Mopar split (#21526)
* Split out mopar into a component and sensor platform

* Add the mopar switch platform

* Add the mopar lock platform

* Clean up and bump version

* Update per review

* Re-add service to trigger horn

* Clean up again

* Don't call async from sync context

* Lint

* Implement changes from review

* Lint

* A little more clean up
2019-03-27 20:09:36 -07:00
Heine Furubotten
f11f5255ae Entur upgrade to v0.2.0: async polling, number of departures, omit non boarding departures (#22001)
* The Great Migration

* removed outdated tests

* Upgraded enturclient to v0.2.0
- client has gone async
- configurable if non boarding departures should be omitted from result
- configurable how many departures should be shown
- more clear which attributes are included and when

* reduced nesting and clearing of attributes

* Removed test data

* ensure attribution and stop id in attributes

* docstring fixes

* fix rebase errors
went a bit too fast on continue on one of the conflicts..

* fix test requirements comment from gen
2019-03-27 20:04:35 -07:00
Anders Melchiorsen
a1369c2fee Incoming SMS handling for netgear_lte (#22402)
* Fire netgear_lte events for incoming SMS

* Add netgear_lte.delete_sms service call

* Fix log statement

* Add services.yaml
2019-03-27 20:02:04 -07:00
Jc2k
8bf5e57b7f Move HKDevice into connection (#22430) 2019-03-27 20:01:10 -07:00
Jack Wilsdon
14ceb8472f Return percentage information in Alexa Smart Home response (#22440) 2019-03-27 19:58:52 -07:00
Finbarr Brady
e022f4465c Bump pypi again for Cisco Mobility Express (#22467)
* Fix empty device clId

Fix for https://github.com/fbradyirl/ciscomobilityexpress/issues/13

* Update requirements_all.txt
2019-03-27 19:58:06 -07:00
Maciej Bieniek
b8e38c1b25 Add new data fields and bump python-join-api (#22472)
* Add new data fields and bump python-join-api

* Update __init__.py
2019-03-27 19:56:27 -07:00
Daniel Høyer Iversen
c7904a4b37 Improve Sensibo error handling (#22475)
* Handle sensibo exception

* improve sensibo
2019-03-27 19:54:44 -07:00
Robert Svensson
8f3434c2ab Fix events so they work with multiple devices (#22477) 2019-03-27 19:54:27 -07:00
Nate Clark
d13c892b28 fix inverse state changes for binary sensors (#22479) 2019-03-27 19:54:01 -07:00
Sebastian Muszynski
26d4736ebf Fix auto discovery of yeelights (#22481)
* Fix auto discovery of yeelights

* Fix lint
2019-03-27 19:51:22 -07:00
Alexei Chetroi
e670491c86 Targeted ZHA permit joins. (#22482)
* Targeted ZHA permit service.

* Convert IEEE string to EUI64 usiv vol schema.

* Update test units.

* Lint.

isort imports.
2019-03-27 19:50:52 -07:00
Andrew Sayre
e26a5abb2b Don't return cover position when not supported (#22484) 2019-03-27 19:50:02 -07:00
Rohan Kapoor
78e162c1d3 Centralize all usages of host as a configuration param to the constant CONF_HOST (#22458)
* Centralize all usages of  as a configuration param to the constant CONF_HOST

* Clean up test
2019-03-27 19:48:05 -07:00
dilruacs
9176e13a97 Modify check for ADB public key (#22378)
* Remove check for public key

* Remove has_adb_files, directly call cv.isfile

* Check for missing adbkey.pub, create dummy if not found

* Reorder imports

* Bumped androidtv library version, deactivated pubkey test

* Code works without pubkey, removed function

* Removed "import os", not needed anymore

* Bump library version
2019-03-27 20:19:24 -05:00
René-Marc Simard
217782cd05 Cache GTFS metadata and expose utility attributes (breaking change) (#20966)
## Description:
Current sensor updates run 7 additional SQLite database queries to populate attributes, on top of the bus schedule queries themselves. Double that if you have two sensors. That leads to a lot of slowdowns for everything else when using an SD card!

Considering that some data never changes (agency, routes...) and that others like departure times are good until invalidated, let's fetch such metadata at first then only when relevant changes do occur.

**Breaking Change:**
GTFS sensor attributes are now named using the standard snake_case format.

### Work performed:
- All metadata queries are now cached.
- Metadata queries are now all regrouped in the `update()` method.
- Attributes assembling is now done in ~~`device_state_attributes()` where it belongs.~~ in a utility method called from `update()`, for code clarity and since there is potential I/O from SQLAlchemy.
- As a bonus, many metadata entries with cryptic values have complementary entries added that provide easier to use data:
	- .\* Stop Drop Off Type: .\* Stop Drop Off Type **State** -> (string, unknown)
	- .\* Stop Pickup Type: .\* Stop Pickup Type **State** -> (string, unknown)
	- .\* Stop Timepoint: .\* Stop Timepoint **Exact** -> boolean
	- .\* Station Location Type: .\* Station Location Type **Name** -> string
	- .\* Wheelchair Boarding: .\* Wheelchair Boarding **Available** -> (boolean, unknown)
	- Route Type: Route Type **Name** (string)
	- Trip Bikes Allowed: Trip Bikes Allowed **State** -> (boolean, unknown)
	- Trip Wheelchair Access: Trip Wheelchair Access **Available** -> (boolean, unknown)
- Attribute names are now using snake_case.
- Added type hints.

**Related issue (if applicable):** fixes #21222

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-27 17:58:23 -07:00
Jc2k
d8817bb127 Remove homekit_controller duplicate legacy pairing loader code (#22442) 2019-03-28 00:36:50 +01:00
Anders Melchiorsen
90c4f6f6e5 Do data extraction in sensors (#22444)
* Do data extraction in sensors

* Hopefully fix lint
2019-03-27 19:24:02 -04:00
Jason Hu
f795d03503 Fix aws.notify platform schema (#22374)
* Fix aws component notify platform schema

* Address code review comment

* Do not allow load aws.notify from notify component

* Revert unrelated translation update

* Review comment
2019-03-27 14:53:06 -07:00
Gido
24c7c2aa6e Solaredge new sensors (#21047)
* Remove unused hass parameter for SolarEdgeData

* Add factory to create different types of sensors
Rename SolarEdgeSensor to SolarEdgeOverviewSensor
Rename SolarEdgeData to SolarEdgeOverviewDataService
Remove unused hass parameter in SolarEdgeOverviewDataService

* Add SolarEdgeDetailsDataService to retrieve details data
Add SolarEdgeDetailsSensor to report details data
Add abstract class SolarEdgeSensor
Add details sensor types

* Combine multiple details sensor into one sensor with attributes

* Fix pylint and flake8 errors

* Resolve conflict with solaredge component update

* Add SolarEdgeInventoryDataService to retrieve inventory information
Add SolarEdgeInventorySensor to view inventory information
Add inverters to monitored_conditions

* Fix pylint and flake8 errors

* Add additional monitored variables for solaredge

* Add new sensors to solaredge component

* Add SolarEdgePowerFlowDataService
Add SolarEdgePowerFlowSensor
Add new monitored_conditions for power consumption and grid, load and
solar power production/consumption

* Set entity_id for each sensor based on platform and sensor type

* Fix flake8 and pylint errors

* Add check for connections in return data

* Fix pylint and flake8 errors

* Renamed state_attributes to device_state_attributes
Moved request import to top

* Remove explicit definition of entity_id

* Fix pylint and flake8 errors

* Add check for None before adding sensor

* Update SolarEdgeSensorFactory with initial dict which maps sensor_key to
entity class and data service

* Update attribute values to snakecase
Added stingcase as requirement

* Update requirements_all.txt to include stringcase for solaredge

* Update some initial values for data and unit_of_measurement
Update sensor factory
2019-03-27 17:08:52 -04:00
Nate Clark
2b48ecd5c5 better algorithm for computing unique_id (#22389) 2019-03-27 16:47:03 -04:00
Fredrik Erlandsson
71b800457b Add switches to control Daikin Airbase zones (#22417)
* initial AirBase zone support

* fix zone name

* version bump pydaikin

* don't use get()
2019-03-27 16:37:21 -04:00
Ryan Claussen
c3f090af17 Add hourly forecasts to Dark Sky (#21820) 2019-03-27 20:11:25 +00:00
Leonardo Merza
29ad3961e5 Use voluptuous error string for websocket validation error (#21883)
* use voluptuous error string to websocket validation error

* added exception logging to websocket error

* add detailed message to websocket validation error

* add error message to websocket validation error

* Add humanize error for websocket invalid vol error

* Add humanize error for websocket invalid vol error

* Add humanize error for websocket invalid vol error
2019-03-27 10:40:39 -07:00
Robert Svensson
52437f6246 Axis devices support device registry (#22367)
* Add support for device registry

* Fix test
2019-03-27 18:25:01 +01:00
Penny Wood
646c4a7137 Bootstrap to start registry loading early (#22321)
* Registries store directly in data on loading.

* Loading registries concurent with stage 1.

* Removed comments
2019-03-27 22:06:20 +08:00
zewelor
4de2efd07f Add support for yeelight ceiling ambilight (#22346) 2019-03-27 13:39:55 +01:00
Alexei Chetroi
6540114ec5 Update ZHA component CODEOWNERS (#22452) 2019-03-27 07:17:10 -04:00
zewelor
fa9a6f072e Add myself as codeowner for yeelight component (#22438) 2019-03-27 08:02:30 +01:00
Pascal Vizeli
a55afa8119 Update ha-ffmpeg 2.0 (#22427) 2019-03-27 07:55:05 +01:00
Thomas Lovén
19d99ddf57 Lower severity level of log messages from http.view (#21091) 2019-03-26 19:18:32 -04:00
Paulus Schoutsen
1766536812 Fix test name (#22421) 2019-03-26 15:24:28 -07:00
Finbarr Brady
02b12ec1b9 Adding conf for deep standby, wake and specific source bouquet of Enigma2 (#22393)
* - adding deep standby, conf for wake and specify source bouquet

* set defaults to strings

* bump pip

* bump pip

* bump pip

* bump pip

* bump pip

* bump pip
2019-03-26 17:49:53 -04:00
Pascal Vizeli
80250add9e Update homeassistant-pyozw to 0.1.3 (#22433) 2019-03-26 17:42:43 -04:00
Paulus Schoutsen
eb3355b05d Merge pull request #22420 from home-assistant/rc
0.90.2
2019-03-26 14:26:59 -07:00
mvn23
24ba434e6a Improve opentherm gw startup (#22121)
* Improve fix in c90f0d5 (#22106). Schedule connect coroutine directly on the loop rather than waiting for EVENT_HOMEASSISTANT_START.

* Remove unused import.
2019-03-26 14:25:47 -07:00
mvn23
ddefb74215 Fix TypeError in current_temperature if no temperature is known. (#22112)
Don't set opentherm_gw climate temperatures to 0 on init.
2019-03-26 14:25:47 -07:00
mvn23
42e75dc45c Fix opentherm_gw blocks HA startup when gateway unreachable. (#22106) 2019-03-26 14:25:46 -07:00
mvn23
44dc85204c Bump pyotgw to 0.4b2 (#21973) 2019-03-26 14:25:16 -07:00
Finbarr Brady
7e3567319f ciscomobilityexpress pypi version update (#22431)
* Bump pip

* Bump ciscomobilityexpress to 0.1.4
2019-03-26 21:13:56 +01:00
Anders Melchiorsen
afa99c9189 Use dispatcher for netgear_lte state updates (#22328)
* Use dispatcher for netgear_lte state updates

* Also dispatch unavailable state
2019-03-26 08:06:11 -07:00
Jason Hu
7519e8d417 Update translate, fix dev build error (#22419) 2019-03-26 07:48:26 -07:00
Paulus Schoutsen
ab1f1316ba Bumped version to 0.90.2 2019-03-26 07:40:10 -07:00
Jason Hunter
8a6d9cc0e4 reset unsub to None on timeout (#22404) 2019-03-26 07:39:59 -07:00
Pascal Vizeli
fac214828d Enable hass.io panel without ping (#22388)
* Enable hass.io panel without ping

* fix tests
2019-03-26 07:39:58 -07:00
Pascal Vizeli
a2508b4f52 Update hass-nabucasa & fix state (#22385)
* Update hass-nabucasa & fix state

* Fix lint
2019-03-26 07:39:56 -07:00
Jason Hunter
24a55834f9 Prefer TCP for RTSP streams (#22338)
## Description:

For RTSP streams, set the `prefer_tcp` FFMPEG flag.  This should resolve some of the "green feed" issues that some users are reporting, likely due to packets being lost over UDP on their network.

Resources: [FFMPEG protocols documentation](https://ffmpeg.org/ffmpeg-protocols.html#rtsp)

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-26 07:39:55 -07:00
ktnrg45
4d0a28fa56 Fix ps4 no creds with additional device (#22300)
* Fix no creds with additional device.

* Update config_flow.py
2019-03-26 07:39:54 -07:00
Jc2k
133ae63ed0 Add missing append (#22414) 2019-03-26 07:39:05 -07:00
Pascal Vizeli
3fddf5df08 Enable hass.io panel without ping (#22388)
* Enable hass.io panel without ping

* fix tests
2019-03-26 07:38:25 -07:00
cgtobi
a27e821e8b Migrate tts (#22403)
* Migrate tts

* Migrate tts tests

* Update requirements

* Fix path to demo mp3
2019-03-26 07:34:16 -07:00
Kevin Fronczak
c71e5ed588 Changed busy error to warning (#22398) 2019-03-26 09:20:50 -04:00
zewelor
2cebf9ef71 Fix yeelight state update (#22373) 2019-03-26 09:18:53 -04:00
David F. Mulcahey
3cca3c37f0 zha fixes (#22381) 2019-03-26 09:17:43 -04:00
Daniel Høyer Iversen
77e7b63f4a Tibber add support for Watty (#22397) 2019-03-26 14:02:10 +01:00
Paulus Schoutsen
65432ba552 Move core stuff into Home Assistant integration (#22407)
* Move core stuff into Home Assistant integration

* Lint
2019-03-26 13:38:32 +01:00
Jason Hunter
bad0a8b342 Camera Preferences + Preload Stream (#22339)
* initial commit for camera preferences and preload stream

* cleanup and add tests

* respect camera preferences on each request stream call

* return the new prefs after update
2019-03-26 08:31:29 -04:00
Jason Hunter
baa4945944 reset unsub to None on timeout (#22404) 2019-03-26 08:39:09 +01:00
Jason Hu
e85b089eff Set default parallel_update value should base on async_update (#22149)
* Set default parallel_update value should base on async_update

* Set default parallel_update value should base on async_update

* Delay the parallel_update_semaphore creation

* Remove outdated comment
2019-03-25 23:53:36 -07:00
Jc2k
a62c116959 Remove get_serial helper that is no longer needed. (#22368) 2019-03-25 23:49:51 -07:00
Sebastian Muszynski
6fa8fdf555 Fix data_key of the xiaomi_aqara cover for LAN protocol v2 (#22358) 2019-03-25 23:46:00 -07:00
Robert Svensson
79445a7ccc deCONZ support Xiaomi vibration sensor (#22366)
* Martin pointed out in previous PR that no ending '.' in logging

* Add support for Xiaomi vibration sensor
2019-03-25 23:43:58 -07:00
Nick Whyte
73b38572f0 Add infer_arming_state option to ness alarm (#22379)
* Add infer_arming_state option to ness alarm

* actually use config value

* 🤦‍♂️
2019-03-25 23:43:24 -07:00
Jc2k
b2ba9d07ca Fix unavailable state for homekit locks and covers (#22390) 2019-03-25 23:40:28 -07:00
Daniel Shokouhi
8aef8c6bb4 Update ring_doorbell to 0.2.3 (#22395) 2019-03-25 23:37:59 -07:00
uchagani
0c4380a78d remove config sections from hass.config.components (#22370)
* remove config sections from hass.config.components

* fix tests
2019-03-25 22:36:39 -07:00
René-Marc Simard
42c27e5b72 Search GTFS departures across midnight (#20992) 2019-03-25 21:51:49 -07:00
Niccolò Maggioni
5ad3e75a4d Support for Plex sensor with enforced SSL (#21432) 2019-03-25 20:45:13 +01:00
Fredrik Erlandsson
6ffe9ad473 updated pydaikin (#22382) 2019-03-25 19:37:31 +01:00
zewelor
6a74c403c0 Update python yeelight and add nightlight mode sensor (#22345) 2019-03-25 19:06:43 +01:00
lapy
2731777c7e Add traccar events (#22348)
* Add import_events(), small refactoring, traccar_id

I isolated the code that imports traccar tracking data and added a new function that imports the traccar events to make them run in parallel and reduce delay. The events that are imported in hass, will be fired with the prefix "traccar_". Furthermore a traccar_id is now imported in hass entities, useful for matching the traccar hass entities with the traccar hass events in the most accurate way.

* bump pytraccar version

* Code format fix

* Code format fix 2

* Code format fix 3

* Implement requested changes

* Add new traccar dependency

* Fix line too long

* Update device_tracker.py

* Update requirements_all.txt
2019-03-25 18:52:53 +01:00
Andrew
a59487a438 Fix TpLink Device Tracker initialize error (#22349)
Catch RequestException instead of ConnectionError
In some cases TpLinkDeviceScanner throws various successors of
RequestException. They should be caught.
2019-03-25 10:25:49 -07:00
Paulus Schoutsen
f1a0ad9e4a Frontend indicate require admin (#22272)
* Allow panels to indicate they are meant for admins

* Panels to indicate when they require admin access

* Do not return admin-only panels to non-admin users

* Fix flake8
2019-03-25 10:04:35 -07:00
Pascal Vizeli
b57d809dad Update hass-nabucasa & fix state (#22385)
* Update hass-nabucasa & fix state

* Fix lint
2019-03-25 09:43:15 -07:00
Jc2k
f997957054 Remove unused const (#22383) 2019-03-25 16:28:34 +01:00
Jeff Irion
c8048e1aff Allow for custom turn on/off commands (#22354) 2019-03-25 08:37:10 -04:00
ktnrg45
17a96c6d9b Improve PS4 media art fetching and config flow (#22167)
* improved config flow

* Added errors, docs url

* Added errors, docs url

* Added manual config mode

* Add tests for manual/auto host input

* fix inline docs

* fix inline docs

* Changed region list

* Added deprecated region message

* removed DEFAULT_REGION

* Added close method

* Fixes

* Update const.py

* Update const.py

* Update const.py

* Update test_config_flow.py

* Added invalid pin errors

* Update strings.json

* Update strings.json

* bump pyps4 to 0.5.0

* Bump pyps4 0.5.0

* Bump pyps4 to 0.5.0

* test fixes

* pylint

* Change error reference

* remove pin messages

* remove pin messages

* Update en.json

* remove pin tests

* fix tests

* update vol

* Vol fix

* Update config_flow.py

* Add migration for v1 entry

* lint

* fixes

* typo

* fix

* Update config_flow.py

* Fix vol

* Executor job for io method.

* Update __init__.py

* blank line

* Update __init__.py

* Update tests/components/ps4/test_config_flow.py

Co-Authored-By: ktnrg45 <38207570+ktnrg45@users.noreply.github.com>
2019-03-25 08:25:15 -04:00
zewelor
96133f5e6b Improve yeelight component (#22347) 2019-03-25 08:50:47 +01:00
Jc2k
af4b85d39d Give HomeKit locks better names by default (#22333)
## Description:

This is a follow up to #22171. There we set the name of an entity based on the `accessory-information` homekit service, rather than using the zeroconf/avahi name metadata. Unfortunately Lock also sets its name from zeroconf directly, rather than picking it up from the base class. This test updates it to be like the other homekit entities and use the base class.

(This is from my ongoing homekit_controller configentry branch).

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-24 18:21:04 -07:00
fabtesta
324a7c7875 Add ClickSend "caller" option (#20780)
* removed "from" parameter from ClickSend API call

Removed "from" parameter from API call to let ClickSend choose a random number and be more compliant with some cellular networks that do not allow incoming calls from the same recipient number.

* fixed "line too long (94 > 79 characters)" houndci code review

fixed "line too long (94 > 79 characters)" houndci code review

* Added new component optional parameter "caller".
If defined is used to override default logic that uses recipient phone number in "from" API call parameter

* Removed default value for CALLER parameter. If not defined then will take the RECIPIENT value.
2019-03-24 18:13:56 -07:00
Nick Horvath
c59d45caa3 Expose detailed Ecobee equipment status (#20767)
* ecobee: expose detailed equipment status

* Fix #18244 for ecobee by moving current_operation property to current_operation_mode which is more accurate and defining current_operation properly, thanks @ZetaPhoenix

* fix docstring and lint issue

* Revert "fix docstring and lint issue"

This reverts commit d3a645f075.

* Revert "Fix #18244 for ecobee by moving current_operation property to current_operation_mode which is more accurate and defining current_operation properly, thanks @ZetaPhoenix"

This reverts commit bfd90551ef.
2019-03-24 18:13:06 -07:00
Moritz Fey
f272ed3b91 Add 'method' parameter to forgiving_round method (#21708)
* Add 'method' parameter to forgiving_round method

Fixes #21707

* fix rounding behavior in round() filter

* add test cases for new rounding behaviour
2019-03-24 18:10:49 -07:00
karlkar
548371e94c Check if mac is set when more than 2 gateways (#21834)
* Check if mac is set when more than 2 gateways

When more than 2 gateways mac is required for each of them. Now voluptuous will require it.

* fix line length

* remove trailing whitespace

* Make it more readable
2019-03-24 17:59:12 -07:00
Jason Hu
1aee7a1673 Add aws component and consolidate aws notify platform (#22240)
* Add aws component

* Move notify config under aws component

* Add basic tests for aws component

* Add deprecated warning for notify.aws_*

* Add more tests
2019-03-24 17:58:20 -07:00
Fredrik Erlandsson
b6987a1235 Add support for Tfiac Climate component (#21823)
## Description:

Add support for AC-models that follows the Tfiac protocol. Built together with @mellado.

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#8910

## Example entry for `configuration.yaml` (if applicable):
```yaml
climate:
   platform: tfiac
   host: 192.168.10.26
```

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [x] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [x] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [x] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [x] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [x] New files were added to `.coveragerc`.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23


Co-authored-by: Robbie Trencheny <me@robbiet.us>
2019-03-24 17:57:53 -07:00
Steven Looman
d1f75fcf32 Properly connect sensors to hub (#21414)
* Properly connect sensors to hub
Refs #20958

* Don't connect (merge) with main device

* Provide manufacturer

* Linting

* Do connect upnp-sensors to main device

* Linting

* Fix requirements_all.txt
2019-03-24 17:46:15 -07:00
dilruacs
adca598172 Turn Panasonic Viera TV on without WOL (#22084)
* Turn the TV on via remote

* Turn the TV on via remote

* Use turn_on() from panasonic-viera==0.3.2

* make power option configurable

* add app_power as argument

* formatting
2019-03-24 17:41:16 -07:00
Hmmbob
7f940423ad Warn user about HTML5 GCM deprecation (#22351)
* Warn user about GCM deprecation

* Fixing hound

* Fixing typo

* Fixing Travis fail
2019-03-24 17:40:43 -07:00
Steven Looman
1b0e523a60 Add support for 'image' media type (#22353) 2019-03-24 17:40:27 -07:00
shanbs
0d46e2c0b5 Fix the crash due to absence of the "default_home" in HomeData from pyatmo (netatmo/climate) (#22363) 2019-03-25 01:31:22 +01:00
cgtobi
d2a83c2732 Upgrade netatmo smart_home module (#22365) 2019-03-25 01:30:21 +01:00
Robbie Trencheny
dc64634e21 Set Onkyo reset log to debug instead of info (#22369)
Onkyo logs this message somewhat frequently, and its spammy, so lets make it a debug message instead of info. 

See also: #20081
2019-03-24 17:15:07 -07:00
Jason Hunter
0ae38aece8 Prefer TCP for RTSP streams (#22338)
## Description:

For RTSP streams, set the `prefer_tcp` FFMPEG flag.  This should resolve some of the "green feed" issues that some users are reporting, likely due to packets being lost over UDP on their network.

Resources: [FFMPEG protocols documentation](https://ffmpeg.org/ffmpeg-protocols.html#rtsp)

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-24 17:13:20 -07:00
ktnrg45
88df2e0ea5 Fix ps4 no creds with additional device (#22300)
* Fix no creds with additional device.

* Update config_flow.py
2019-03-24 20:08:59 -04:00
Sebastian Muszynski
7421156dfc Add support for the power socket of the Xiaomi AC Partner V3 (#22205) 2019-03-24 20:15:29 +01:00
Sebastian Muszynski
d5732c4dba Add color support to Philips Moonlight (#22204) 2019-03-24 20:14:35 +01:00
Anders Melchiorsen
eabb68ad7d Do not warn when creating an empty database (#22343) 2019-03-24 12:00:29 -07:00
Robert Svensson
8d1cf553de Support deCONZ library with exception handling (#21952) 2019-03-24 19:27:32 +01:00
Yu
89f8203163 Fix xiaomi aqara cube with lumi.acpartner.v3 gateway (#22130) 2019-03-24 18:56:17 +01:00
MatthewFlamm
ed93c3b2c1 Fix pressure in dark sky and openweathermap and add pressure utility (#21210) 2019-03-24 18:37:31 +01:00
Robert Svensson
6988fe783c Axis config flow (#18543)
* Initial draft

* Add tests for init
Fix hound comments

* Add tests for device
Change parameter handling to make device easier to test

* Remove superfluous functionality per Martins request

* Fix hound comments

* Embedded platforms

* Fix device import

* Config flow retry

* Options default values will be set automatically to options in config entry before component can be used

* Clean up init
Add populate options
Fix small issues in config flow
Add tests covering init

* Improve device tests

* Add config flow tests

* Fix hound comments

* Rebase miss

* Initial tests for binary sensors

* Clean up
More binary sensor tests

* Hound comments

* Add camera tests

* Fix initial state of sensors

* Bump dependency to v17

* Fix pylint and flake8

* Fix comments
2019-03-24 16:16:50 +01:00
zewelor
9214934d47 Move yeelight into component (#21593) 2019-03-24 13:01:12 +01:00
René-Marc Simard
71ebc4f594 Define GTFS sensor as a timestamp device class (#21053) 2019-03-24 12:15:30 +01:00
uchagani
c5f4aa0466 show which component is causing translation errors (#22340) 2019-03-23 23:06:55 -07:00
Jason Hunter
49b92b5349 fix where PLATFORM_SCHEMA gets pulled from (#22334) 2019-03-23 23:49:44 -04:00
Paulus Schoutsen
1ddc249989 Consolidate more platforms (#22308)
* Consolidate final platforms

* Fix some tests

* Fix more tests

* Fix more tests
2019-03-23 20:22:35 -07:00
Fabian Affolter
4c4eff1d62 Update file header (#22318)
* Update file header

* Fix indent

* Fix lint issue
2019-03-23 22:05:47 +01:00
Thibault Maekelbergh
16dbf9b2ea Remove occupancy as it is not available in API (#22320) 2019-03-23 20:05:08 +01:00
Paulus Schoutsen
c68b621972 Google Assistant: Add camera stream trait (#22278)
* Add camera stream trait

* Lint
2019-03-23 09:16:43 -07:00
SNoof85
d81df1f0ae Add Freebox switch platform (#21710)
* Added Freebox switch and bump aiofreepybox version

* Added missing modified files

* removed unused import

* gen_requirements_all passed

* removed unused import

* Remove unused code

* lint fixes

* More lint fixe

* Bump aiofreepybox version and API version to Freebox

* Remove URL from log entry

* import relative

* Sort imports
2019-03-23 15:32:53 +01:00
Markus Jankowski
112ed88d64 Add homematicip cloud connection quality related attributes (#21990) 2019-03-23 13:21:55 +01:00
Fabian Affolter
5f34d3ccb9 Update abbreviation (#22317) 2019-03-23 12:07:32 +01:00
Fabian Affolter
3c811bbf1a Upgrade py-cpuinfo to 5.0.0 (#22287) 2019-03-23 08:00:43 +01:00
Fabian Affolter
90dfe72d31 Upgrade pylast to 3.1.0 (#22302) 2019-03-23 08:00:13 +01:00
Robbie Trencheny
89221bfab9 Fix for embedded MQTT server configuration (#22305)
## Description:

Passing in a configuration for the embedded MQTT server has been broken for a while. This fixes that. See related issue number for further details.

**Related issue (if applicable):** fixes #18228

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-22 16:01:58 -07:00
Robbie Trencheny
773c567563 Switch from using Google Maps API for elevation to Open Elevation API (#22306)
## Description:

Switches elevation helper to use [Open Elevation](https://open-elevation.com/) instead of Google Maps API which now requires a API key. It's a drop in replacement for Google Maps too!

**Related issue (if applicable):** fixes #19860

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-22 16:01:43 -07:00
Robbie Trencheny
58c23bc2d9 Update srpenergy library (#22307)
Fixes #18899
2019-03-22 16:01:21 -07:00
cgtobi
611597a87b Sort code owners alphabetically (#22304)
## Description:
Sort the code oweners list alphabetically.

**Related issue (if applicable):** fixes #<home-assistant issue number goes here>

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

## Example entry for `configuration.yaml` (if applicable):
```yaml

```

## Checklist:
  - [ ] The code change is tested and works locally.
  - [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [ ] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [ ] New files were added to `.coveragerc`.

If the code does not interact with devices:
  - [ ] Tests have been added to verify that the new code works.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-22 14:05:26 -07:00
Penny Wood
ecabf92504 Update trait to support auto without ranges. (#21847) 2019-03-22 13:42:56 -07:00
Robbie Trencheny
e9cd9f88be Fix Prometheus casting issues (#22282)
## Description:

Fix Prometheus casting issues

**Related issue (if applicable):** fixes #8659.
## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-22 13:16:17 -07:00
Leonardo Merza
a58f1eedda Add sort by config and tests for Reddit integration (#22081)
* add sort type to reddit sensor

add sort type to reddit sensor

automated commit 14/03/2019 15:53:15

automated commit 15/03/2019 09:43:39

reddit sensor add tests and sort by config

reddit sensor add tests and sort by config

reddit sensor add tests and sort by config

reddit sensor add tests and sort by config

* Add reddit sensor sort_by config and tests

* Add reddit sensor sort_by config and tests

* Add reddit sensor sort_by config and tests

* Add reddit sensor sort_by config and tests

* Add reddit sensor sort_by config and tests
2019-03-22 21:05:08 +01:00
jjlawren
ce550206a4 Fix progress for Plex media_players (#22224)
* Return current position and last updated timestamp needed by UI

* Add throttling to position updating

* Simplify logic, don't clear position when refreshing

* Use seconds

* Update homeassistant/components/plex/media_player.py

Co-Authored-By: jjlawren <jjlawren@users.noreply.github.com>

* Add throttling to position updating

* Simplify logic, don't clear position when refreshing
2019-03-22 14:00:12 -06:00
Penny Wood
1ddc65a0ce Fixing the api_streams sensor (#22200)
* Fire events with websocket messages.

* Added tests to validate

* Fixed api_streams sensor to use new sensor

* Delete from coverageac as now works.

* Removed websocket request event.

* Use dispatcher instead of events.

* Moved sensor to under websocket_api

* Changes as per code review

* Fixed tests.

* Modified test

* Patch
2019-03-22 11:59:10 -07:00
Anders Melchiorsen
2b6e197deb Consolidate the netgear_lte configuration (#22105)
* Consolidate the netgear_lte configuration

* Simplfications from review

* Extract sensor_types

* Simplify defaults
2019-03-22 14:43:39 +01:00
Jeff Irion
b125514655 Improved exception handling and logging (#22268)
Catch RuntimeError exceptions. Don't log ADB command output if there isn't any.
2019-03-22 08:47:06 -04:00
Jeff Irion
c90e13bfef Bump androidtv to 0.0.13 (#22279)
* Bump androidtv to 0.0.13

* Bump androidtv to 0.0.13 in requirements_all.txt
2019-03-22 09:25:31 +01:00
jjlawren
30d4a9f12c Plex: Avoid refreshing by both device and session methods (#22266)
* Avoid refreshing by both device and session methods

* Fix indentation
2019-03-21 19:41:41 -07:00
Fabian Affolter
3432c5da9e Upgrade sqlalchemy to 1.3.0 (#22269) 2019-03-21 19:40:11 -07:00
Paulus Schoutsen
ae2153f1fc Merge pull request #22265 from home-assistant/rc
0.90.1
2019-03-21 14:24:28 -07:00
Pascal Vizeli
8085e9206a Update hass-nabucasa 0.10 (#22267) 2019-03-21 14:21:37 -07:00
Pascal Vizeli
5716d0aa1a Update hass-nabucasa 0.10 (#22267) 2019-03-21 14:21:13 -07:00
Daniel Høyer Iversen
86a510441c Upgrade tibber libary, support solar production (#22261) 2019-03-21 16:46:25 -04:00
Paulus Schoutsen
ff93591aaf Lint 2019-03-21 13:22:08 -07:00
Pascal Vizeli
8a314d7da0 Update Hass-NabuCasa 0.9 (#22258) 2019-03-21 13:06:15 -07:00
Andrew Sayre
f47a50aa24 Fix validate webhook requirements (#22248) 2019-03-21 13:06:13 -07:00
Michaël Arnauts
b2bb70b5aa Allow on/off on tado climate component. (#22242)
* Allow on/off on tado climate component. Bump python-tado version. Patch from @wmalgadey

* Revert wrongly change in tado device tracker
2019-03-21 13:05:46 -07:00
Jason Hunter
56cbe8a73f Stream fixes (#22238)
* fix issues with out of order packets, and empty first packet on some IP camera models

* do not skip the first packet
2019-03-21 13:05:09 -07:00
Paulus Schoutsen
0f730310a4 Bumped version to 0.90.1 2019-03-21 13:03:40 -07:00
Karim Roukoz
1aab284012 Bump total-connect-client to 0.25, fixing issue with Total Connect (#22230)
* Bump total-connect-client to 0.25

* Bump version in requirements_all.txt
2019-03-21 13:03:25 -07:00
Alexei Chetroi
a84ba90c9e Fix ZHA force polled entities. (#22222)
## Description:
Fix "force_polled" ZHA entities.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-21 13:02:35 -07:00
Ryan Bahm
bc85d47878 Change .now() to .utcnow() (#22233)
ephem works in UTC time, not local time. As a result, our comparison needs to be in UTC for accurate results.
2019-03-21 12:59:07 -07:00
Paulus Schoutsen
ee1c270c89 Updated frontend to 20190321.0 2019-03-21 12:57:47 -07:00
Paulus Schoutsen
72bb94de96 Update translations 2019-03-21 12:57:20 -07:00
Paulus Schoutsen
0a4251e08f Updated frontend to 20190321.0 2019-03-21 12:56:59 -07:00
Pascal Vizeli
1b66520e31 Update Hass-NabuCasa 0.9 (#22258) 2019-03-21 19:39:24 +01:00
Penny Wood
81bb928394 Handle on/off through TemperatrureSetting trait. (#21842) 2019-03-21 10:57:42 -07:00
Karim Roukoz
fe468ace34 Bump total-connect-client to 0.25, fixing issue with Total Connect (#22230)
* Bump total-connect-client to 0.25

* Bump version in requirements_all.txt
2019-03-21 09:39:30 -07:00
Andrew Sayre
6526c68e2d Fix validate webhook requirements (#22248) 2019-03-21 09:13:20 -07:00
Michaël Arnauts
f64a99878f Allow on/off on tado climate component. (#22242)
* Allow on/off on tado climate component. Bump python-tado version. Patch from @wmalgadey

* Revert wrongly change in tado device tracker
2019-03-21 08:24:30 -07:00
Alexei Chetroi
03855c18fc add ZHA channel name property (#22218)
* Make channel name a property.

* Cleanup Zigbee channels.

Use zcl.Cluster.ep_attribute as default channel name.
2019-03-21 07:40:12 -07:00
Jason Hu
2b02c0d0fc Fix build issue (#22251) 2019-03-21 07:32:13 -07:00
Jason Hunter
07dc23a0e3 Stream fixes (#22238)
* fix issues with out of order packets, and empty first packet on some IP camera models

* do not skip the first packet
2019-03-21 07:31:55 -07:00
Steven Looman
77635d40e2 Upgrade to async_upnp_client==0.14.6 (#22223)
Upgrade to async_upnp_client to 0.14.6
2019-03-21 08:58:04 +01:00
Sebastian Muszynski
f4102339c1 Bump python-miio version (#22202)
* Bump python-miio version

* Rename speed property to motor_speed

* Enable set_led service of the Air Humidifier

* Allow a favorite level in [0...17]

* Allow a scene in [0...6]
2019-03-21 08:56:36 +01:00
uchagani
21871b3d6b add date_time_iso to time_date sensor (#22199)
* add date_time_iso to time_date sensor

* hound fixes

* lint fixes
2019-03-21 08:55:30 +01:00
Quentin Stafford-Fraser
88be786e82 Make !include_dir_list use alphanumeric order (#21902)
* Make YAML includes such as !include_dir_list incorporate files in alphabetical order

* Test for !include_dir_list sorting
2019-03-20 23:10:08 -07:00
Paulus Schoutsen
4b1de61110 Use relative imports inside integrations (#22235)
* Use relative imports inside integrations

* Lint

* Fix automation tests

* Fix scene imports
2019-03-20 22:56:46 -07:00
Marco Orovecchia
ab17b22239 Removed overly broad exception handling for nanoleaf light (#22189) 2019-03-20 20:32:06 -07:00
Fabian Affolter
423d595edf Upgrade holidays to 0.9.10 (#22182) 2019-03-20 20:31:15 -07:00
Fabian Affolter
e044eace20 Upgrade psutil to 5.6.1 (#22183)
* Upgrade psutil to 5.6.1

* Upgrade speedtest-cli to 2.1.1
2019-03-20 20:30:52 -07:00
Alexei Chetroi
9653544144 Fix ZHA force polled entities. (#22222)
## Description:
Fix "force_polled" ZHA entities.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-20 19:15:21 -07:00
Paulus Schoutsen
937eba3dbe Merge pull request #22216 from home-assistant/rc
0.90.0
2019-03-20 10:16:24 -07:00
Paulus Schoutsen
01d8b5831e Updated frontend to 20190320.0 2019-03-20 07:51:38 -07:00
Paulus Schoutsen
9d8054e6e2 Bumped version to 0.90.0 2019-03-20 07:51:23 -07:00
Penny Wood
d4cd39e43e Fixed typing errors (#22207) 2019-03-20 07:51:14 -07:00
Paulus Schoutsen
1bf49ce5a3 Updated frontend to 20190320.0 2019-03-20 07:50:24 -07:00
Penny Wood
62c2bbd59a Fixed typing errors (#22207) 2019-03-20 07:49:27 -07:00
Matt Snyder
398281959a Update codeowners (#22198) 2019-03-20 11:33:42 +01:00
Paulus Schoutsen
7cf1f4f9fe Bumped version to 0.90.0b7 2019-03-19 16:48:31 -07:00
Paulus Schoutsen
268d129ea9 Updated frontend to 20190319.1 2019-03-19 16:36:11 -07:00
CV
db07e45df8 Fix breaking on HTML email without images (#22143)
* Fix breaking on HTML email without images

If using html emails with no images the code breaks since it is not tested for empty (uninitialized) key images.

* fixed long line

* Implemented suggested better solution

Better solution to allow data -> html email without images.

* Protecting data -> without html key from crashing

If the data key does not contain the html key, sending the email would crash this "script". Preventing this by returning an default empty array.
2019-03-19 14:37:12 -07:00
Jc2k
0344c761fc Better handling of HomeKit accessory-information service (#22171)
* HomeKit controller: Better handling of accessory-information service

* Changes from review
2019-03-19 15:04:20 -04:00
Fabian Affolter
6cb8806085 Upgrade Sphinx to 1.8.5 (#22180) 2019-03-19 15:02:56 -04:00
Fabian Affolter
2b250a7ec8 Upgrade youtube_dl to 2019.03.18 (#22181) 2019-03-19 15:01:58 -04:00
Paulus Schoutsen
b8f246356a Bumped version to 0.90.0b6 2019-03-19 11:41:08 -07:00
Paulus Schoutsen
e6ffc790f2 Always load Hass.io component on Hass.io (#22185)
* Always load Hass.io component on Hass.io

* Lint

* Lint
2019-03-19 11:40:49 -07:00
Pascal Vizeli
b85189e699 Update Hass-NabuCasa 0.8 (#22177) 2019-03-19 11:40:48 -07:00
uchagani
f202114ead bump total_connect_client to 0.24 (#22166) 2019-03-19 11:40:06 -07:00
Paulus Schoutsen
fff6927f9c Updated frontend to 20190319.0 2019-03-19 11:38:16 -07:00
Paulus Schoutsen
08849fd3e8 Updated frontend to 20190319.0 2019-03-19 11:38:05 -07:00
Paulus Schoutsen
92dc26bab3 Always load Hass.io component on Hass.io (#22185)
* Always load Hass.io component on Hass.io

* Lint

* Lint
2019-03-19 11:33:50 -07:00
Eliseo Martelli
88669c6543 removed iliad (#22175) 2019-03-19 16:16:29 +01:00
Daniel Høyer Iversen
350904870e restore entity for switchbot (#22087) 2019-03-19 16:16:10 +01:00
Pascal Vizeli
1499485a71 Update Hass-NabuCasa 0.8 (#22177) 2019-03-19 15:10:30 +01:00
Penny Wood
bf4b7a82b4 Move platforms patch (#22168)
* move mold sensor

* Get tests working

* Move moon and season sensor strings.

* Renamed sensor strings.
2019-03-19 06:43:15 -07:00
Jc2k
c2aa06d0d4 Add some tests for Koogeek LS1 (#22141) 2019-03-19 00:58:56 -07:00
uchagani
188293770e bump total_connect_client to 0.24 (#22166) 2019-03-19 00:51:42 -07:00
Andrew Hall
12df14b87b Change ATTR_BATTERY_STATE_UNPLUGGED for ios component (#22152)
* AH - Updated Text Description of ATTR_BATTERY_STATE_UNPLUGGED

* AH - updated device_tracker ios test to use new battery state description
2019-03-19 00:46:04 -07:00
Penny Wood
f195ecca4b Consolidate all platforms that have tests (#22109)
* Moved climate components with tests into platform dirs.

* Updated tests from climate component.

* Moved binary_sensor components with tests into platform dirs.

* Updated tests from binary_sensor component.

* Moved calendar components with tests into platform dirs.

* Updated tests from calendar component.

* Moved camera components with tests into platform dirs.

* Updated tests from camera component.

* Moved cover components with tests into platform dirs.

* Updated tests from cover component.

* Moved device_tracker components with tests into platform dirs.

* Updated tests from device_tracker component.

* Moved fan components with tests into platform dirs.

* Updated tests from fan component.

* Moved geo_location components with tests into platform dirs.

* Updated tests from geo_location component.

* Moved image_processing components with tests into platform dirs.

* Updated tests from image_processing component.

* Moved light components with tests into platform dirs.

* Updated tests from light component.

* Moved lock components with tests into platform dirs.

* Moved media_player components with tests into platform dirs.

* Updated tests from media_player component.

* Moved scene components with tests into platform dirs.

* Moved sensor components with tests into platform dirs.

* Updated tests from sensor component.

* Moved switch components with tests into platform dirs.

* Updated tests from sensor component.

* Moved vacuum components with tests into platform dirs.

* Updated tests from vacuum component.

* Moved weather components with tests into platform dirs.

* Fixed __init__.py files

* Fixes for stuff moved as part of this branch.

* Fix stuff needed to merge with balloob's branch.

* Formatting issues.

* Missing __init__.py files.

* Fix-ups

* Fixup

* Regenerated requirements.

* Linting errors fixed.

* Fixed more broken tests.

* Missing init files.

* Fix broken tests.

* More broken tests

* There seems to be a thread race condition.
I suspect the logger stuff is running in another thread, which means waiting until the aio loop is done is missing the log messages.
Used sleep instead because that allows the logger thread to run. I think the api_streams sensor might not be thread safe.

* Disabled tests, will remove sensor in #22147

* Updated coverage and codeowners.
2019-03-18 23:07:39 -07:00
David F. Mulcahey
46ece3603f Add dynamic subscription for ZHA add device page (#22164)
* add ws subscription for zha gateway messages
* add debug mode
* only relay certain logs
* add missing require admin
* add devices command
* add area_id
* fix manufacturer code
2019-03-18 22:35:03 -04:00
Paulus Schoutsen
ad0ec66353 Bumped version to 0.90.0b5 2019-03-18 17:04:49 -07:00
Franck Nijhof
592edd10ef Upgrade toonapilib to 3.2.2 + lower interval (#22160) 2019-03-18 17:04:43 -07:00
Pascal Vizeli
d75d75e49f Remove config check over supervisor (#22156)
* Remove config check over supervisor

* Fix lint

* Fix tests
2019-03-18 17:04:42 -07:00
Jason Hunter
1c9b750e36 Fix resetting access token on streams with keepalive (#22148) 2019-03-18 17:04:41 -07:00
WebSpider
33a7075883 Bump tado version (#22145)
* Bump python-tado, new API endpoint

* Change references of old API endpoint to new

* Update REQUIREMENTS
2019-03-18 17:04:40 -07:00
Paulus Schoutsen
cc00f3cd2e Allow non-admins to listen to certain events (#22137) 2019-03-18 17:04:39 -07:00
Jason Hu
22624715a9 Remove hass.config from aws_lambda notify payload (#22125) 2019-03-18 17:04:38 -07:00
Paulus Schoutsen
05db444832 Updated frontend to 20190318.0 2019-03-18 17:04:04 -07:00
Pascal Vizeli
ecfe0fc3dd Remove config check over supervisor (#22156)
* Remove config check over supervisor

* Fix lint

* Fix tests
2019-03-18 16:58:48 -07:00
Franck Nijhof
e5a2ef9b8d Upgrade toonapilib to 3.2.2 + lower interval (#22160) 2019-03-18 16:56:57 -07:00
Paulus Schoutsen
c37dcacf54 Updated frontend to 20190318.0 2019-03-18 16:54:31 -07:00
zewelor
9591aa66ba Fixx yeelight flow action param for declared effects (#22159) 2019-03-18 20:51:42 +01:00
Ben Lebherz
af473cddf0 replace einder lib with horimote (#22135) 2019-03-18 20:14:14 +01:00
James Hilliard
9c7ef13f91 Fix hlk-sw16 inverted switch state (#22059) 2019-03-18 10:57:44 -07:00
endor
9f96aab2f4 Additional sensors and fixed icons, attributes and device classes. (#22139) 2019-03-18 18:55:09 +01:00
Jason Hunter
ce5cf5803c Fix resetting access token on streams with keepalive (#22148) 2019-03-18 09:27:34 -04:00
WebSpider
e14b243336 Bump tado version (#22145)
* Bump python-tado, new API endpoint

* Change references of old API endpoint to new

* Update REQUIREMENTS
2019-03-18 08:54:24 -04:00
Paulus Schoutsen
29131a655d Allow non-admins to listen to certain events (#22137) 2019-03-17 19:13:06 -07:00
Aaron Bach
c020b7c47d Handle possible exception during Ambient PWS reconnect (#22134)
* Handle possible exception during Ambient PWS reconnect

* Hound
2019-03-17 13:06:19 -06:00
Aaron Bach
8529ad3ba1 Loosen field retrieval from Pollen.com (#22132) 2019-03-17 11:55:58 -06:00
Aaron Bach
0d42ed1861 Handle occassional 502 Bad Gateway from SimpliSafe (#22131) 2019-03-17 11:55:10 -06:00
cgtobi
ba923d2d66 Add service description for services. (#21897)
* Add service description for services.

* Make service description more clear
2019-03-17 13:04:09 +01:00
Tyler Page
9b1491a98d Fix AttributeError traceback with darksky (#22101)
* Update darksky.py

* fixes
2019-03-17 12:06:39 +01:00
Jason Hu
1aab551eed Remove hass.config from aws_lambda notify payload (#22125) 2019-03-17 11:42:49 +01:00
Daniel Høyer Iversen
54dfc3e2b4 Tibber, Add price level (#22085)
* Add price level to Tibber sensor

* bump pyTibber version
2019-03-17 09:34:50 +01:00
Otto Winter
cf5ba7d922 Add ESPHome Camera (#22107)
* Add ESPHome Camera

* Bump aioesphomeapi to 1.7.0
2019-03-16 23:36:31 -07:00
Paulus Schoutsen
872ee3eb21 Bumped version to 0.90.0b4 2019-03-16 23:26:48 -07:00
Jason Hunter
f218564185 delete previously removed service option from services yaml (#22123) 2019-03-16 23:26:17 -07:00
Paulus Schoutsen
16ac1d4600 Updated frontend to 20190316.0 2019-03-16 23:25:57 -07:00
Paulus Schoutsen
d16c507f34 Updated frontend to 20190316.0 2019-03-16 23:23:28 -07:00
Jason Hunter
54489a3514 delete previously removed service option from services yaml (#22123) 2019-03-16 23:16:05 -07:00
Paulus Schoutsen
f5076188ef Consolidate all platforms that have no tests (#22096)
* Consolidate

* Fix tests

* Update imports

* Fix import

* Use importlib because integration and package share name

* Fix more tests

* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00
mvn23
d33cad0b24 Improve opentherm gw startup (#22121)
* Improve fix in c90f0d5 (#22106). Schedule connect coroutine directly on the loop rather than waiting for EVENT_HOMEASSISTANT_START.

* Remove unused import.
2019-03-16 23:51:50 +01:00
mvn23
4423572682 Fix TypeError in current_temperature if no temperature is known. (#22112)
Don't set opentherm_gw climate temperatures to 0 on init.
2019-03-16 16:34:31 +01:00
mvn23
c90f0d5bd6 Fix opentherm_gw blocks HA startup when gateway unreachable. (#22106) 2019-03-16 16:32:51 +01:00
Andre Lengwenus
0466e43478 Restricted temperature units for Celsius and Fahrenheit to the standardized units (#22108) 2019-03-16 16:31:58 +01:00
Aaron Bach
7807b40925 Add available property to Ambient PWS (#22092)
* Add available property to Ambient PWS

* Linting

* remove blank line
2019-03-16 11:33:22 +01:00
Phil Bruckner
9e4bd88a06 Bump amcrest to 1.2.7 for correct RTSP port (#22099)
amcrest 1.2.7 now includes camera's configured RTSP port in generated URL. Necessary to make new stream component work correctly if camera does not use default RTSP port.
2019-03-16 08:20:49 +01:00
Ville Skyttä
b4f8d157d6 Upgrade pytest to 4.3.1 (#22088) 2019-03-16 08:13:45 +01:00
Paulus Schoutsen
ade86b9b8d Version bump to 0.91.0dev0 2019-03-15 23:25:48 -07:00
Paulus Schoutsen
179c2315be Updated frontend to 20190315.1 2019-03-15 23:24:37 -07:00
Paulus Schoutsen
7b224dde23 Bumped version to 0.90.0b3 2019-03-15 23:20:19 -07:00
Jason Hunter
7a88c58ffa Beta Fix: FFMPEG and Stream component (#22091)
* remove stream_source from ffmpeg and onvif and add to generic ip cam

* fix tests
2019-03-15 23:19:52 -07:00
Jason Hunter
f396de623b Beta Fix: FFMPEG and Stream component (#22091)
* remove stream_source from ffmpeg and onvif and add to generic ip cam

* fix tests
2019-03-15 23:19:32 -07:00
Paulus Schoutsen
68d1a5322a Prevent cloud remote UI when using 127.0.0.1 as trusted network (#22093)
* Prevent cloud remote UI when using trusted networks

* Limit to 127.0.0.1 trusted network

* Update error msg

* Disable ipv6 loopback
2019-03-15 23:19:26 -07:00
Jeff Irion
a46b64d227 Bump androidtv to 0.0.12 (#22072) 2019-03-15 23:19:26 -07:00
Paulus Schoutsen
5924479272 Updated frontend to 20190315.1 2019-03-15 23:19:09 -07:00
Andre Lengwenus
d0365f5911 Add LCN sensor platform (#21440) 2019-03-15 22:10:56 -05:00
Paulus Schoutsen
dbdf5558e6 Prevent cloud remote UI when using 127.0.0.1 as trusted network (#22093)
* Prevent cloud remote UI when using trusted networks

* Limit to 127.0.0.1 trusted network

* Update error msg

* Disable ipv6 loopback
2019-03-15 19:26:10 -07:00
Nacho Barrientos
42265036ff Telegram_bot: Allow fetching data from unverified SSL endpoints (#22067) (#22069)
* Telegram_bot: Allow fetching data from unverified SSL endpoints (#22067)

This patch adds an extra option to the payload that describes the
resource to send to disable the SSL server verification when polling
data from URLs.

* Use the boolean interpretation of the variable directly

Co-Authored-By: nbarrientos <nacho@criptonita.com>
2019-03-16 09:18:10 +08:00
Jeff Irion
53b204347d Bump androidtv to 0.0.12 (#22072) 2019-03-15 12:25:09 -07:00
Paulus Schoutsen
aa81819683 Fix func 2019-03-15 11:12:12 -07:00
Paulus Schoutsen
dc656205c4 Fix func 2019-03-15 11:11:59 -07:00
Paulus Schoutsen
ff6b86b5a8 Bumped version to 0.90.0b2 2019-03-15 10:59:55 -07:00
Paulus Schoutsen
3d404c43c8 Fix more test 2019-03-15 10:59:50 -07:00
Paulus Schoutsen
b18aef8d31 Fix test 2019-03-15 10:59:50 -07:00
Pascal Vizeli
ac1aeb35a6 Binary Sensor for Remote UI & Fix timezone (#22076)
* Binary Sensor for Remote UI

* Fix lint

* Revert make hass public

* Add tests
2019-03-15 10:59:27 -07:00
Jason Hu
3ec8b5a170 Correct context (#22061) 2019-03-15 10:59:26 -07:00
Paulus Schoutsen
8f10345468 Return config entry ID after creation (#22060) 2019-03-15 10:59:25 -07:00
Robbie Trencheny
0029dc3813 Mobile App: Expose Cloud Remote UI FQDN in registration response (#22055)
* Add a callback to get the cloud remote UI FQDN

* Expose Cloud Remote UI FQDN in the registration response

* Return a URL instead of FQDN
2019-03-15 10:59:25 -07:00
Robbie Trencheny
11ebb3f24e Mobile App: Discovery to default configuration.yaml, zeroconf to default_config (#22028)
* Move discovery into default configuration.yaml

* Add zeroconf to default_config
2019-03-15 10:59:25 -07:00
Robbie Trencheny
4835fb2c57 Mobile App: Enable loading via discovery (surprise inside!) (#22027)
![](http://funpeep.com/wp-content/uploads/2014/04/Cute-White-Cat-Wallpaper.jpg)
2019-03-15 10:59:23 -07:00
Jeff Irion
25a7f71ec2 Bump androidtv to 0.0.11 (#22025) 2019-03-15 10:59:22 -07:00
Robbie Trencheny
f0b7d76e26 Mobile App: Sensors (#21854)
## Description:

**Related issue (if applicable):** fixes #21782

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-15 10:57:24 -07:00
Robbie Trencheny
f7dcfe28b6 Mobile App: Register devices into the registry (#21856)
* Register devices into the registry

* Switch to device ID instead of webhook ID

* Rearchitect mobile_app to support config entries

* Kill DATA_REGISTRATIONS by migrating registrations into config entries

* Fix tests

* Improve how we get the config_entry_id

* Remove single_instance_allowed

* Simplify setup_registration

* Move webhook registering functions into __init__.py since they are only ever used once

* Kill get_registration websocket command

* Support description_placeholders in async_abort

* Add link to mobile_app implementing apps in abort dialog

* Store config entry and device registry entry in hass.data instead of looking it up

* Add testing to ensure that the config entry is created at registration

* Fix busted async_abort test

* Remove unnecessary check for entry is None
2019-03-15 10:57:00 -07:00
Robbie Trencheny
3fd1e8d382 Mobile App: Update Location schema updates & device ID generation (#21849)
* Update location schema

* Generate a random device ID at registration time for later use with device_tracker.see

* Remove host name from device_tracker.see payload

* Drop consider_home from the payload

* Remove stale consider_home in schema

* Remove source_type
2019-03-15 10:56:36 -07:00
Robbie Trencheny
c67113ad55 Mobile App: Support rendering multiple templates at once (#21851)
* Support rendering multiple templates at once

* Only catch TemplateError and dont log the error
2019-03-15 10:56:06 -07:00
Robbie Trencheny
b336322e9e Mobile App: Require encryption for registrations that support it (#21852)
## Description:

**Related issue (if applicable):** fixes #21758

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-15 10:55:45 -07:00
Paulus Schoutsen
9e6a7a6357 Updated frontend to 20190315.0 2019-03-15 10:49:13 -07:00
Paulus Schoutsen
087748b5ff Updated frontend to 20190315.0 2019-03-15 10:43:32 -07:00
Pascal Vizeli
17ba33004c Binary Sensor for Remote UI & Fix timezone (#22076)
* Binary Sensor for Remote UI

* Fix lint

* Revert make hass public

* Add tests
2019-03-15 10:39:53 -07:00
Isabella Gross Alström
9520d38288 Update rest.py (#22077)
Added specific error logs for 5xx and 4xx responses, debug log for 2xx and other statuses.
2019-03-15 10:14:22 -07:00
Jason Hu
cf69f25354 Correct context (#22061) 2019-03-15 10:01:15 -07:00
Fabian Affolter
101225749b Upgrade ruamel.yaml to 0.15.89 (#22064) 2019-03-15 09:22:00 -07:00
Paulus Schoutsen
e581d9e249 Fix more test 2019-03-15 09:14:20 -07:00
Paulus Schoutsen
3ce50b0a6a Fix test 2019-03-15 07:47:13 -07:00
Paulus Schoutsen
941f9b29dc Return config entry ID after creation (#22060) 2019-03-15 07:41:34 -07:00
escoand
3b34594aa3 Add HTTP auth and SSL verification to REST notify (#22016)
* add HTTP auth and SSL verification

* use internal import

* fix long line

* avoid extra import
2019-03-15 08:43:54 +01:00
Robbie Trencheny
5a9e8b2d3e Mobile App: Expose Cloud Remote UI FQDN in registration response (#22055)
* Add a callback to get the cloud remote UI FQDN

* Expose Cloud Remote UI FQDN in the registration response

* Return a URL instead of FQDN
2019-03-14 19:46:59 -07:00
David F. Mulcahey
89c96279ce Cleanup remaining constants stuff in ZHA (#22050)
* clean up constants
* fix quirks until it can be upgradded
2019-03-14 21:00:49 -04:00
Robbie Trencheny
851378739f Fix cloud services.yaml 2019-03-14 17:48:38 -07:00
Alexei Chetroi
9575c20b7c Minor ZHA consts fixes (#22049)
* Use consts for zha.core.consts

* Fix ZHA battery reporting config.
2019-03-14 20:29:12 -04:00
Robbie Trencheny
dcaced1966 Mobile App: Sensors (#21854)
## Description:

**Related issue (if applicable):** fixes #21782

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-14 17:24:53 -07:00
Paulus Schoutsen
fb895bba80 Bumped version to 0.90.0b1 2019-03-14 16:25:00 -07:00
Pascal Vizeli
707d32495b Fix Google Assistant User with Cloud (#22042)
* Fix Google Assistant User with Cloud

* Fix User Agent ID

* respell

* Fix object

* Fix tests

* fix lint

* Fix lint
2019-03-14 16:19:19 -07:00
Jason Hu
7057958e3e Fix lifx light async error (#22031) 2019-03-14 16:19:19 -07:00
emontnemery
90c878a7ed Update additional platforms to use new MQTT message callback (#22030)
* Move additional platforms to new MQTT callback

* Fix automation.mqtt
2019-03-14 16:19:18 -07:00
cgtobi
c78e332df3 Bring back the boiler status (#22021) 2019-03-14 16:19:18 -07:00
Phil Hawthorne
42c9472a74 Remove UTF8 decoding for Waze (#22020)
Removes the UFT8 decoding for the Waze sensor, which broke in 0.89

Fixes #21739
2019-03-14 16:19:17 -07:00
Pascal Vizeli
6a80ffa8cc Fix Google Assistant User with Cloud (#22042)
* Fix Google Assistant User with Cloud

* Fix User Agent ID

* respell

* Fix object

* Fix tests

* fix lint

* Fix lint
2019-03-14 16:18:31 -07:00
Robbie Trencheny
3769f5893a Mobile App: Register devices into the registry (#21856)
* Register devices into the registry

* Switch to device ID instead of webhook ID

* Rearchitect mobile_app to support config entries

* Kill DATA_REGISTRATIONS by migrating registrations into config entries

* Fix tests

* Improve how we get the config_entry_id

* Remove single_instance_allowed

* Simplify setup_registration

* Move webhook registering functions into __init__.py since they are only ever used once

* Kill get_registration websocket command

* Support description_placeholders in async_abort

* Add link to mobile_app implementing apps in abort dialog

* Store config entry and device registry entry in hass.data instead of looking it up

* Add testing to ensure that the config entry is created at registration

* Fix busted async_abort test

* Remove unnecessary check for entry is None
2019-03-14 12:57:50 -07:00
Charles Garwood
62f12d242a Z-Wave usb_path in configuration.yaml overrides config entry usb_path (#22038)
* usb_path in configuration.yaml overrides config entry

* Minor text update

* Update __init__.py
2019-03-14 12:29:21 -07:00
emontnemery
b25e951dcc Update additional platforms to use new MQTT message callback (#22030)
* Move additional platforms to new MQTT callback

* Fix automation.mqtt
2019-03-14 10:58:32 -07:00
Phil Bruckner
8d2d71c16a Bump amcrest to 1.2.6 & use new exceptions (#22040)
* Bump amcrest to 1.2.6 & use new exceptions

* Fix lint failure

* Use AmcrestError instead of individual ones
2019-03-14 10:56:33 -07:00
Fredrik Erlandsson
4e84e8a15e Async support for Daikin (#21638)
* asyncio support for Daikin

* version bump pydaikin

* pass session to pydaikin.Appliance

* all entities should have update
2019-03-14 18:33:43 +01:00
cgtobi
018a5d5c1f Bring back the boiler status (#22021) 2019-03-14 10:18:25 -07:00
Fabian Affolter
bd930b6e96 Upgrade youtube_dl to 2019.03.09 (#22041) 2019-03-14 10:14:27 -07:00
ktnrg45
ef2e3f607a Ps4 remove throttling (#21961)
* Remove throttling

* Correct docstring
2019-03-14 17:49:57 +01:00
Jason Hu
e480f75d6d Fix lifx light async error (#22031) 2019-03-14 17:10:36 +01:00
David F. Mulcahey
300384410f Refactor ZHA gateway into modules and add admin protections to API (#22023)
* refactor

* cleanup

* fix tests

* admin all the things
2019-03-14 10:20:25 -04:00
Daniel Høyer Iversen
b022428cb6 change logging to debug for nmap (#22036) 2019-03-14 10:00:19 -04:00
mvn23
2b25c25ca8 Bump pyotgw to 0.4b2 (#21973) 2019-03-14 13:11:04 +01:00
Jason Hu
4ff8a46acf Upgrade prefetched tox env to py37 (#22029) 2019-03-14 13:09:32 +01:00
kbickar
abf2e763b1 Add sense guard clause (#22014) 2019-03-14 11:46:44 +01:00
Jeff Irion
6381242eca Bump androidtv to 0.0.11 (#22025) 2019-03-14 17:25:07 +08:00
Robbie Trencheny
e75b12b92a Add myself to CODEOWNERS 2019-03-14 00:34:52 -07:00
Robbie Trencheny
95da6d41f9 Mobile App: Discovery to default configuration.yaml, zeroconf to default_config (#22028)
* Move discovery into default configuration.yaml

* Add zeroconf to default_config
2019-03-13 22:05:56 -07:00
Robbie Trencheny
3fcfba0a1e Mobile App: Enable loading via discovery (surprise inside!) (#22027)
![](http://funpeep.com/wp-content/uploads/2014/04/Cute-White-Cat-Wallpaper.jpg)
2019-03-13 21:55:30 -07:00
Phil Hawthorne
2787671de5 Remove UTF8 decoding for Waze (#22020)
Removes the UFT8 decoding for the Waze sensor, which broke in 0.89

Fixes #21739
2019-03-13 19:08:23 -07:00
Robbie Trencheny
673c8907e3 Mobile App: Update Location schema updates & device ID generation (#21849)
* Update location schema

* Generate a random device ID at registration time for later use with device_tracker.see

* Remove host name from device_tracker.see payload

* Drop consider_home from the payload

* Remove stale consider_home in schema

* Remove source_type
2019-03-13 15:38:53 -07:00
Robbie Trencheny
5ef602bc2e Mobile App: Support rendering multiple templates at once (#21851)
* Support rendering multiple templates at once

* Only catch TemplateError and dont log the error
2019-03-13 15:33:37 -07:00
Robbie Trencheny
acc44aaf6c Mobile App: Require encryption for registrations that support it (#21852)
## Description:

**Related issue (if applicable):** fixes #21758

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-13 15:22:43 -07:00
Paulus Schoutsen
07022c46f2 Version bump to 0.90.0b0 2019-03-13 13:03:58 -07:00
Paulus Schoutsen
b601fa52ba Bumped version to 0.89.0b0 2019-03-13 13:02:55 -07:00
Paulus Schoutsen
ce5efcdb26 Merge branch 'master' into dev 2019-03-13 13:02:26 -07:00
Gijs Reichert
1ffc0e3c7c Check updated_date for list and pick first (#22008) 2019-03-13 13:00:58 -07:00
Isabella Gross Alström
2dcd9d94c8 Allow all success status codes in REST notify response (#22011)
For example Discord webhooks returns a 204 success code as response, which gets logged as an error in the log, even though it is successful.
Update the allowed statuses to accept all 2xx responses as successful.
2019-03-13 13:00:08 -07:00
Andrew Sayre
83243e95d3 Remove default temp unit (#22012) 2019-03-13 12:59:37 -07:00
emontnemery
5957e4b75b Pass Message object to MQTT message callbacks (#21959)
* Pass Message object to MQTT message callbacks

* Improve method of detecting deprecated msg callback

* Fix mysensors

* Fixup

* Review comments

* Fix merge error
2019-03-13 12:58:20 -07:00
Paulus Schoutsen
50ec3d7de5 Update translations 2019-03-13 12:57:00 -07:00
Paulus Schoutsen
d0c8f6de56 Updated frontend to 20190313.0 2019-03-13 12:57:00 -07:00
Marco Orovecchia
cac8e34841 Nanoleaf availability check (#21945)
* Added availability check for nanoleaf lights

* pylint errors fixed

* pynanoleaf bump
2019-03-13 12:54:15 -07:00
Jc2k
deb66bb748 HomeKit controller light - remove code that can never execute (#21951) 2019-03-13 12:53:33 -07:00
beavis9k
eed1168fa1 fix error in LutronButton init if Button doesn't have a type (#21921) 2019-03-13 12:52:45 -07:00
Anders Melchiorsen
de2c7a9567 Wait for Sonos regrouping in service calls (#22006) 2019-03-13 12:51:41 -07:00
Anders Melchiorsen
fe5e4b5b9b Avoid playing queue pollution with Sonos unjoin (#22004) 2019-03-13 12:51:08 -07:00
Pascal Vizeli
186b48e2eb Bump NabuCasa library to 0.5 (#22010) 2019-03-13 16:45:26 +01:00
Aaron Bach
a71394a0ce Add program/zone enable/disable services to RainMachine (#21785) 2019-03-13 08:20:13 -06:00
Aaron Bach
897862fca4 Add availability and next run datetime to RainMachine switches (#21786) 2019-03-13 08:19:26 -06:00
endor
18daee9af6 Tellstick sensor configuration cleanup (#21402)
* Cleaned up named sensor handling for future

Breaking change for tellstick sensor configuration.

* Fixed linting of long lines and closing bracket

Linting warning for long line and not using best practice for visual indentation of closing bracket.
Who's a good boy..

* Whitespace on line was not cleaned.

* Removed spaces to clean up

* More.. whitespace. Sloppy.

* Constants from const, altered loops, added dictionary for sensor names.

* Fixed whitespace

* Inverted condition and created guard clause

* Changed condition from not ... in to not in.

* Fixed bad indentation on L91 and 92
2019-03-13 12:20:15 +01:00
Jeff Irion
007bf2bcb5 Rename 'firetv' to 'androidtv' and add Android TV functionality (#21944)
* Working on adding androidtv functionality to firetv component

* 'should_poll' must return True

* Change 'properties' to 'device_properties'

* Also mention 'Android TV' in services.yaml

* Use GitHub for 'androidtv' requirement

* Add 'androidtv==0.0.10' to requirements, remove 'firetv==1.0.9'

* Add 'GET_PROPERTIES' adb command option; use pypi for REQUIREMENTS

* Rename integration from 'firetv' to 'androidtv'

* Change default name to 'Android TV'

* Rename integration from 'firetv' to 'androidtv'

* Change firetv to androidtv in .coveragerc

* Change firetv to androidtv in requirements_all.txt

* Remove 'DEFAULT_APPS'
2019-03-13 11:18:59 +01:00
Jason Hu
e5da7a0014 Add breaking change section to PR template (#21994) 2019-03-13 10:54:30 +01:00
Anders Melchiorsen
c8692fe70c Use asyncio lock (#21985) 2019-03-13 10:17:09 +01:00
Daniel Perna
0162e2abe5 Update pyhomematic to 0.1.58 (#21989) 2019-03-13 08:56:59 +01:00
Paulus Schoutsen
c15f433c3e Add a service require_admin wrapper (#21953)
* Add a service require_admin wrapper

* Allow it to be used as a decorator

* Lint

* Add comment

* Add docstring

* Update syntax
2019-03-12 22:09:50 -07:00
Robbie Trencheny
bf839687ad Mobile App: Registration schema improvements (#21850)
* Update registration schema to add os_name (required) and make app_name required

* Ensure that a provided app_component is valid and available

* Ensure that component DEPENDENCIES declares mobile_app

* Update homeassistant/helpers/config_validation.py

* Standardize error responses

* Dont generalize REGISTER_BAD_COMPONENT

* Fix tests after merge
2019-03-12 22:04:27 -07:00
Diogo Gomes
a99d83390e Centrally define Energy Units (kWh and Wh) (#21719)
* centralize energy units kWh and Wh

* lint
2019-03-12 18:46:41 -07:00
Jc2k
c0b859d8da Set homekit controller entity as unavailable if new connections fail (#21901)
* Set entity as unavailable if new connections fail

* Fix docstring
2019-03-12 18:45:34 -07:00
Daniel Shokouhi
d66cc9befa Add stream source for amcrest component (#21983) 2019-03-12 21:40:24 -04:00
Jc2k
e618e2f348 Fix error introduced by #21933 (#21988) 2019-03-12 18:37:33 -07:00
Robbie Trencheny
9428ed7690 Use .get to ensure we dont get KeyError (#21993) 2019-03-12 18:00:18 -07:00
emontnemery
ce1fe06193 Write state directly in all MQTT platforms (#21971) 2019-03-12 14:46:48 -07:00
Paulus Schoutsen
f8921f84d7 skip flaky test (#21981) 2019-03-12 14:19:11 -07:00
Jc2k
2b1b47bfdd homekit_controller: Bump homekit to 0.13.0 (#21965)
* Bump homekit to 0.13.0

* Update gen_requirements_all.py

* Escape values used in TESTS_REQUIREMENTS
2019-03-12 21:54:08 +01:00
Paulus Schoutsen
97a87b2e4e Merge pull request #21982 from home-assistant/rc
0.89.2
2019-03-12 13:38:43 -07:00
Paulus Schoutsen
737c7e871d Bumped version to 0.89.2 2019-03-12 11:51:09 -07:00
Klaudiusz Staniek
1f3e4c5776 Fixes issues #21821 and #21819 (#21911)
* Fix #21821

* datetime fix

* local time to utc conversion fix

* Test cases update

* date import removed

* Update tod.py
2019-03-12 11:51:02 -07:00
Daniel Shokouhi
00d01865cf Fix botvac when no map exists (#21877) 2019-03-12 11:51:02 -07:00
Jason Hu
1b4905ae5a Override http.trusted_networks by auth_provider.trusted_networks (#21844) 2019-03-12 11:51:00 -07:00
Andrew Sayre
39749952ee Update dependencies to receive data on webhook callbacks (#21838) 2019-03-12 11:51:00 -07:00
Paulus Schoutsen
d3960bf745 Fix some cloud things (#21977) 2019-03-12 11:49:46 -07:00
Paulus Schoutsen
9416af5b56 Allow changing password without being admin (#21978) 2019-03-12 11:49:28 -07:00
Paulus Schoutsen
4a4bb43422 Stream: Only add base url when needed (#21979) 2019-03-12 11:46:20 -07:00
Paulus Schoutsen
d635111e4f Update translations 2019-03-12 11:31:17 -07:00
Paulus Schoutsen
9178ac17ad Updated frontend to 20190312.0 2019-03-12 11:30:50 -07:00
Sidney
1444a684e0 Fix MagicHome LEDs with flux_led component (#20733)
* bug fixing for MagicHome LEDs with flux_led component.

* corrections of the fixes for flux_led

* now asyncio sleep and turn on with brigthness possible

* indention fix with flux_led

* async now works

* houndci fixes

* little fixes for flux_led

* self._color fix for flux_led

* Add docstring
2019-03-12 16:51:51 +01:00
Paulus Schoutsen
d3bab30dbe Add cloud status (#21960)
* Add cloud status

* Expose certificate details

* store & reset last state

* Fix tests

* update tests

* update req

* fix lint
2019-03-12 15:54:04 +01:00
Markus Jankowski
ac97cebe11 Add Weather Sensors to Homematic IP (#21887)
* Add HmIP Weather Sensor Devices

* Fix test and icons

* fix test

* Fix comments
2019-03-12 14:52:13 +01:00
Thom Troy
cc34ee5559 fix ephember doing http call from property (#21855) 2019-03-12 14:49:36 +01:00
kbickar
62df6cbd09 Update to sense component to fully be async (#21698)
* Update to sense component to fully be async

* Shortened lines

* Whitespace
2019-03-12 14:44:53 +01:00
Anders Melchiorsen
dd11f8d3fe Avoid playing queue pollution when restoring Sonos snapshots (#21963)
Assume a snapshot state with three speakers in two groups, AB and C. They will
be playing the A and C queues, respectively. The B queue exists but is hidden
in this topology.

Unjoin B and form a new group BC, playing the B queue (now with the C queue
hidden).

To restore the snapshot we would join B back to A. The BC group would now only
contain the C speaker, still playing the B queue. The C queue has been lost :-(

The problem is that unjoining a coordinator will elect a new coordinator that
inherits the group queue and thus has its hidden queue overwritten.

This commit avoids the situation by having restore unjoin all slaves. Above, C
would be unjoined before joining B to A. This restores the C queue and since B
is then alone, it can be joined to A without having to transfer its playing
queue to remaining speakers.
2019-03-12 14:39:55 +01:00
Robbie Trencheny
2225425ed2 Update lametric icon to be HA logo (#21957) 2019-03-11 20:42:13 -07:00
Jason Hunter
7ccd0bba9a Live Streams Component (#21473)
* initial commit of streams

* refactor stream component

* refactor so stream formats are not considered a platform

* initial test and minor refactor

* fix linting

* update requirements

* need av in tests as well

* fix import in class def vs method

* fix travis and docker builds

* address code review comments

* fix logger, add stream start/stop logs, listen to HASS stop

* address additional code review comments

* beef up tests

* fix tests

* fix lint

* add stream_source to onvif camera

* address pr comments

* add keepalive to camera play_stream service

* remove keepalive and move import

* implement registry and have output provider remove itself from stream after idle, set libav log level to error
2019-03-11 19:57:10 -07:00
Klaudiusz Staniek
0a6ba14444 Fixes issues #21821 and #21819 (#21911)
* Fix #21821

* datetime fix

* local time to utc conversion fix

* Test cases update

* date import removed

* Update tod.py
2019-03-11 21:27:41 +01:00
Fabian Affolter
650658ea01 Upgrade schiene to 0.23 (#21940) 2019-03-11 21:25:29 +01:00
Pascal Vizeli
92ff49212b Offload Cloud component (#21937)
* Offload Cloud component & Remote support

* Make hound happy

* Address comments
2019-03-11 12:21:20 -07:00
Paulus Schoutsen
8bfbe3e085 Add update user command (#21922)
* Add update user command

* Add is_admin to current user
2019-03-11 12:08:02 -07:00
Jc2k
5e2302e469 Add an asyncio Lock around pairing, which cant be used concurrently (#21933) 2019-03-11 11:59:41 -07:00
Paulus Schoutsen
4f5446ff02 Add area permission check (#21835) 2019-03-11 11:02:37 -07:00
David McNett
4f49bdf262 Minor version bump for anthemav package (#21932)
Additional Python 3.7 fixes in the anthemav package.
See also: https://pypi.org/project/anthemav/
2019-03-11 20:47:57 +05:30
Marco Orovecchia
e7c85d350e Changed from nanoleaf_aurora to nanoleaf (#21913)
Nanoleaf component now supports both nanoleaf lights, Aurora and Canvas
Changed the dependency to pynanoleaf, nanoleaf does not seem to be
maintained anymore
2019-03-11 20:46:32 +05:30
Michaël Arnauts
bc76055c17 Allow inverting netdata sensor values (#21711)
* Allow inverting netdata sensor values

* Fix lint issue

* Use parentheses
2019-03-11 20:43:53 +05:30
Robbie Trencheny
785fd273e3 If registration supports encryption then return encrypted payloads (#21853) 2019-03-11 08:34:58 -04:00
Andrew Sayre
c401f35a43 Add cloudhook support to SmartThings component (#21905)
* Add support for Nabu Casa cloudhooks

* Added tests to cover cloudhook creation and removal

* Remove cloud dependency
2019-03-11 08:33:25 -04:00
gertdb
3fd6aa0ba9 Fixes Modbus service.yaml validity (#21923)
* Update __init__.py

* Update services.yaml

* Update services.yaml
2019-03-11 08:17:31 -04:00
Anders Melchiorsen
49014ac13f Remove confusing warning for TTS without entity_id (#21927) 2019-03-11 12:31:36 +01:00
Finbarr Brady
85dc5fe4d5 Update enigma2 based on review comments (#21890)
* Updates based on review comments

* bump netdisco and remove enigma2 init code

* revert netdisco bump
2019-03-11 11:42:56 +01:00
Jc2k
b0d55d1946 HomeKit controller config flow fixes (#21898)
* HomeKit controller config flow fixes

* This does work if you have latest vol-serialize
2019-03-11 10:07:12 +01:00
Brad Dixon
9ab543ab3d Add as_timestamp() to Jinja filters. (#21910)
Add as_timestamp() to Jinja filters
2019-03-11 13:21:22 +05:30
Colby Rome
29f01fb14e Add 'ssl' parameter for FiOS Quantum Gateway and upgrade Pypi (#21669)
* bump pypi version and take 'use_https' parameter

* changed to use CONF_SSL
2019-03-11 12:26:19 +08:00
Paulus Schoutsen
429bbc05dc Add WS subscription command for MQTT (#21696)
* Add WS subscription command for MQTT

* Add test

* Add check for connected

* Rename event_listeners to subscriptions
2019-03-10 20:07:09 -07:00
emontnemery
fc85b3fc5f Don't hang forever if manually added cast is down (#21565)
* Don't hang forever if manually added cast is down

* Adapt to pychromecast

* Do not set available until connected

* Update __init__.py

* Update requirements

* Lint, tests

* Fix tests
2019-03-10 19:57:30 -07:00
Jason Hu
fe1840f901 Deprecate http.api_password (#21884)
* Deprecated http.api_password

* Deprecated ApiConfig.api_password

GitHub Drafted PR would trigger CI after changed it to normal PR.
I have to commit a comment change to trigger it

* Trigger CI

* Adjust if- elif chain in auth middleware
2019-03-10 19:55:36 -07:00
Finbarr Brady
7ec7e51f70 bump netdisco to 2.4.0 (#21914) 2019-03-11 09:49:40 +08:00
Thiago Oliveira
77dc7595ee Allow emulated hue to set climate component temperature (#19034) 2019-03-11 00:04:21 +01:00
Niall Donegan
5debc8828a Return time based attributes as datetime in Unifi module (#21146)
* Return time based data as datetime in Unifi module

* Fix missing space and pylint complaints about import order.
2019-03-10 19:22:28 +01:00
Peter Epley
c888e65f11 Add custom holidays to workday sensor (#21718)
* Add custom holidays to workday sensor

* correcting copy/paste errors

* resolve block comment and add default

* resolve line too long

* fixed handling of no custom holidays

* hound fixes

* rerun Travis

* @fabaff requested changes

* spaces v tabs

* Fix validation
2019-03-10 22:44:45 +05:30
gertdb
bab53a1c94 Modbus write_register accept single value and array (#21621)
* Update __init__.py

* Update services.yaml
2019-03-10 20:38:29 +05:30
Thibault Maekelbergh
65ff8b727a Add myself to CODEOWNERS for NMBS code (#21892)
* Add myself to CODEOWNERS for NMBS code

* Fix
2019-03-10 20:17:17 +05:30
Thibault Maekelbergh
6456f71a46 Fix icon for sensor.discogs_random_record (#21891)
* Fix icon for sensor.discogs_random_record

* Add myself to CODEOWNERS for Discogs code
2019-03-10 19:19:31 +05:30
Marco M
05333f60d7 Fix missing code_required check in async_alarm_arm_night (#21858)
* Fix missing code_required check in async_alarm_arm_night

* Remove double code validation
Test added
2019-03-10 14:25:01 +01:00
Julius Mittenzwei
6f77d9bc34 Don't wait until final position of Velux cover is reached (#21558)
## Description:

* Bump version to latest version of pyvlx: 0.2.10. Library more failure tolerant, when detecting an unsupported device.
* When calling API (e.g. run scene, change position) don't wait until device has reached target position (This caused  HASS to be flaky while the device was moving)
* Support for vertical and horizontal awnings.
2019-03-10 03:47:22 -07:00
Joakim Sørensen
7102e82113 Change lib for whois sensor (#21878)
* Change lib for whois sensor

* Change requirements.txt
2019-03-10 14:38:13 +05:30
Paulus Schoutsen
ad73b6eee9 Updated frontend to 20190309.0 2019-03-09 21:26:35 -08:00
Paulus Schoutsen
5fbe2d5477 Update translations 2019-03-09 21:26:26 -08:00
David F. Mulcahey
5ffb471198 Update ZHA state handling (#21866)
* make device available if it was seen within 2 hours

* more state restore

* cleanup init

* clean up storage stuff

* fix tests

* update state handling
2019-03-09 20:09:09 -08:00
Paulus Schoutsen
5b2c6648fb Add user group (#21832)
* Add user group

* Rename system group to plural
2019-03-09 20:07:29 -08:00
Paulus Schoutsen
14b05b0a91 Fix incorrect 2nd param 2019-03-09 19:52:50 -08:00
Andrew Sayre
5ace55ea8d Add SmartThings sensor support for Three Axis (#21841)
* Add support for Three Axis to sensor platform

* Changes per review feedback.

* Remove unnecessary KeyError except

* Fix lint issue in line wrapping
2019-03-09 18:45:15 -06:00
Andrew Sayre
c927cd9c14 Add SmartThings climate support for Air Conditioners (#21840)
* Add support for Samsung Air Conditioners to Climate

* Changes per review feedback.

* Fix py3.5 compat list sorting in test
2019-03-09 18:43:16 -06:00
Daniel Shokouhi
2d2abc7831 Fix botvac when no map exists (#21877) 2019-03-09 23:06:35 +01:00
Zak
896075fa1c Add ClearPass Policy Manger device tracker (#21673)
* Adding ClearPass Policy Manger device tracker. Amending author

* Cleaned redundant code

* Updated .coveragerc

* Updated requirements_all.txt

* Implemented suggested changes partially.

* Implemented more suggested changes.

* Hound was unhappy

* Implement further suggested changes.

* Make Hound happy.

* Satisfy Travic CI

* Satisfy Travis CI #2

* Hound barking

* pylint else: return

* Implemented suggested changes minus AccessToken

* Removed access token logging

* Removed throttle import

* Removed period from debug string

* Make travis happy :(

* Moved source to new component structure.

* Forgot to rename source.
2019-03-09 22:12:29 +01:00
Paulus Schoutsen
f4f0d363ca Better cloud check (#21875) 2019-03-09 12:15:16 -08:00
David F. Mulcahey
ac5ccd651c Bump quirks for ZHA and handle resulting battery % change (#21869)
* bump quirks and handle battery change

* move inside guard

* round battery
2019-03-09 12:14:58 -08:00
Jason Hu
226be65910 Only commit if need. (#21848) 2019-03-09 12:04:13 -08:00
Paul Bottein
4d9cf15c45 Fix authorization header in cors (#21662)
* Fix authorization headers in cors

* Use aiohttp authorization header instead of custom const
2019-03-09 10:00:10 -08:00
emontnemery
fc81826763 Introduce Entity.async_write_ha_state() to not miss state transition (#21590)
* Copy state in schedule_update_ha_state

* Lint

* Fix broken test

* Review comment, improve docstring

* Preserve order of state updates

* Rewrite

* Break up async_update_ha_state

* Update binary_sensor.py

* Review comments

* Update docstring

* hass -> ha

* Update entity.py

* Update entity.py
2019-03-09 09:52:22 -08:00
Willem Burgers
458548daec Fix TypeError (#21734)
* timediff is of type timedelta. Divide by timedelta does not work.

- convert a timedelta to int
- make sure the test inputs real timestamps

* Convert the total_seconds to decimal and round the result

readings are of type Decimal, so fix test to reflect that

* split line into multiple statements

Line too long

* use total_seconds instead of timediff

* Make both values float instead of Decimal
2019-03-09 17:51:15 +01:00
Hackashaq666
be989ebb7e Update honeywell.py to read current humidity for US Thermostats (#21728)
* Update honeywell.py

Add thermostat humidity reading available in somecomfort for US thermostats.

* Update honeywell.py

* Update honeywell.py
2019-03-09 21:47:28 +05:30
Jason Hu
bbd01968ba Override http.trusted_networks by auth_provider.trusted_networks (#21844) 2019-03-08 23:56:37 -08:00
Robbie Trencheny
9ab0753cf7 mobile_app improvements (#21607)
* First webhook commands for getting and deleting single registrations

* Keep a list of deleted webhook IDs so we can 410 if the webhook receives traffic in the future

* Return a empty JSON object instead of None

* Split up mobile_app bits into individual files

* Add typing

* Sort keys

* Remove unused async_setup_entry

* New decorator method of registering webhooks

* Add tests for cloud hook forwarding and improve error handling for cloud hooks

* Initial implementation of platform specific logic

* Add get registrations by user ID websocket call, minor style fixes

* Stop using resp dictionary during registration

* Move mobile_app/ios.py to ios/mobile_app.py

* Log any errors encountered during webhook

* Improve update registration call

* Split up mobile_app tests to match split up component

* Fix tests

* Remove integration_map in favor of component name in registration

* Add a few helper functions for custom logic components to use

* Load the app_component platform at device registration or component setup time

* Remove extraneous function

* Use guard function for checking if component is in device

* Inline websocket schemas

* Rename ATTR_s used in storage to DATA_ prefix

* squash flake8 and pylint issues

* Remove ios.mobile_app platform

* Dont mark websocket_api as a dependency

* Return standard empty_okay_response with 400 if no JSON sent

* Ensure deleted webhook IDs are registered at launch

* Remove the creation of cloudhooks during handle_webhook

* Rename device to registration everywhere applicable

* Dont check if cloud is logged in, just check if cloud is in components

* Dont ever use cloudhook_id

* Remove component loading logic for a later PR

* Cast exception to string

* Remove unused functions
2019-03-08 23:44:56 -08:00
Aaron Bach
49eaa34e03 Fixed a misspelling in a docstring (#21846) 2019-03-08 22:36:41 -07:00
Andrew Sayre
c5734eecc7 Update dependencies to receive data on webhook callbacks (#21838) 2019-03-08 21:20:07 -08:00
Aaron Bach
113db9afd4 Fix config entry exception in Ambient PWS (#21836) 2019-03-08 21:25:35 -06:00
William Scanlon
012c657a9c Updated to pyeconet 0.0.10 (#21837) 2019-03-08 21:24:17 -06:00
engrbm87
76d11e4b74 fix empty TOPIC_BASE issue (#21740)
* fix empty TOPIC_BASE issue

if the value of the TOPIC_BASE is empty then we need to remove "~" from the topic value if it exists. 
by doing `if base:` on line 239 the condition will be false if the value is empty so the '~' will not be stripped from the topic value.
I simply removed the `if base:` line and added `if TOPIC_BASE in payload:`

* Update homeassistant/components/mqtt/discovery.py

Co-Authored-By: engrbm87 <engrbm87@gmail.com>
2019-03-08 16:48:54 -08:00
Mike Megally
d8ac761bb6 Synology sensor quick return if attr is null (#21709)
* Quick return if attr is null

There are some case where attr is null. Returning null doesn't change anything (in my case this is mapped to a volume that doesn't exist, not sure what others are seeing). 

If you have confirmed you hass instance for C instead of F you do not see this error.

* update == to is

* whitespace
2019-03-08 16:35:38 -08:00
Finbarr Brady
0f189809a9 Add support for Cisco Mobility Express (#21531)
* Move cisco me to new layout

* Add docstring

* Move items out of init method and pass the controller instance to the scanner in get_scanner

* Update homeassistant/components/cisco_mobility_express/device_tracker.py

Co-Authored-By: fbradyirl <fbradyirl@users.noreply.github.com>

* Update homeassistant/components/cisco_mobility_express/device_tracker.py

Co-Authored-By: fbradyirl <fbradyirl@users.noreply.github.com>

* Update homeassistant/components/cisco_mobility_express/device_tracker.py

Co-Authored-By: fbradyirl <fbradyirl@users.noreply.github.com>

* Update homeassistant/components/cisco_mobility_express/device_tracker.py

Co-Authored-By: fbradyirl <fbradyirl@users.noreply.github.com>

* Fix build error

* Cleanup based on comments.
2019-03-09 00:47:06 +01:00
Robbie Trencheny
31a4187cc0 Log if aiohttp hits error during IndieAuth (#21780)
* Log if aiohttp hits error during IndieAuth

* Add content of redirect_url into error log

Co-Authored-By: awarecan <awarecan@users.noreply.github.com>
2019-03-08 14:51:13 -08:00
Jason Hu
3d8673dbf8 Resolve auth_store loading race condition (#21794)
* Add lock in auth_store._async_load()

* Python 3.5 does not like assert_called_once()
2019-03-08 14:50:24 -08:00
Jason Hu
3ff2d99cd6 Load logger and system_log components as soon as possible (#21799) 2019-03-08 14:47:10 -08:00
Paulus Schoutsen
22ab5a498f Change how we import config modules (#21824) 2019-03-08 14:09:18 -08:00
uchagani
ed6082eb2b change paths to be relative (#21827) 2019-03-08 14:08:19 -08:00
Paulus Schoutsen
4c9e5eef9c Remove stub from config component (#21822) 2019-03-08 14:07:49 -08:00
Paulus Schoutsen
3da0ed9cc7 Onboarding to generate auth code (#21777) 2019-03-08 13:51:42 -08:00
Toon Willems
a0e8543aed remove occupancy, as it is not available at this level in the iRail api (#21810) 2019-03-09 02:49:48 +05:30
Greg Dowling
7226e917ed Bump loopenergy to 0.1.0. Loop updated their socket.io server from 0.9 to 2.0 - which required a library update. (#21809) 2019-03-09 02:13:59 +05:30
Finbarr Brady
4571f1bf0d Adding enigma2 media player (#21271)
* Updated based on review comments

* fix hound

* Update homeassistant/components/media_player/enigma2.py

* Update homeassistant/components/media_player/enigma2.py

* Update homeassistant/components/media_player/enigma2.py

* Update enigma2.py

* Update enigma2.py

* Move file and update docsstring

* Fix path in coverage rc file

* requirements

* Update media_player.py

* Setup discovery for e2

* Handle discovered devices

* Add reqs

* Update for auth for openwebif

* Forget to set DEFAULT_PASSWORD

* Add source selection

* Fix get current source name

* Update pip version

* - adding some extra attributes
- support better recording playback integration

* bump pip version

* Bump pip

* Adding prefer_picon config option

* Updates to move logic into pypi module

* bump pip

* bump pip

* - remove http dependancy.

- rename prefer_picon to use_channel_icon

* Bump pypi to fix toggle bug.

also fix travis

also move setup out of init
2019-03-08 14:56:10 +01:00
Ville Skyttä
dfd9f7ccf3 Upgrade huawei-lte-api to 1.1.5 (#21791) 2019-03-08 09:28:53 +01:00
Jose Motta Lopes
f705ac6b43 Add Time of Flight Sensor using VL53L1X (#21230)
* Add Time of Flight Sensor using VL53L1X

* Fix issues found by bot

* Fix issues from bot

* Remove extra logs

* Keep removing logs dependencies not used

* Remove log from update

* Add logger info to async_update

* Fix over-indented line

* Fix pylint error

* Remove logger reporting successful operation

* Update requirements

* Update requirements_all.txt

* Update requirements_test_all.txt

* Used isort to keep imports and added STMicroelectronics to docstring

* Replace time.sleep by asyncio.sleep

* Add requirements to COMMENT_REQUIREMENTS and fix typo

* Using async_add_executor_job to schedule the call in the pool

* Fix typo

* Optimize async_update

* Updated requirements files

* Group and schedule calls that should be run sequentially

* Fix lint errors

* Revision showing development history

* Cleaning and typos

* Cleaning and typos

* Fix wrong-import-order

* Fix gen_requirements_all

* Schedule rpi_gpio I/O on the executor thread pool

* Fix partial parameters

* Fix bot error - add blank line

* Fix lint error

* Remove dependencies from requirements

* Review initial commits

* Move all device I/O to async_update

* Update requirements_all.txt

* Revised header with no url to the docs

* Use async_added_to_hass to add and initialize the sensor

* Add docstring to init()

* Move sensor.open() to async_setup_platform

* Remove logging and async

* Fix typo

* Move sensor.open to safe initialization

* Fix typo

* Fix typo

* Add the new tof module to .coveragerc

* Move the sensor platform under a tof package

* Update .coveragerc and requirements_all for tof package
2019-03-08 08:21:22 +01:00
Paulus Schoutsen
ac4d5d7c30 Merge pull request #21778 from home-assistant/rc
0.89.1
2019-03-07 23:16:17 -08:00
Ville Skyttä
2812483193 Upgrade pylint to 2.3.1 (#21789) 2019-03-08 09:13:35 +02:00
Paulus Schoutsen
f3e8e34089 Add workflow for tests 2019-03-07 17:03:23 -08:00
Paulus Schoutsen
eae6d1c7a6 Bumped version to 0.89.1 2019-03-07 16:48:53 -08:00
William Scanlon
a121c92f52 Updated to newest pyeconet (#21772) 2019-03-07 16:48:47 -08:00
David Thulke
4d6f21ecb2 adds missing SUPPORT_VOLUME_SET flag to webos media_player (#21766) 2019-03-07 16:48:46 -08:00
Sebastian Muszynski
1638d0a92f Bump PyXiaomiGateway version to 0.12.2 (Closes: #21731) (#21764) 2019-03-07 16:48:46 -08:00
Jason Hu
c031fd4164 Fix script load module issue (#21763)
* Fix script load depedency

* Revert #21754
2019-03-07 16:48:45 -08:00
Jason Hu
78a806bc5c Fix script load module issue (#21763)
* Fix script load depedency

* Revert #21754
2019-03-07 16:48:14 -08:00
David Thulke
2fb978393b adds missing SUPPORT_VOLUME_SET flag to webos media_player (#21766) 2019-03-07 16:46:50 -08:00
William Scanlon
a843da1bfc Updated to newest pyeconet (#21772) 2019-03-07 16:46:01 -08:00
Sebastian Muszynski
cfd94ecbbc Bump PyXiaomiGateway version to 0.12.2 (Closes: #21731) (#21764) 2019-03-07 22:55:11 +01:00
Marvin Wichmann
5112f8f6b5 Introduce target_temperature_state_address for climate device (#21541) 2019-03-07 21:53:42 +00:00
Jason Hu
5f0c37ccfc Fix colorlog import error (#21754)
* Fix colorlog import error

* Lint
2019-03-07 11:07:24 -08:00
Jason Hu
c91fb82807 Fix colorlog import error (#21754)
* Fix colorlog import error

* Lint
2019-03-07 11:07:07 -08:00
Daniel Shokouhi
e412317194 Fix botvac connected maps call as it is not a supported model (#21752) 2019-03-07 11:06:42 -08:00
Leonardo Merza
44341a958a automated commit 07/03/2019 10:47:38 (#21749) 2019-03-07 11:06:41 -08:00
Markus Jankowski
5a555102b9 Fix group-switch availability for Homematic IP (#21640)
* Add available=True to groups

* Added unreach to stateattributes

* Fixed comments

* added missing sabotage check

* added missing lowBat check

* fix typo

* apply suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* apply suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* applied suggiestions

* readded lost str()

* fix comment
2019-03-07 11:06:40 -08:00
Markus Jankowski
aebe6ab70c Fix Name of Homematic IP accesspoint in devices, if name is configured (#21617)
* Fix Name of Accesspoint if name is configured

* fix lint

* Simplyfied naming

* applied suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* update comment
2019-03-07 11:06:39 -08:00
Kevin Fronczak
48c9758cf5 Upgrade blinkpy==0.13.1 (Fixes #21559) (#21578)
* Upgrade blinkpy with new api endpoint

* Change wifi units to dBm
2019-03-07 11:06:39 -08:00
Leonardo Merza
e356b48fca automated commit 07/03/2019 10:47:38 (#21749) 2019-03-07 11:03:32 -08:00
Daniel Shokouhi
fc943dc4b6 Fix botvac connected maps call as it is not a supported model (#21752) 2019-03-07 11:03:02 -08:00
Paulus Schoutsen
279470613c Updated frontend to 20190305.1 2019-03-07 10:54:56 -08:00
zewelor
f2abc91c1e Allow light toggle service to accept all turn on params (#20912) 2019-03-07 22:33:30 +05:30
Pascal Vizeli
61786b79f7 Revert pull request to push 2019-03-07 15:33:13 +01:00
Pascal Vizeli
720b0c5334 Revert Travis until github actions work better for PR (#21746) 2019-03-07 15:30:48 +01:00
Pascal Vizeli
5c2d174d5f Change github trigger type 2019-03-07 15:25:27 +01:00
Pascal Vizeli
02bcf46053 Update .travis.yml (#21736)
* Update .travis.yml

* Update tox.ini

* Update main.workflow

* Update tox.ini
2019-03-07 14:40:18 +01:00
Jason Hu
ba70459e1e Remove pytest warning message (#21713) 2019-03-07 16:59:15 +05:30
Markus Jankowski
1891d5bf22 Fix group-switch availability for Homematic IP (#21640)
* Add available=True to groups

* Added unreach to stateattributes

* Fixed comments

* added missing sabotage check

* added missing lowBat check

* fix typo

* apply suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* apply suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* applied suggiestions

* readded lost str()

* fix comment
2019-03-07 11:12:03 +01:00
Markus Jankowski
a46458d04f Fix Name of Homematic IP accesspoint in devices, if name is configured (#21617)
* Fix Name of Accesspoint if name is configured

* fix lint

* Simplyfied naming

* applied suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* update comment
2019-03-07 11:07:32 +01:00
Leonardo Merza
9c70b00403 tplink - catch SmartDeviceException on is_dimmable call (#21726)
* automated commit 06/03/2019 20:49:50

* automated commit 06/03/2019 20:53:13

* automated commit 06/03/2019 20:53:48
2019-03-07 10:54:09 +01:00
Jason Hu
38a93afa66 Make pytest in tox quite (#21727) 2019-03-06 22:27:46 -08:00
Jason Hu
a85119ac09 Fix pylint warning on python 3.7 (#21714) 2019-03-07 06:47:56 +01:00
c-soft
f4a9ad0b2e Fix initialization and add "pending" status of Satel integra (#21194)
* Added updating alarm state after start of the HA. Still rough and dirty.

* Fixed initialization of the panel and binary sensor.  Before cleanup.

* Added alarm clearing, linting fixes.

* Removed dead code, added style changes.

* Updated requirements

* Fixed linting errors.

* Fixed linting errors

* Fixed linter errors.

* Fixed hopefully last linter errors.

* Fixes after code review, imports sorted.

* Removed init debugging
2019-03-06 19:47:47 -08:00
Sergio Oller
9f06be750f Support multiple keys in ifttt triggers (#21454)
* Support multiple keys in ifttt triggers

* Rename `to` to `target` in ifttt.

Follow PR code review suggestions
2019-03-06 19:47:13 -08:00
Jc2k
dbf129dfdd Start preparing for homekit_controller config entries (#21564)
* Start preparing for homekit_controller config entries

* Review feedback

* Review feedback

* Only use the vol.strip validator for pairing_code

* CV not required now

* Changes from review

* Changes after review
2019-03-06 19:44:52 -08:00
Phil Bruckner
5616505032 Change amcrest camera_image to async (#21720)
Change AmcrestCam method camera_image to async so asyncio lock can be used instead of a threading lock. Bump amcrest package to 1.2.5.
2019-03-06 19:42:59 -08:00
Paulus Schoutsen
88bc3033d3 Merge pull request #21712 from home-assistant/rc
0.89.0
2019-03-06 15:15:37 -08:00
Paulus Schoutsen
21de636e5b Bumped version to 0.89.0 2019-03-06 10:07:31 -08:00
Franck Nijhof
87b5faa244 Upgrade toonapilib to 3.2.1 (#21706) 2019-03-06 10:05:32 -08:00
Fredrik Erlandsson
c2f4293c6a resync hass that changes have occured (#21705) 2019-03-06 10:05:31 -08:00
Franck Nijhof
0e36b26770 Upgrade toonapilib to 3.2.1 (#21706) 2019-03-06 07:40:29 -08:00
Diogo Gomes
8e9a496002 Utility Meter offset defined by a time_period (#20926)
* change offset from int to Time period dictionary

* track according to offset

* left overs... tks @fabaff

* typo
2019-03-06 07:55:24 -05:00
Fredrik Erlandsson
54895fcb1e resync hass that changes have occured (#21705) 2019-03-06 07:52:25 -05:00
Alan Tse
b7b034c532 Update to teslajsonpy v0.0.25 (#21702) 2019-03-05 21:44:37 -08:00
Penny Wood
d1038ea79f Google Assistant: Create and pass context to service calls (#21551)
* Google Assistant: Create and pass context to service calls

* Refactor request data into separate object and pass to execute.
2019-03-05 20:00:53 -08:00
Paulus Schoutsen
fc1ee9be43 Use new style for built-in ws commmands (#21694)
* Use new style for built-in ws commmands

* Lint
2019-03-05 19:31:26 -08:00
Paulus Schoutsen
c9b173405b Fix Z-Wave relative imports (#21693) 2019-03-05 17:17:58 -08:00
Paulus Schoutsen
4c72f3c48b Bumped version to 0.89.0b3 2019-03-05 11:46:30 -08:00
carstenschroeder
cb613984df Fix ADS race condition (#21677) 2019-03-05 11:46:19 -08:00
Diogo Gomes
4978a1681e check we have a tb (#21670) 2019-03-05 11:46:18 -08:00
Paulus Schoutsen
2303e1684e Updated frontend to 20190305.0 2019-03-05 11:45:46 -08:00
Paulus Schoutsen
467d8d616e Updated frontend to 20190305.0 2019-03-05 11:45:31 -08:00
Alan Tse
dbb92048aa Bump teslajsonpy to 0.0.24 (#21675)
* Bump teslajsonpy to 0.0.24

* Update requirements_all.txt
2019-03-05 09:23:00 -08:00
Jonathan McDowell
401720085d Allow 202 status code as a successful REST notify response (#21678)
The REST notification component only allows 200 + 201 as a successful
response code to the submission. notify.me returns a 202 (Accepted)
response, which works fine but gets logged as a warning in the log.
Update the allowed statuses to treat the 202 as ok.
2019-03-05 09:22:21 -08:00
Nick Whyte
7d9c14541b Bump nessclient version to 0.9.14 (#21679) 2019-03-05 09:21:13 -08:00
Phil Bruckner
16d79b52c3 Serialize amcrest snapshot commands and bump PyPI package to 1.2.4 (#21664)
* Serialize snapshot commands and bump amcrest package to 1.2.4

Attempting to send a snapshot command when a previous one hasn't finished will result in warnings and/or errors. This can happen when the camera picture is clicked on in the frontend, resulting in the thread that updates the thumbnail in the background every 10 seconds to sometimes collide with the thread that updates the large picture in the foreground quickly. An automation that calls the camera.snapshot service in yet another thread can make the situation worse. Fix by adding a thread lock to serialize snapshot commands. Also bump the amcrest package to 1.2.4 which fixes error handling in the command method and improves performance by reusing requests sessions.

* Update amcrest package to 1.2.4
2019-03-05 17:03:19 +01:00
Steven Looman
3ffff887d8 Adds option in UPnP component to override callback url (#21583)
* Add option to override callback url

* Upgrade to async_upnp_client==0.14.5

* Fix requirements_all.txt
2019-03-05 15:48:44 +00:00
carstenschroeder
17c3c14833 Fix ADS race condition (#21677) 2019-03-05 11:07:40 +01:00
Colby Rome
0e78054195 Xfinity Gateway device_tracker platform (#21026)
* initial commit

* updated .coveragerc, CODEOWNERS, generated requirements_all.txt

* fixed lines exceeding 79 characters

* pylint fixes

* shorten docstring and simplify get_scanner

* extract initialization into get_scanner

* bump pypi version

* name change
2019-03-04 22:57:45 -08:00
Diogo Gomes
efe4ce9a05 check we have a tb (#21670) 2019-03-05 06:18:25 +01:00
ktnrg45
efa5d5dfe3 Add support for multiple devices for PS4 component (#21302)
* Support multiple devices.

* Revert "Support multiple devices."

This reverts commit 3f5d4462a98da13ebb1ab1c07d341dbd7020e6cc.

* Support multiple devices

* Bump to 0.3.3

* bump 0.3.4

* Add tests for multiple devices.

* Update Requirements

* Update config_flow.py

* Update config_flow.py

* fixed typo

* Reordered functions

* Added multiple flow implementation test.

* fix

* typo

* fix tests

* bump 0.4.0

* Bump 0.4.0

* 0.4.0

* bump version

* bump version

* bump version

* Add keep alive feature with multiple devices

* bump version

* bump version

* bump version

* bump 0.4.7

* bump 0.4.7

* bump 0.4.7

* Edited tests.

* bump/pylint

* pylint

* bump/pylint

* bump/pylint

* Change to add additional entry

* Changed to multiple entries

* pylint

* Corrections to manage multiple devices.

* lint

* comments

* Removed redundant for loop

* Shorthand correction

* Remove reference to private object

* Test fix

* Revert changes. Test failure.

* Test fix

* test fix

* unindent assertions

* pylint
2019-03-05 01:48:25 +01:00
Paulus Schoutsen
3135257c0d Bumped version to 0.89.0b2 2019-03-04 16:02:05 -08:00
Paulus Schoutsen
b20b811cb9 Avoid recorder thread crashing (#21668) 2019-03-04 16:01:59 -08:00
Paulus Schoutsen
df25128923 Avoid recorder thread crashing (#21668) 2019-03-04 16:01:31 -08:00
Franck Nijhof
a778cd117f Upgrade toonapilib to 3.1.0 (#21661) 2019-03-04 16:01:15 -08:00
Franck Nijhof
31b88197eb 🚑 Fixes Toon doing I/O in coroutines (#21657) 2019-03-04 16:01:14 -08:00
Paulus Schoutsen
81c252f917 Rename Google Assistant evenets (#21655) 2019-03-04 16:01:13 -08:00
Franck Nijhof
f5a0b5ab98 👕 Corrects unit of measurement symbol for Watt (#21654) 2019-03-04 16:01:12 -08:00
Gijs Reichert
a382ba731d Cast displaytime to int for JSON RPC (#21649) 2019-03-04 15:59:19 -08:00
Paulus Schoutsen
cca8d4c951 Fix calc next (#21630) 2019-03-04 15:59:18 -08:00
Anders Melchiorsen
932080656d Upgrade pysonos to 0.0.8 (#21624) 2019-03-04 15:59:18 -08:00
Jason Hu
d5bdfdb0b3 Resolve race condition when HA auth provider is loading (#21619)
* Resolve race condition when HA auth provider is loading

* Fix

* Add more tests

* Lint
2019-03-04 15:59:17 -08:00
Andrew Sayre
d9806f759b Handle when installed app has already been removed (#21595) 2019-03-04 15:59:16 -08:00
Anders Melchiorsen
e6debe09e8 Word the tplink deprecation warning more strongly (#21586) 2019-03-04 15:59:16 -08:00
Jason Hu
c5dad82211 Log exception occurred in WS service call command (#21584) 2019-03-04 15:59:15 -08:00
Daniel Høyer Iversen
ec9ccf6402 Upgrade PyXiaomiGateway library (#21582) 2019-03-04 15:59:15 -08:00
Jason Hu
a268aab2ec Re-thrown exception occurred in the blocking service call (#21573)
* Rethrown exception occurred in the actual service call

* Fix lint and test
2019-03-04 15:59:14 -08:00
damarco
996e0a6389 Bump zigpy-deconz (#21566) 2019-03-04 15:59:14 -08:00
emontnemery
e877983533 Make time trigger data trigger.now local (#21544)
* Make time trigger data trigger.now local

* Make time pattern trigger data trigger.now local

* Lint

* Rework according to review comment

* Lint
2019-03-04 15:59:13 -08:00
Robbie Trencheny
73675d5a48 mobile_app component (#21475)
* Initial pass of a mobile_app component

* Fully support encryption, validation for the webhook payloads, and other general improvements

* Return same format as original API calls

* Minor encryption fixes, logging improvements

* Migrate Owntracks to use the superior PyNaCl instead of libnacl, mark it as a requirement in mobile_app

* Add mobile_app to .coveragerc

* Dont manually b64decode on OT

* Initial requested changes

* Round two of fixes

* Initial mobile_app tests

* Dont allow making registration requests for same/existing device

* Test formatting fixes

* Add mobile_app to default_config

* Add some more keys allowed in registration payloads

* Add support for getting a single device, updating a device, getting all devices. Also change from /api/mobile_app/register to /api/mobile_app/devices

* Change device_id to fingerprint

* Next round of changes

* Add keyword args and pass context on all relevant calls

* Remove SingleDeviceView in favor of webhook type to update registration

* Only allow some properties to be updated on registrations, rename integration_data to app_data

* Add call service test, ensure events actually fire, only run the encryption tests if sodium is installed

* pylint

* Fix OwnTracks test

* Fix iteration of devices and remove device_for_webhook_id
2019-03-04 15:59:12 -08:00
roblandry
e10e27d809 Add SmartThingsAccelCluster to ZHA binary_sensor (#21609)
* Add SmartThingsAccelCluster to binary_sensor

* Make corrections per discussion with @dmulcahey

* Add missing const to gateway.py

* Remove Acceleration from no sensor
2019-03-04 15:56:05 -08:00
Jason Hu
4a3b4cf346 Resolve race condition when HA auth provider is loading (#21619)
* Resolve race condition when HA auth provider is loading

* Fix

* Add more tests

* Lint
2019-03-04 15:55:26 -08:00
Daniel Høyer Iversen
7a7080055e Netatmo, handle missing thermostat devices (#21651) 2019-03-04 15:54:21 -08:00
Franck Nijhof
955b71c44b 👕 Corrects unit of measurement symbol for Watt (#21654) 2019-03-04 15:53:16 -08:00
Franck Nijhof
73b100d3af 🚑 Fixes Toon doing I/O in coroutines (#21657) 2019-03-04 15:52:00 -08:00
Franck Nijhof
641138a986 Upgrade toonapilib to 3.1.0 (#21661) 2019-03-04 15:51:15 -08:00
Paulus Schoutsen
27e8a6ee80 Rename Google Assistant evenets (#21655) 2019-03-04 13:18:16 -08:00
Alok Saboo
5375510535 Add camera name to logs (#21653) 2019-03-04 12:06:28 -08:00
Paulus Schoutsen
8213016eaf Allow targeting areas in service calls (#21472)
* Allow targeting areas in service calls

* Lint + Type

* Address comments
2019-03-04 09:51:12 -08:00
Nate Clark
f62eb22ef8 Add support for DHT and DS18B20 sensors via Konnected firmware (#21189)
* mvp basic temperature sensor support

* support for DHT temperature & humidity

* add support for ds18b20 sensors

* improve resolution of device settings

* update requirements_all.txt

* re-organize new file

* don't use filter(lambda: syntax

* set unique_id on entities to allow renaming in the UI

* leverage base Entity module to do C to F conversion

* add option for setting poll_interval

* use handler pattern to handle updates from Konnected device

* cleanups from code review
2019-03-04 16:56:41 +01:00
Gijs Reichert
158e25562b Cast displaytime to int for JSON RPC (#21649) 2019-03-04 15:25:28 +01:00
Pascal Vizeli
72b6e80d02 Better output of workflow 2019-03-04 14:06:05 +01:00
Fabian Affolter
eb1d7be67c Upgrade youtube_dl to 2019.03.01 (#21647) 2019-03-04 14:00:10 +01:00
Pascal Vizeli
c60627c699 GitHub Workflow (#21643)
* Fix tox.ini

* Update main.workflow

* Update tox.ini

* Update main.workflow

* Update main.workflow

* Update tox.ini

* Try only with one

* Update main.workflow

* Update main.workflow

* Update main.workflow

* Update main.workflow

* Update main.workflow
2019-03-04 12:36:50 +01:00
Pascal Vizeli
5c9f266672 Fix actions with tox (#21642)
* Fix actions with tox

* Update main.workflow
2019-03-04 10:23:19 +01:00
Pascal Vizeli
5efcbc5043 Replace travis (#21641) 2019-03-04 09:59:35 +01:00
Nick Whyte
10e334cbf0 Allow configuration of update interval for ness_alarm (#21415)
* ness_alarm: Allow configuration of update_interval

* requirements

* update_interval -> scan_interval

* Consistent config validation

* requirements

* don't touch dependency version
2019-03-04 00:05:44 -08:00
Paulus Schoutsen
43f85f7053 Updated frontend to 20190303.0 2019-03-03 22:41:38 -08:00
Paulus Schoutsen
c03116291e Updated frontend to 20190303.0 2019-03-03 21:55:51 -08:00
Paulus Schoutsen
de9e6e8d1a Update translations 2019-03-03 21:53:45 -08:00
David F. Mulcahey
fc07d3a159 Add storage helper to ZHA and use it for the device node descriptor (#21500)
* node descriptor implementation

add info to device info

disable pylint rule

check for success

* review comments

* send manufacturer code for get attr value for mfg clusters

* ST report configs

* do zdo task first

* add guard

* use faster reporting config

* disable false positive pylint
2019-03-03 21:22:42 -08:00
Jason Hu
ee6f09dd29 Log exception occurred in WS service call command (#21584) 2019-03-03 21:22:22 -08:00
Paulus Schoutsen
48a2e50f84 Fix calc next (#21630) 2019-03-03 21:36:13 -07:00
Paulus Schoutsen
f5ed6432eb Expose create/delete cloudhook (#21606)
* Expose create/delete cloudhook

* Make sure we dont publish cloudhooks when not connected
2019-03-03 19:03:49 -08:00
shanbs
c25cbccca9 Return Netatmo climate operation_mode instead of boiler status (#21633)
* Merge the devices into one list and add into entries at once; Return operation_mode instead of boiler status.

* Removing property operation_mode
2019-03-04 02:42:29 +01:00
Aaron Bach
31bcf6c35f Bump pyflunearyou to 1.0.3 (#21634) 2019-03-03 18:39:13 -07:00
Willem Burgers
2017e45d78 fix derived rate, fixes #20097 (#21620)
* fix derived rate, fixes #20097

* fix derived rate, fixes #20097

* Fix typo

thnx @amelchio

* Make the test more realistic

Took values from my own smart meter for the test

* Update test to ignore rounding issues
2019-03-03 23:42:52 +01:00
srirams
818776d2b4 Add optional sender name for SendGrid (#21610)
* Set "Home Assistant" as email sender name for SendGrid

* make sender name configurable

* sendgrid tweaks

* fix config
2019-03-03 13:44:40 -08:00
Jeff Irion
fa938f5628 Add 'app_name' property and 'apps' config entry to Fire TV (#21601)
* Add 'app_name' property and 'apps' config entry to Fire TV

* Define 'CONF_APPS', don't import it

* Address reviewer comments
2019-03-03 12:39:39 -08:00
Markus Jankowski
3032283b99 Add device HMIP-eTRV-C to HomematicIP (#21612)
* Update dependencies

* Add additional device HMIP-eTRV-C

add valveActualTemperature to HeatingThermostats (HMIP-eTRV-C, HMIP-eTRV, HMIP-eTRV-2)

* Removed HomematicipThermostatTemperatureSensor

already in climate
2019-03-03 12:33:48 -08:00
kennedyshead
1308ead8d6 Bumping aioasuswrt (#21627) 2019-03-03 12:31:09 -08:00
Andrew Sayre
3e0459cef9 SmartThings remove SmartApp/Automation on integration removal (#21594)
* Add clean-up logic upon entry removal

* Removed unecessary app removal from migration

* Change log level and clarified code
2019-03-03 13:47:25 -06:00
Anders Melchiorsen
0f6e0aa355 Upgrade pysonos to 0.0.8 (#21624) 2019-03-03 18:49:29 +01:00
Maikel Punie
b985223603 Add the velbus sync clock service (#21308)
* Add the velbus sync clock service

* Fixed houndci-bot commants

* Fix lint and pylint

* fixed all comments

* Hound bot comments

* Fix for flake8
2019-03-03 06:37:36 -06:00
Andrew Sayre
1e60993aa7 Handle when installed app has already been removed (#21595) 2019-03-02 21:57:57 -06:00
shanbs
18372ad81b Added support for multiple Netatmo thermostats/valves (#19407)
* climate/netatmo: Added support for muletiple thermostats/valves

* Adjusted the update interval throttle to 10 seconds

* Avoid returning 'homes' without 'therm_schedules'

* Requires home to have 'modules' as well as 'therm_schedules'; Using pyatmo 1.7

* Support multiple homes

* Fix nest level too deep issue

* Fix crashing bug when discovery is true

* Fix crashing bug when discovery is true

* Modifications according to review comments

* Resolve format issue

* Fix mode name issue

* Revisions according to review's suggestions

* Revisions according to review's comments

* Revisions according to review's comments
2019-03-02 19:51:42 -08:00
Matt White
18491c515f Further Yale ZWave lock device mapping cleanup (#21128)
* Update device mapping for workarounds from zwave device db

* Update comment on old Yale vendor ID
2019-03-02 20:29:16 -06:00
Rohan Kapoor
9af8c95e83 Upgrade motorparts to 1.1.0 (#21602) 2019-03-02 20:23:17 -06:00
ehendrix23
833f17de04 Add parameter hold_secs for Harmony remote send command (#19650)
* Update requirements

Updated requirements

* Small bump for aioharmony

Small version bump increase for aioharmony

* Add attributes

Add firmware and config version attributes

* Add hold for button press on send_command

* Fix requirements file

For some reason aioharmony ended up in there as a duplicate. Fixed it.

* Revert rebase changes

Revert some changes that should have been reverted back as part of rebase.

* Updated based on review

Removed HOLD_SECS from platform schema (configuration)
Updated getting kwargs in async_send_command
Updated debug log to include delay_secs
2019-03-03 00:54:03 +01:00
Daniel Perna
b8eebda541 Update pyhomematic (#21600) 2019-03-02 17:42:51 -05:00
David F. Mulcahey
45316f6ed6 ZHA fixes (#21592)
* do not report on 0x1000 LightLink cluster
* don't flood Zigbee network during configuration or initialization
* add lifeline of 60 minutes to lights
* use ootb polling
2019-03-02 14:09:01 -05:00
Anders Melchiorsen
5eab86986e Word the tplink deprecation warning more strongly (#21586) 2019-03-02 12:32:18 +01:00
Joe Trabulsy
61e4a6be18 Update for new pyvesyncv_v2 library and vesync switch support (#21449)
* Change dependency to pyvesync-v2 for vesync switch

* Update requirements_all.txt

* Update Version - Wall Switch Support

Update required version for vesync outlets and switches.  Eliminate API call for energy usage for wall switches that do not have that feature

* fix name convention
2019-03-02 11:57:10 +01:00
Diogo Gomes
1ad4779443 Add network throughput statistics to systemmonitor sensor (#21575)
* add network throughput

* lint
2019-03-02 16:08:15 +05:30
Diogo Gomes
ed2b9e5483 Centrally define Watt (#21570)
* centralize Watt definition

* lint
2019-03-02 11:29:59 +01:00
Kevin Fronczak
e55ce61100 Upgrade blinkpy==0.13.1 (Fixes #21559) (#21578)
* Upgrade blinkpy with new api endpoint

* Change wifi units to dBm
2019-03-02 11:28:44 +01:00
Daniel Høyer Iversen
8e75bfb11e Upgrade PyXiaomiGateway library (#21582) 2019-03-02 11:27:36 +01:00
Penny Wood
f61f650495 Get room hints from areas (#21519)
* Get google room hint from area.

* Test case for area code.

* Updates as per code review.
2019-03-01 23:31:57 -08:00
Anders Melchiorsen
0c8a31b8ec Memory optimization for logbook (#21549) 2019-03-01 23:23:45 -08:00
Jason Hu
f1b867dccb Re-thrown exception occurred in the blocking service call (#21573)
* Rethrown exception occurred in the actual service call

* Fix lint and test
2019-03-01 23:09:31 -08:00
emontnemery
cd89809be5 Make time trigger data trigger.now local (#21544)
* Make time trigger data trigger.now local

* Make time pattern trigger data trigger.now local

* Lint

* Rework according to review comment

* Lint
2019-03-01 23:09:12 -08:00
Robbie Trencheny
655ada1374 mobile_app component (#21475)
* Initial pass of a mobile_app component

* Fully support encryption, validation for the webhook payloads, and other general improvements

* Return same format as original API calls

* Minor encryption fixes, logging improvements

* Migrate Owntracks to use the superior PyNaCl instead of libnacl, mark it as a requirement in mobile_app

* Add mobile_app to .coveragerc

* Dont manually b64decode on OT

* Initial requested changes

* Round two of fixes

* Initial mobile_app tests

* Dont allow making registration requests for same/existing device

* Test formatting fixes

* Add mobile_app to default_config

* Add some more keys allowed in registration payloads

* Add support for getting a single device, updating a device, getting all devices. Also change from /api/mobile_app/register to /api/mobile_app/devices

* Change device_id to fingerprint

* Next round of changes

* Add keyword args and pass context on all relevant calls

* Remove SingleDeviceView in favor of webhook type to update registration

* Only allow some properties to be updated on registrations, rename integration_data to app_data

* Add call service test, ensure events actually fire, only run the encryption tests if sodium is installed

* pylint

* Fix OwnTracks test

* Fix iteration of devices and remove device_for_webhook_id
2019-03-01 23:08:20 -08:00
Andrew Sayre
0903bd92f0 Add config entry remove callback (#21576) 2019-03-01 21:13:55 -08:00
David F. Mulcahey
cd6c923123 fix exception (#21571) 2019-03-01 20:15:36 -05:00
Wagner Sartori Junior
b8ec74cc15 bump pyxeoma to 1.4.1 to fix and close #19306 (#21568) 2019-03-01 20:11:32 -05:00
damarco
1a9dcaefd2 Bump zigpy-deconz (#21566) 2019-03-01 13:47:20 -05:00
Paulus Schoutsen
52f337ef00 Allow chaining contexts (#21028)
* Allow chaining contexts

* Add stubbed out migration
2019-03-01 10:08:38 -08:00
David F. Mulcahey
b39846fb6b add friendly name to devices in the device registry (#21499)
switch to name_by_user

review comments

add device reg info to zha device api
2019-03-01 08:11:24 -05:00
msvinth
0aba49adce Add separate on/off ids on manual configured IHC lights (#20253)
* Add support for separate on/off ids on manual configured IHC lights.
This makes it easier to support IHC code units thats relies on being
turned on and off through specific inputs.
Also adds a pulse service (ihc.pulse) that supports sending a short on/off pulse to an IHC input.

* Fix

* Lint fix

* Add on/off id support in switch

* Make pulse async

* Code review fixes
2019-03-01 08:17:59 +01:00
Paulus Schoutsen
ee4be13bda Allow config entry reloading (#21502)
* Allow config entry reloading

* Fix duplicate test name

* Add comment

* fix typing
2019-02-28 22:27:20 -06:00
David F. Mulcahey
aa30ac52ea prevent duplicate event channel registration (#21534) 2019-02-28 22:53:59 -05:00
Aaron Bach
326513af90 Add pause/unpause services to RainMachine (#21548)
* Add pause/unpause services to RainMachine

* Update requirements
2019-02-28 17:58:39 -08:00
Paulus Schoutsen
ed28482311 Bumped version to 0.89.0b1 2019-02-28 17:58:23 -08:00
Aaron Bach
0f09c02875 Fix incorrect pyairvisual call (#21542) 2019-02-28 17:46:32 -08:00
Jason Hu
97b93bcf7b Fix warning (#21538) 2019-02-28 17:46:31 -08:00
emontnemery
b05062e9d9 Add missing retain option to mqtt.climate configuration schema (#21536) 2019-02-28 17:46:31 -08:00
Victor Vostrikov
6f2dd21516 Updated variable name for readability (#21528) 2019-02-28 17:46:30 -08:00
Jason Hu
eda2290d47 Allow skip-pip applied to HA core (#21527) 2019-02-28 17:46:30 -08:00
Paulus Schoutsen
238c4247d9 Only use a single store instance (#21521) 2019-02-28 17:46:30 -08:00
Paulus Schoutsen
4fe9f966ad Fix lint (#21520) 2019-02-28 17:46:29 -08:00
Anders Melchiorsen
26a534a67c Improve new Sonos snapshot/restore (#21509)
* Fine-tune new Sonos snapshot/restore

* Move into class
2019-02-28 17:46:29 -08:00
Aaron Bach
aa546b5a1f Add watchdog to Ambient PWS (#21507)
* Add watchdog to Ambient PWS

* Better labeling

* Owner comments
2019-02-28 17:46:28 -08:00
Robert Svensson
9e140d27bf Fix deCONZ retry mechanism for setup 2019-02-28 17:45:41 -08:00
Ben Randall
e6cbdf0645 Add PLATFORM_SCHEMA_BASE to telegram_bot component (#21155) 2019-02-28 17:44:04 -08:00
Paulus Schoutsen
1c889cfcc3 Updated frontend to 20190228.0 2019-02-28 17:43:48 -08:00
Paulus Schoutsen
5e67054ee1 Updated frontend to 20190228.0 2019-02-28 17:43:36 -08:00
David F. Mulcahey
901b2b4ba3 new websocket api way (#21533) 2019-02-28 19:32:41 -05:00
Aaron Bach
b8a94c30e8 Add watchdog to Ambient PWS (#21507)
* Add watchdog to Ambient PWS

* Better labeling

* Owner comments
2019-02-28 14:28:20 -08:00
Martin Hjelmare
40d7fbcda4 Clean up gpslogger tests (#21543) 2019-02-28 14:17:53 -08:00
Aaron Bach
8ebe5c61e8 Fix incorrect pyairvisual call (#21542) 2019-02-28 14:17:10 -08:00
Diogo Gomes
81dd2acf3b Update CODEOWNERS (#21545)
add myself to camera.push
2019-02-28 14:16:51 -08:00
Anders Melchiorsen
193cab4f62 Improve new Sonos snapshot/restore (#21509)
* Fine-tune new Sonos snapshot/restore

* Move into class
2019-02-28 10:25:31 -08:00
Jason Hu
b18b1cffff Fix warning (#21538) 2019-02-28 10:10:21 -08:00
cpopp
84b84559a4 Add support for homekit controller sensors (#21535)
Adds support for homekit devices with temperature, humidity, and
light level characteristics (such as the iHome iSS50)
2019-02-28 10:09:04 -08:00
David F. Mulcahey
82bdd9568d Add direct binding for remotes and lights for ZHA (#21498)
* cluster matching and binding apis

implement binding

callback

fix loop

fix loops

* review comments

* use any because it is clearer
2019-02-28 10:04:35 -08:00
Jason Hu
5ce4fe65b2 Allow skip-pip applied to HA core (#21527) 2019-02-28 10:01:10 -08:00
Paulus Schoutsen
4f4a8a61d2 Only use a single store instance (#21521) 2019-02-28 10:00:17 -08:00
Ben Randall
e14c8c788e Add PLATFORM_SCHEMA_BASE to telegram_bot component (#21155) 2019-02-28 18:27:40 +01:00
emontnemery
c340083ba5 Add missing retain option to mqtt.climate configuration schema (#21536) 2019-02-28 18:26:54 +01:00
Marco M
c3d4738649 Mqtt alarm added value_template and code_arm_required (#19558)
* Added value_template config for parsing json value from state topic

Added arm_code_required to avoid code enter when arming

* Renamed config parameter to code_arm_required

* Fix for discovery update compatibility

* Fixed lint error

* Added test
2019-02-28 17:44:23 +01:00
Fabian Affolter
b0dd6e4093 Upgrade python-mystrom to 0.5.0 (#21523) 2019-02-28 17:46:38 +05:30
Fabian Affolter
3e8e998078 Upgrade numpy to 1.16.2 (#21525) 2019-02-28 17:46:21 +05:30
Victor Vostrikov
342ddbfe8c Updated variable name for readability (#21528) 2019-02-28 17:35:39 +05:30
koolsb
bfc6f51b25 Add arm night for alarm decoder (#21488) 2019-02-28 17:15:17 +05:30
Jeff Irion
27a780dcc9 Register 'firetv.adb_command' service (#21419)
* Register 'media_player.firetv_adb_cmd' service

* Wrap the 'firetv_adb_cmd' service with 'adb_decorator'

* Address reviewer comments

* Move firetv to its own platform

* Move 'adb_command' service description

* Rename DOMAIN to FIRETV_DOMAIN

* Import KEYS in __init__ method

* Change 'self.KEYS' to 'self.keys'

* Update firetv in .coveragerc

* 'homeassistant.components.media_player.firetv' -> 'homeassistant.components.firetv'

* 'homeassistant.components.firetv' -> 'homeassistant.components.firetv.media_player'
2019-02-28 12:29:56 +01:00
Fabian Affolter
6f2def06be Upgrade opensensemap-api to 0.1.5 (#21524) 2019-02-28 11:59:14 +01:00
Paulus Schoutsen
229d19bb20 Fix lint (#21520) 2019-02-27 21:35:14 -08:00
Adam Dullage
548d7bbeda Bump starlingbank version to 3.1 (#21501)
* Bump starlingbank version to 3.1

Resolves Python 3.5 compatibility issue.

* Remove syntax error.
2019-02-28 09:53:21 +05:30
Aaron Bach
aad15776c0 Upgrade pyflunearyou to 1.0.2 (#21514) 2019-02-27 17:52:50 -07:00
Aaron Bach
c1365de861 Upgraded py17track to 2.2.2 (#21515) 2019-02-27 17:52:31 -07:00
Aaron Bach
fd32910185 Upgrade pytile to 2.0.6 (#21516) 2019-02-27 17:52:05 -07:00
Aaron Bach
1369b0b583 Upgrade pypollencom to 2.2.3 (#21517) 2019-02-27 17:51:36 -07:00
Aaron Bach
4ca7273c58 Upgrade pyopenuv to 1.0.9 (#21513) 2019-02-27 17:51:09 -07:00
Paulus Schoutsen
45bbe75d29 Bumped version to 0.89.0b0 2019-02-27 16:45:14 -08:00
Victor Vostrikov
4a45510c88 Changed source priority for Person (#21479)
* Added gps accuracy to Person

* Corrected GPS accuracy for Person

* Added priority of sources to Person

* Fixed formatting

* Removed rounding of coordinates.

* Added test for source priority.
Changed test for rounding of coordinates.

* Improved code style

* Code style cleanup

* Code style cleanup

* Code style cleanup

* Code style cleanup

* Code style cleanup

* Lint

* Lint
2019-02-27 16:40:23 -08:00
msvinth
070320a24a Bump ihc to 2.3.0 (#21494) 2019-02-27 16:39:11 -08:00
Nick Whyte
1ef3e32d4a ness_alarm: Bump nessclient version to 0.9.13 (#21466) 2019-02-27 16:38:53 -08:00
Paulus Schoutsen
c9ade6ee85 Merge remote-tracking branch 'origin/master' into dev 2019-02-27 16:34:47 -08:00
Paulus Schoutsen
78217fa9b0 Update translations 2019-02-27 16:34:13 -08:00
Paulus Schoutsen
f3bb9e870e Updated frontend to 20190227.0 2019-02-27 16:33:56 -08:00
Daniel Høyer Iversen
732110b4c3 Upgrade tibber lib (#21486) 2019-02-27 16:33:26 -08:00
Aaron Bach
ab2be6df48 Upgrade aioambient to 0.1.3 (#21510) 2019-02-27 16:27:26 -08:00
Aaron Bach
e4b2aab1e9 Bump simplisafe-python to 3.4.1 (#21511) 2019-02-27 16:27:13 -08:00
Aaron Bach
3749321fa5 Upgrade pyairvisual to 3.0.1 (#21512) 2019-02-27 16:26:59 -08:00
Paulus Schoutsen
63fda29eaf Merge pull request #21508 from home-assistant/rc
0.88.2
2019-02-27 16:19:26 -08:00
Jeff Irion
0ebd12fa6c Avoid unnecessary commands in Vizio update function (#20867) 2019-02-27 16:08:02 -08:00
Paulus Schoutsen
14f912500e Pin isort (#21463) 2019-02-27 15:28:22 -08:00
Paulus Schoutsen
651b0d3506 Fix cherry-pick fail ST 2019-02-27 15:27:55 -08:00
Paulus Schoutsen
626f8a8b09 Bumped version to 0.88.2 2019-02-27 15:25:21 -08:00
Sebastian Muszynski
51eb6c7b4e Bump PyXiaomiGateway version to 0.11.2 (#21453) 2019-02-27 15:25:14 -08:00
Andrew Sayre
2c10327945 Improve tolerance of SmartThings Climate platform (#21383)
* Improve resilience of platform with buggy handlers

* Eliminate possibility of None in operation list

* Refactor variable name
2019-02-27 15:24:50 -08:00
yosilevy
d1349d4919 Scene validator fix (#21362) 2019-02-27 15:24:00 -08:00
Martin Hjelmare
0f4c2ccd1e Fix person update on create (#21355)
* Update tests to set correct hass running state

* Update person on adding person if hass is running

* Test creating person when hass is running
2019-02-27 15:23:59 -08:00
David Conley
f6811a85b6 Allow custom_effect to be absent from Flux configuration (#21317)
* Allow custom_effect to be absent from Flux configuration

* set custom effect to none during setup
2019-02-27 15:23:59 -08:00
Paulus Schoutsen
fbfa3d1a18 Make sure that device trackers is always a list during creation (#21193) 2019-02-27 15:23:58 -08:00
CV
8a026bf214 HomeMatic: Add error-attribute (#21009)
Error attribute has different meanings depending on device
2019-02-27 23:09:49 +01:00
Daniel Høyer Iversen
519315f9c8 pylint 2.3.0 (#21485)
* pylint 2.3.0

* remove const

*  disable=syntax-error
2019-02-27 16:10:40 -05:00
Robert Svensson
2482816a11 Fix deCONZ retry mechanism for setup 2019-02-27 21:04:55 +01:00
Penny Wood
b87eb9d79e Fire events when Google Assistant commands come in #15139 (#20204) 2019-02-27 11:33:34 -08:00
Markus Jankowski
9b3a3fc1ac Add device_info to enable HA-devices for Homematic IP (#21241)
* add device_info to device

* added checks

* Fixes based on feedback

* Fix spelling

* Simplified implementation

On homematicip devices and the ap are created

* small fix with device.id

* hub/ap device creation moved to __init__.py

* Fixed result handling

* fixes after review.

* Fix test
2019-02-27 11:25:11 -08:00
Alexei Chetroi
9066609d23 Refactor async_turn_on() for ZHA Light. (#21156)
* Refactor async_turn_on() for ZHA Light.

Use "move_to_level_with_on_off" if brightness or transition attributes
are present in the service call data, otherwise issue "On" Zigbee
command.
Allow brightness of 0 for service call -- effectively turning the light
off.
Send color commands only after the light was turned on.

* Fix zha.light tests.
2019-02-27 08:34:38 -05:00
Fabian Affolter
27e6c6665f Upgrade astral to 1.10.1 (#21474) 2019-02-27 14:07:51 +01:00
Fabian Affolter
0b68da2f88 Upgrade shodan to 1.11.1 (#21478) 2019-02-27 14:07:26 +01:00
Fabian Affolter
01ee92177f Upgrade bcrypt to 3.1.6 (#21476) 2019-02-27 14:07:02 +01:00
Tomas Hellström
33c9afd6e0 Added a digit for precipitation (#21439) 2019-02-27 11:07:35 +05:30
Kevin Tuhumury
28f9c7c2cd Add cpu_use_percent as a new resource to the Glances sensor. (#21455) 2019-02-27 10:54:09 +05:30
Petro31
51773f338e Add person support for Waze Travel Time (#21471)
Adds person to the list of TRACKABLE_DOMAINS domains.  _get_location_from_entity will handle the person domain without any changes.
2019-02-26 20:02:49 -08:00
dfournie
822b6328e1 Add Somfy IO Garage door (#21320)
* Add Somfy IO Garage door

* Fix code style
2019-02-26 22:22:29 -05:00
Paulus Schoutsen
e9f79c3d06 Lint 2019-02-26 18:50:34 -08:00
blackray12
be78265631 Add mitemp bt sensor device class (#20293)
* Fix HomeKit missing humidity issue

When using HomeKit components, MiTemp BT's humidity state will not display in Home.app.
After Added home-assistant device class into property, this problem is solved.

* Add Device_Class_Battery to property

* Break long lines.

* Lint
2019-02-26 15:10:25 -08:00
Thibault Maekelbergh
4d4cd2d752 Update sensor.nmbs to support vias better + show on map (#20063)
* Add the destination stations to the attributes

* Add support for showing station on map

* Add option to exclude via connections

* Cleanup the live sensor

* Perform better checking against false i/o None values

* Add support for excluding vias

* Add more details for via trains

* Lint file

* Update logger level
2019-02-26 15:08:25 -08:00
Daniel Høyer Iversen
efa48848a5 Comment out bluepy libraries from requirements_all.txt (#20856)
* Comment bluepy libraries from requirements_all.txt, fixes #20778

* Comment bluepy libraries from requirements_all.txt, fixes #20778

* Comment bluepy libraries from requirements_all.txt, fixes #20778
2019-02-26 14:50:48 -08:00
William Scanlon
9cff1dd4ba Added new econet states (#21420) 2019-02-26 14:49:15 -08:00
Mattias Welponer
42e691c194 Add HomematicIP HmIP-OC8 module (#21401)
* Add support for HmIP-OC8 module

* Fix line lenght
2019-02-26 14:48:19 -08:00
Jason Hu
7bae76843c Add config for trusted networks auth provider (#21111)
* Add config for trusted networks auth provider

* Lint

* Fix typing

* Fix pylint

* Fix lint

* Add some log information

* Add http.trusted_networks deprecated warning

* Remove log info

* Lint
2019-02-26 14:42:48 -08:00
Paulus Schoutsen
5c2f997394 Lint 2019-02-26 14:42:09 -08:00
Leonardo Merza
e739fd8a31 Reddit Sensor (#21344)
* init

automated commit 22/02/2019 22:55:49

cr comments

cr comments

automated commit 24/02/2019 14:41:08

automated commit 24/02/2019 14:41:59

automated commit 24/02/2019 14:54:16

automated commit 24/02/2019 14:54:49

automated commit 24/02/2019 19:46:15

automated commit 25/02/2019 10:10:46

automated commit 25/02/2019 10:10:52

automated commit 25/02/2019 10:12:16

automated commit 25/02/2019 10:15:59

* automated commit 25/02/2019 12:26:38

* automated commit 25/02/2019 13:55:52
2019-02-26 13:55:11 -08:00
René-Marc Simard
aa472d4f10 Adjust GTFS dates when crossing midnight (#20916) 2019-02-26 13:17:20 -08:00
Andrew Sayre
3b9db88065 Add SmartThings Scene platform (#21405)
* Add SmartThings Scene platform

* Fixed failing tests after rebase

* Update cover tests.
2019-02-26 13:12:24 -08:00
Paulus Schoutsen
344e839bec Remove launching a server in a test (#21445) 2019-02-26 13:06:27 -08:00
Sebastian Muszynski
e119deafe5 Bump PyXiaomiGateway version to 0.11.2 (#21453) 2019-02-26 12:37:21 -08:00
Patrick T.C
dc6fd780a9 Fix for Snips platform update that breaks hermes api. (#21443) 2019-02-26 12:37:01 -08:00
Otto Winter
29187795a8 Fix ESPHome nodes being auto-added without user confirmation (#21444) 2019-02-26 12:35:25 -08:00
Paulus Schoutsen
ab73b725e1 Pin isort (#21463) 2019-02-26 12:33:40 -08:00
David F. Mulcahey
c4400be62a Add friendly name to devices in the device registry (#21318)
* add friendly name to devices in the device registry

* switch to name_by_user

* review comments
2019-02-26 12:20:16 -08:00
David F. Mulcahey
a34524febe Clean up ZHA post rewrite (#21448)
* update async handling to reduce unnecessary coroutine creation

* lint

* cleanup
2019-02-26 10:48:10 -08:00
Ville Skyttä
beb86426e4 Upgrade flake8 to 3.7.7 (#21452) 2019-02-26 10:47:57 -08:00
Anders Melchiorsen
03fc81a434 Clean up codeowners file (#21442) 2019-02-26 10:47:08 -08:00
Giorgos Logiotatidis
5a5c97acb3 Add timeout option to sensor.rest and binary_sensor.rest. (#20065) 2019-02-26 10:23:46 -08:00
Johann Kellerman
90d3f517d8 Check if a script requirement is available before install (#20517)
* Check if a script requirement is available before install

* PackageLoadable

* hound

* req
2019-02-26 10:20:54 -08:00
Franck Nijhof
f3c9327ccf Rewrite of Toon component (#21186)
* 🚜 Rewrite of Toon component

* 🔥 Removed manual state from list

* 👕 Addresses code review comments

* 🔥 Removes a log line that should not have been left behind

* 👕 Addresses linting warnings

* 👕 Addresses Hound CI warning

* 👕 Fixes small code styling issues

*  Sets an appropriate SCAN_INTERVAL

*  Sets min/max temperature for climate platform

* 👕 Makes imports more consistent with codebase

* 🚑 Fixes incorrect SCAN_INTERVAL value in climate platform

* 🚑 Uses OrderedDict for config_flow schema

* 👕 Adds return types for min/max temp

* 🚜 Refactors entities into their actual devices

* ⬆️ Updates toonapilib to 3.0.7

* 🚜 Refactors binary sensor state inversion

* 🚑 Fixes states of OpenTherm connection and Hot Tap Water

*  Adds Boiler Preheat binary sensor

*  Adds Toon Thermostat Program binary sensor

*  Adds Boiler Modulation Level sensor

*  Adds Daily Power Cost sensor

* 🔥 Cleanup of Toon Thermostat climate attributes

* 🚜 Adjusts config_flow with Tenant selection

* 🙋 Adds myself to codeowners file as maintainer

* ⬆️ Gen requirements

* ⬆️ Updates toonapilib to 3.0.9

*  Adds config_flow tests
2019-02-26 10:18:09 -08:00
Andrew Sayre
f0268688be Increase travis timeout (#21447) 2019-02-25 18:59:02 -08:00
Anders Melchiorsen
095a0d19d1 Fix Sonos snapshot/restore (#21411) 2019-02-25 13:03:15 -08:00
koreth
4e9d0ebc63 Fix double events on Lutron Pico keypads (#21408)
* Fix double events on Lutron Pico keypads (#21235)

* Replace "else" with default value; remove explanatory comments
2019-02-25 12:09:58 -08:00
Paulus Schoutsen
6626e5c4a4 Handle GA Disconnect intent (#21387)
* Handle GA Disconnect intent

* Fixed lint error
2019-02-25 10:35:03 -08:00
Otto Winter
db4c06c8fe Add ESPHome User-Defined Services (#21409)
* Add ESPHome User-Defined Services

* Update requirements_all.txt
2019-02-25 10:34:06 -08:00
Andrew Sayre
d3f1ee4a89 Add SmartThings Cover platform and add cover device classes (#21192)
* Add additional device classes to Cover component; Add SmartThings cover platform; Improve lock test coverage

* Enhance cover platform to support position and battery level reporting.

* Add additional classes

* Removed device class descriptions

* Updates based on review feedback

* Add test case for closed
2019-02-25 10:13:34 -08:00
Andrew Sayre
0ccbf61aea Add power and energy attributes to SmartThings switch (#21375) 2019-02-25 15:50:16 +01:00
Joakim Plate
a50bcdff1a Mark water_heater as significant domain (#21390) 2019-02-25 07:45:40 +01:00
Baptiste Lecocq
f190b698c6 Update pylinky (#21416) 2019-02-25 07:44:33 +01:00
Ville Skyttä
619ea3ff98 Upgrade mypy to 0.670 (#20934) 2019-02-25 07:54:54 +02:00
Ville Skyttä
dd5fc0a1da Upgrade pytest to 4.3.0 (#21412) 2019-02-25 07:36:57 +02:00
Jeff Irion
ff93cdb0bc Add ADB server functionality to Fire TV (#21221)
* Bump firetv to 1.0.8

* Update the 'update' function for Fire TV

* Return None for properties when unavailable

* Remove 'self.adb_lock' attribute

* Remove threading import

* Update configuration for Fire TV component

* Clarify 'python-adb' vs. 'pure-python-adb'

* Rename '__adb_decorator' to '_adb_exception_catcher'

* Don't check 'self._available' in properties

* Bump firetv to 1.0.9
2019-02-25 00:16:49 +01:00
Joakim Plate
814e610b1d Philips js state (#21407)
* Switch to SCAN_INTERVAL instead of throttle

This allows forced update of state

* Don't change tv on/off state in services

* Drop unused variables

* Only send mute if different from current state

* No need to update variables, will behandled on update

* Drop unused import
2019-02-24 14:33:07 -06:00
Anders Melchiorsen
a4bb35142c Add Sonos discovery of multiple households (#21337)
* Remove confusing device naming

* Add discovery of multiple households

* Rename SonosDevice to SonosEntity
2019-02-24 18:45:08 +01:00
Martin Hjelmare
47220d71a1 Clean up locative tests (#21400) 2019-02-24 10:49:50 -06:00
Andrew Sayre
04fc951048 Improve tolerance of SmartThings Climate platform (#21383)
* Improve resilience of platform with buggy handlers

* Eliminate possibility of None in operation list

* Refactor variable name
2019-02-24 10:45:11 -06:00
Martin Hjelmare
7255fbdf3a Clean up geofency test (#21397) 2019-02-24 15:56:19 +01:00
Hmmbob
65bc7a6fbd Update WazeTravelSensor to 0.9 (#21130)
* Update WazeRouteCalculator to 0.8 and suppress logging

Fixes #20071 and #21051

* Update requirements_all.txt

* Update requirements_all.txt

* Update waze_travel_time.py

* Update waze_travel_time.py

* Update waze_travel_time.py

* Update waze_travel_time.py
2019-02-24 07:21:56 -06:00
koreth
3e9376c418 Handle capitalized HomeKit property names (#21382)
The Velux ACTIVE gateway uses `C#` rather than `c#` as the name of
the property that holds the count of accessories. Apple's HomeKit docs
suggest that properties should be case-insensitive, so update the
code to not assume the property names are lower case.
2019-02-24 13:56:52 +01:00
Nick Whyte
6e0186fd56 Bump nessclient version to 0.9.10 (#21388)
* ness_alarm: Bump nessclient version

* update requirements_all.txt
2019-02-24 10:26:02 +01:00
Fabian Affolter
3732d75633 Update ordering (#21377) 2019-02-24 10:22:17 +01:00
Fabian Affolter
2ada0ecfd9 Upgrade shodan to 1.11.0 (#21384) 2019-02-23 22:14:26 -06:00
Andrew Sayre
3d9f4bf2aa SmartThings Lock platform state attributes enhancement (#21379)
* Add additional lock metadata

* Fixed attribute name in test
2019-02-24 02:52:37 +01:00
Rohan Kapoor
ce86fe47e3 Remove the google travel time update service (#21153) 2019-02-23 19:24:38 -06:00
Martin Hjelmare
d44269981b Clean up owntracks tests (#21378) 2019-02-23 19:17:49 -06:00
Andre Lengwenus
fc13e37d8d Refactoring. Moved LCN constants to const.py (#21376) 2019-02-24 01:30:19 +01:00
Daniel Høyer Iversen
b588c1fe1c Handle connection issue for netatmo (#21346)
* Handle connection issue for netatmo

* reduce logging
2019-02-24 00:41:38 +01:00
Tony763
6743ef10ab Update panasonic_viera.py (#21365) 2019-02-23 23:39:51 +01:00
Thibault Maekelbergh
a1c3a38428 Generate new Discogs sensors + fix scan interval (#19443)
* Generate new sensors for discogs:
- Generate collection sensor
- Generate wantlist sensor
- Generate random record sensor
- Removes the option to set a name

* Make it so name can still be configured

* Fix invalid syntax

* Use shared data object + 1 sensor

* Linting

* Remove straying comment

* Dont use async for non-async stuff

* Don't use separate list for conf already in dict

* Use consts for keys

* Copy dict to list for sensors

* Fix syntax for computed keys in SENSORS dict
2019-02-23 15:58:30 -06:00
Teemu R
492c3b24de Check for attribute existence for HS220 support (#21309)
* Check for attribute existence as smartplug does not have them (for HS220 support)

* use getattr over hasattr and a separate check
2019-02-23 22:57:54 +01:00
Alistair Galbraith
1eba90d2a1 Add initial support for Sony SDCP projector control (#20269)
* Add initial support for Sony SDCP projector control

* Changes to reflect code review

* Added code per change requests

- Validation of connection during setup_platform
- Docs pending

* Removed blank lines per CI build

* Lint fix

* Update homeassistant/components/switch/sony_projector.py

Co-Authored-By: alistairg <alistair@alistairs.net>

* Updated .coveragerc, made requested logger changes

* Update docstring
2019-02-23 15:57:10 -06:00
Jérôme W
a8a2daeac5 Add custom and zone cleaning to Neato Vacuums (#20779)
* Adding custom and zone cleaning to Neato Vacuums

* Fixing line length and missing imports

* Line too long

* Adding details to the custom service

* Fix linting issues

* Reverting ACTION

* Code cleanup

* Typo

* Requested modifications

* Changing the custom service domain

* No service schema depency anymore

* Removing useless code

* Linting

* Requested changes

* Requested changes for domain

* Revert the service domain back to vacuum
2019-02-23 15:55:55 -06:00
Rohan Kapoor
dc5b8fd8c4 Split out iperf3 into a component with a sensor platform (#21138)
* Move iperf3 sensor to a standalone component

* Split out iperf3 into a component with a sensor platform

* Update coverage and requirements

* Add services.yaml

* Clean up a little bit

* Lint

* Lint
2019-02-23 15:55:08 -06:00
Martin Hjelmare
7143f4e621 Fix person update on create (#21355)
* Update tests to set correct hass running state

* Update person on adding person if hass is running

* Test creating person when hass is running
2019-02-23 15:38:21 -06:00
Adam Dullage
bfda923999 Update Starling Bank Integration to v2 API (#21358)
* Bump starlingbank to v2 API

* Fixed incorrect call
2019-02-23 20:54:42 +01:00
yosilevy
e8b67fc19f Scene validator fix (#21362) 2019-02-23 18:26:27 +01:00
Richard Mitchell
c595cf016f Support the person component in Prometheus (#21363) 2019-02-23 18:13:27 +01:00
Finbarr Brady
d027965304 Update luci device tracker (#21321)
* * bump pip module version.
* moved named tuple into the module.
* pass SSL bool into the object init.
* support get_extra_attributes

* Update homeassistant/components/device_tracker/luci.py
2019-02-23 16:28:41 +01:00
Andre Lengwenus
f20195ba75 Add conf_key check for LCN platform load (#21354) 2019-02-23 15:58:18 +01:00
Benny de Leeuw
197303b63e Add voltage per phase (#21319) 2019-02-23 15:57:54 +01:00
tmechen
2f7b4ed7f0 implementing freedaily mode (#21314)
adressing #15105 and add a freedaily mode for a 5 day forecast with free API key
2019-02-23 15:52:08 +01:00
Justin Bassett
02745be44d Allows the utility_meter to net meter rather than only allow increases. (#21204)
* Allow the utility_meter to net meter rather than only allow increases.

* Fix PR issues around CI.

* Fix line length fallout.

* Change rollover to net_consumption.  Add unit tests.

* Fix test style issues.

* Fix style in tests.
2019-02-23 14:02:39 +00:00
siberx
616c7628d7 Fixes the sensor.filter outlier filter (handle step-changes correctly) (#21332)
* Fix outlier filter median return, Add/update filter outlier tests

* Switch outlier filter to store raw vals (handles step-changes correctly)

* Filter store_raw as attribute instead of filter_state parameter

* Fix linting issues
2019-02-23 13:51:33 +00:00
Hmmbob
954bd4e13b Update buienradar.py (#21351)
Fixing warning about unsupported config key in Buienradar sensor, whilst it was actually supported (but not validated)
2019-02-23 14:43:37 +01:00
Julius Mittenzwei
48e44f4b5b Updated pyvlx from 0.2.8 to 0.2.9. This version has slightly improved logging (#21349) 2019-02-23 08:04:32 -05:00
Daniel Høyer Iversen
b7b4a6dcc8 Add location to Norway airquality (#21347) 2019-02-23 10:35:18 +01:00
Andre Lengwenus
8f70c16863 Add LCN cover platform (#20288)
* Add LCN cover platform

* Removed unused default value

* Moved cover component to lcn platform directory. Small changes due to change request

* Closed state is set before updating
2019-02-23 10:13:15 +01:00
Daniel Shokouhi
2aa7bdb1d5 Allow google home component device tracker to be optional (#21335) 2019-02-23 01:01:09 -08:00
Robbie Trencheny
111f882d78 Add note to issue template regarding iOS issues (#21342)
## Description:

Add an additional line to the issue template mentioning that iOS issues should be reported to the home-assistant-iOS repo.
2019-02-22 17:39:19 -08:00
David Conley
b437b87655 Allow custom_effect to be absent from Flux configuration (#21317)
* Allow custom_effect to be absent from Flux configuration

* set custom effect to none during setup
2019-02-23 00:13:40 +01:00
philipperequile
2b3c31cdb0 Add more ads plc types (#19801)
* Update __init__.py

Support for 2 new 4-byte PLC datatypes DINT and UDINT

* Update __init__.py

* Fix lint issue

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Support for 2 new PLC types

Sensor supports DINT and UDINT PLC types

* Update __init__.py

I removed unused TYPES = [ADSTYPE_INT, ADSTYPE_UINT, ADSTYPE_BYTE, ADSTYPE_DINT, ADSTYPE_UDINT]
2019-02-22 23:52:46 +01:00
Andrew Sayre
8b38b82e73 Enhance SmartThings component subscription (#21124)
* Move to config v2 to store SmartApp oauth keys

* Add migration functionality.

* Regenerate refresh token on periodic basis

* Fix regenerate and misc. optimizations

* Review feedback

* Subscription sync logic now performs a difference operation

* Removed config entry reloading.
2019-02-22 20:35:12 +01:00
Robert Svensson
d9712027e8 Config entry options (#18929)
Add support for options flow for config entries
2019-02-22 17:59:43 +01:00
Phil Cole
caa3b123ae Nissanleaf (#21145)
* Remove unneeded returns from handle_update()

* Start __init__() params with hass.

* Remove excess logging and downgrade remaining logging.

* Remove period from end of comment

* Decorate callback with @callback

* Use more descriptive variables than key and value.

* Inherit from BinarySensorDevice and overwrite is_on rather than state.

* Removed uncheckedreturn values.

* Use super() rather than explicit object.

* Use add_entities instead of add_devices.

* Don't use listener when calling immediately.

* Remove some excess logging.

* Switch to sync since pycarwings2 is sync.

* Remove RuntimeError exception matching.

* Add temporary reviewer comments.

* Add UI help descriptions for update service.

* Fix hound errors.

* Replaced time.sleep() with await asyncio.sleep()

* Removed location_updateon_on attribute since on device_tracker.

* Use async_added_to_hass() and async_dispatcher_connect().

* Use dict[key] because schema key is required.

* Clarify variable names.

* Remove icon for charging switch.

* Convert LeafChargeSwitch into service and sensor.

* Use async_dispatcher_send().

* Add guard checks for discovery_info. Consistent logs.

* Use async_schedul_update_ha_state().

* Device tracker should return true.

* Remove icon for climate control.

* Really remove icon for climate control.

* Use register() instead of async_register().

* Add guard on device tracker if discovery_info is None.
2019-02-22 17:34:23 +01:00
SNoof85
4102e24481 Adding myself as codeowner for Freebox component (#21288) 2019-02-22 09:58:48 -05:00
Fabian Affolter
3f29e91367 Remove index (#21304)
* Remove index

* Remove emnumerate
2019-02-22 14:11:07 +01:00
Paulus Schoutsen
3a3957aeed Merge pull request #21296 from home-assistant/rc
0.88.1
2019-02-21 20:16:44 -08:00
Paulus Schoutsen
e4a21011a3 Bumped version to 0.88.1 2019-02-21 17:06:30 -08:00
Paulus Schoutsen
07e04e5b84 Fix yeelight config validation (#21295) 2019-02-21 17:06:24 -08:00
Aaron Bach
df5b17d139 Fix unhandled exception in Ambient PWS config entry (#21278) 2019-02-21 17:06:24 -08:00
David F. Mulcahey
e3d29ad26a update services.yaml (#21276) 2019-02-21 17:06:23 -08:00
Paulus Schoutsen
e2a57add2c Add SamsungTV Mac validation (#21268) 2019-02-21 17:06:23 -08:00
Joakim Plate
e59776377b Add missing configation option (#21265)
Fixes https://github.com/home-assistant/home-assistant/issues/21254
2019-02-21 17:06:23 -08:00
Joakim Plate
b2482d8205 Add missing configuration option to plex (#21264)
Fixes part of: https://github.com/home-assistant/home-assistant/issues/21254
2019-02-21 17:06:22 -08:00
David F. Mulcahey
dc133fe9f2 Fix ZHA bugs (#21246)
* fix bugs

* add comment

* allow entities to be marked unavailable
2019-02-21 17:06:22 -08:00
Paulus Schoutsen
3fcbc36abe Update translations 2019-02-21 16:40:25 -08:00
Paulus Schoutsen
bd352b9950 Merge remote-tracking branch 'origin/master' into dev 2019-02-21 16:40:07 -08:00
Paulus Schoutsen
bf4fb36bb1 Fix yeelight config validation (#21295) 2019-02-21 16:39:17 -08:00
Paulus Schoutsen
ac502980a2 Do not warn for internally loaded components (#21287) 2019-02-21 14:57:38 -08:00
David McNett
d9a44f2a78 Version bump: python-anthemav to v1.1.9 (#21273) 2019-02-21 23:24:29 +01:00
Aaron Bach
d0e88d9628 Fix unhandled exception in Ambient PWS config entry (#21278) 2019-02-21 13:27:34 -07:00
David F. Mulcahey
a2877c4ea0 update services.yaml (#21276) 2019-02-21 14:39:55 -05:00
Teemu R
94be43e3e1 Add support for automatic discovery of TP-Link switches, bulbs and dimmers (#18091)
* {switch,light}.tplink: use deviceid as unique id, fetch name from the device during initialization

* raise PlatformNotReady when no device is available

* Use mac instead of deviceid

* remove name option as obsolete

* Add support for configuration flow / integration

Allows activating automatic discovery of supported devices from the configuration

* Fix linting, update requirements_all.txt

* start cleaning up tplink component based on feedback

* add device info, improve config handling

* Allow overriding detected devices via configuration file

* Update requirements.txt

* Remove debug logging

* make hound happy

* Avoid I/O during init and simplify the code, remove remains of leds_on

* Fix issues based on feedback, use consistent quotation marks for device info

* add async_setup_platform emiting a deprecation warning

* Avoid blocking the I/O, check for None on features

* handle some Martin's comments, schema-validation is still missing

* use async_create_task instead of async_add_job, let core validate the schema

* simplify configuration handling by storing the configuration data separately from initialized instances

* add default values to schema, make hound happy

* with defaults set by schema, simplify the checks. add async_unload_entry

* Use constant for data structure access

* REWORD add a short note about async_unload_entry

* handle feedback from Martin, config_data is checked against Noneness

* use pop to remove the domain on unload

* First steps to add tests for the new tplink component

* embed platforms under the component directory

* Fix tests by mocking the pyhs100 internals

* Fix linting

* Test against multiple instances of devices, tidy up

* (hopefully) final linting round

* Add pyHS100 to test requirements

* log always the warnings occured during an update to make them easy to see

* revert back the warning behavior (requirement for silver level in IQS)

* Unload only when an entry is being loaded and add tests for that

Thanks @MartinHjelmare for pointing this out!

* Fix linting

* Bump the upstream lib, fixes most prominently the HSV setting on bulbs

* Test unloading for all platforms, clear the data storage instead of popping it out, making it possible to reconfigure after removal without restarting hass first

* Use class variables instead of instance variables for bulb states, required for HS220

* Use new-style format string

* Fix indenting, uppercase the mock constant

* Run black on test_init, hopefully that will finally fix the weird formatting (pycharm, pylint and hound seems to have different opinions...)
2019-02-21 20:29:07 +01:00
Tobias Hoff
c637bad1eb account specific cookies file to enable multiple accounts (#19811) 2019-02-21 10:35:27 -08:00
Miroslav Ždrale
565f513b77 Added device tracker support for Ubee Router (#19586)
* Added Ubee Router Device Tracker.

* Updated code to meet requirements.

* Code clean-up.

* Code clean-up.

* Code clean-up.

* Minor error message update

* Ubee device tracker: Minor code clean-up

* Bump pyubee version

* Code clean-up
2019-02-21 09:24:37 -08:00
Paulus Schoutsen
4c4317fb37 Add SamsungTV Mac validation (#21268) 2019-02-21 08:52:45 -08:00
Joakim Plate
998b5f6d19 Add missing configation option (#21265)
Fixes https://github.com/home-assistant/home-assistant/issues/21254
2019-02-21 08:26:26 -08:00
Joakim Plate
6b7a5cfcad Add missing configuration option to plex (#21264)
Fixes part of: https://github.com/home-assistant/home-assistant/issues/21254
2019-02-21 08:26:09 -08:00
Gido
e764d9461a Update rova component with suffix for house number (#21182)
* Update rova component with release rova release 0.1.0
Add house_number_suffix to configuration

* Set default value for house_number_suffix
2019-02-21 09:51:36 -05:00
OleksandrBerchenko
09692143d0 Correctly detect devices, which went offline during HA restart (#20933)
* Correctly detect devices, which went offline during HA restart

* Update __init__.py
2019-02-21 14:48:17 +01:00
David F. Mulcahey
0f8575f939 Fix ZHA bugs (#21246)
* fix bugs

* add comment

* allow entities to be marked unavailable
2019-02-21 14:20:58 +01:00
Paulus Schoutsen
2435456248 Prevent partial custom component overlays (#21070)
* Prevent partial custom component overlays

* Fix tests
2019-02-21 09:41:36 +01:00
Fredrik Erlandsson
73099caede Alarm trigger support for Point (#21207) 2019-02-21 06:50:02 +01:00
Fabian Affolter
966fd1034d Upgrade opensensemap-api to 0.1.4 (#21240) 2019-02-20 17:46:37 -07:00
Paulus Schoutsen
ddd63c615f Remove constraint from regex (#21239) 2019-02-20 21:31:41 +01:00
Paulus Schoutsen
7bd5e60767 Merge pull request #21238 from home-assistant/rc
0.88.0
2019-02-20 11:13:27 -08:00
David F. Mulcahey
67008e0947 Fix bug in ZHA and tweak non sensor channel logic (#21234)
* fix race condition and prevent profiles from stealing channels

* fix battery voltage
2019-02-20 09:35:32 -08:00
David F. Mulcahey
9f99e173de Don't dispatch to components when there are no channels for ZHA sensors (#21223)
* don't dispatch when channels don't exist

* review comment
2019-02-20 09:35:31 -08:00
Paulus Schoutsen
7dd3fc7ca7 Bumped version to 0.88.0 2019-02-20 08:58:37 -08:00
Paulus Schoutsen
fd3bea177b Prevent invalid context from crashing (#21231)
* Prevent invalid context from crashing

* Lint
2019-02-20 08:57:51 -08:00
Aaron Bach
be26fc896d Fix an Ambient PWS exception when location info is missing (#21220) 2019-02-20 08:57:50 -08:00
David F. Mulcahey
9057da01bd Refactor ZHA listeners into channels (#21196)
* refactor listeners to channels

* update coveragerc
2019-02-20 08:57:50 -08:00
Paulus Schoutsen
d09cf8dd17 Updated frontend to 20190220.0 2019-02-20 08:55:56 -08:00
Paulus Schoutsen
03573781c7 Updated frontend to 20190220.0 2019-02-20 08:55:42 -08:00
Finbarr Brady
54949cff5a Support OpenWRT 18.06 in luci device tracker (#21236)
* Got it right this time i hope

* updates on comments
2019-02-20 16:55:00 +01:00
damarco
1518a80069 Bump zigpy (#21203)
* Bump zigpy

* Update requirements

* Update test requirements

* Bump zigpy-deconz
2019-02-20 16:34:59 +01:00
David F. Mulcahey
cece6454e4 Fix bug in ZHA and tweak non sensor channel logic (#21234)
* fix race condition and prevent profiles from stealing channels

* fix battery voltage
2019-02-20 16:33:29 +01:00
David F. Mulcahey
5b24b271cc Don't dispatch to components when there are no channels for ZHA sensors (#21223)
* don't dispatch when channels don't exist

* review comment
2019-02-20 16:27:03 +01:00
Marco Gazzola
5115dfada2 Add zone and reps for Xiaomi vacuum (#19777)
* xiaomi vacuum with zone and reps

* tail whitespace

* tail whitespaces

* new version

* fix params typs

* fix param type

* line length

* rytilahti tips

* houndci-bot

* fix trevis

* rytilahti tips

* service description

* syssi fix

* MartinHjelmare tips

* MartinHjelmare

* data_template schema

* line lenght

* line lenght

* line lenght

* data_template schema

* fix

* Update homeassistant/components/vacuum/xiaomi_miio.py

Co-Authored-By: marcogazzola <dev@marcogazzola.com>

* Update homeassistant/components/vacuum/xiaomi_miio.py

Co-Authored-By: marcogazzola <dev@marcogazzola.com>

* xiaomi vacuum with zone and reps

* tail whitespace

* new version

* fix param type

* rytilahti tips

* rytilahti tips

* MartinHjelmare

* data_template schema

* line lenght

* line lenght

* data_template schema

* fix

* Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev

* Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev"

This reverts commit e1f370b3b45d2541c8117146b0940d7c2b5bc8b0.

* log fixed

* Revert "log fixed"

This reverts commit 1f0e7b35e8.

* Revert "Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev""

This reverts commit 1cf9e5ae1f.

* Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev"

This reverts commit 0e8d53449a.

* log fixed
2019-02-20 15:44:04 +01:00
Aaron Bach
7e06d03b45 Fix an Ambient PWS exception when location info is missing (#21220) 2019-02-20 12:10:42 +01:00
Diogo Gomes
1ff299875b Add self to integration sensor and utility_meter (#21226) 2019-02-20 08:34:10 +01:00
Paulus Schoutsen
cf3a8b60ff Prevent invalid context from crashing (#21231)
* Prevent invalid context from crashing

* Lint
2019-02-20 08:02:56 +01:00
Daniel Perna
27d598fff8 Update pyhomematic to 0.1.56 (#21227) 2019-02-20 00:31:46 +01:00
Paulus Schoutsen
49995c2120 Fix the build (#21229) 2019-02-19 13:52:14 -08:00
Paulus Schoutsen
4cc90c437f Bumped version to 0.88.0b4 2019-02-19 10:31:47 -08:00
carstenschroeder
c0f83b4164 Push pyads to 3.0.7 (#21216)
* Push to pyads 3.0.7

* Correct too long line
2019-02-19 10:31:34 -08:00
ehendrix23
4500760b52 Set aioharmony version to 0.1.8 (#21213)
Update aioharmony version to support latest HUB firmware (4.15.250).
2019-02-19 10:31:34 -08:00
Diogo Gomes
620f23d433 ordered by last occurence (#21200) 2019-02-19 10:31:33 -08:00
Anders Melchiorsen
4562bdc69f Upgrade aioimaplib for Python 3.7 compatibility (#21197) 2019-02-19 10:31:33 -08:00
Paulus Schoutsen
dfb45c03e4 Updated frontend to 20190219.0 2019-02-19 10:31:03 -08:00
Paulus Schoutsen
f452409cfa Updated frontend to 20190219.0 2019-02-19 10:14:33 -08:00
zewelor
fb820975b5 Add yeelight flow action support (#21195) 2019-02-19 19:06:40 +01:00
David F. Mulcahey
3be8178035 Refactor ZHA listeners into channels (#21196)
* refactor listeners to channels

* update coveragerc
2019-02-19 09:58:22 -08:00
Johann Bauer
fe4a2b5b31 Fix Homematic IP Cloud configuration (#21202)
`homematicip.aio.auth.isRequestAcknowledged` returns false if the
request failed in stead of raising an error.

See coreGreenberet/homematicip-rest-api@0b61954f6a

Closes: #20428
2019-02-19 09:53:20 -08:00
carstenschroeder
df8589c36a Push pyads to 3.0.7 (#21216)
* Push to pyads 3.0.7

* Correct too long line
2019-02-19 18:42:00 +01:00
Diogo Gomes
b0f317743b ordered by last occurence (#21200) 2019-02-19 08:45:21 -08:00
ehendrix23
99eda385d1 Set aioharmony version to 0.1.8 (#21213)
Update aioharmony version to support latest HUB firmware (4.15.250).
2019-02-19 08:44:42 -08:00
Fabian Affolter
e3cfcbad69 Upgrade numpy to 1.16.1 (#21190) 2019-02-19 16:04:56 +01:00
Julien Brochet
98c3c02daa Bump Synology SRM dependency to version 0.0.6 (#21212)
* Bump Synology SRM dependency to version 0.0.6

* Add @aerialls to the Synology SRM code owners
2019-02-19 10:01:47 -05:00
Fabian Affolter
2d2c6cf4a1 Use constants from const.py (#21068)
* Use constants from const.py

* Fix lint issues
2019-02-19 14:09:06 +01:00
Daniel Perna
9d3eaada27 Netatmo, address comments from #20755 (#21157)
Netatmo component cleanup
2019-02-19 10:53:45 +01:00
Fabian Affolter
baaeaab61d Upgrade crimereports to 1.0.1 (#21187) 2019-02-19 10:04:14 +01:00
starkillerOG
921efbdfef Philips Hue: Add bridge update prompt (#21119)
* Add a prompt if bridge update is available.

* Change logger warning for light update

The self.light.swupdatestate only checks for updates of that specific light, it does not check for updates of the bridge.
Theirfore the warning message schould be updated.

* add space

* fix tests

* rename to swupdate2_bridge_state

* update aiohue to v1.9.1

* update aiohue to v1.9.1

* update aiohue to v1.9.1
2019-02-18 21:31:42 -08:00
Anders Melchiorsen
bc46e48d23 Upgrade aioimaplib for Python 3.7 compatibility (#21197) 2019-02-19 06:11:56 +01:00
OleksandrBerchenko
bdea222196 Expose effect_list attribute for turned off lights (#20750) 2019-02-18 21:01:26 -08:00
Paulus Schoutsen
5ad252bd3b Bumped version to 0.88.0b3 2019-02-18 13:31:21 -08:00
sjabby
1768c2b447 Fix for #19072 (#21175)
* Fix for #19072

PR #19072 introduced the custom_effect feature but it didnt make it optional as the documentation states.
This causes error on startup and the component does not work.
```
Error while setting up platform flux_led
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/flux_led.py", line 135, in setup_platform
    device[CONF_CUSTOM_EFFECT] = device_config[CONF_CUSTOM_EFFECT]
KeyError: 'custom_effect'
```

Changing this line to make the custom_effect optional as the original intention.

* Update flux_led.py
2019-02-18 13:30:59 -08:00
David F. Mulcahey
d1fa341a78 Add power source to device and clean up zha listeners (#21174)
check available and add comments

ensure order on API test
2019-02-18 13:30:59 -08:00
John Mihalic
8b5aff63ae Update pyEight for Python 3.7 Compatability (#21161) 2019-02-18 13:30:58 -08:00
Diogo Gomes
c544845e29 Fix track_change error in utility_meter (#21134)
* split validation

* remove any()
2019-02-18 13:30:58 -08:00
Andrew Sayre
d55693762e Fix SmartThings Translation Error (#21103) 2019-02-18 13:30:57 -08:00
Andrew Sayre
7ce18146d4 SmartThings Component Enhancements/Fixes (#21085)
* Improve component setup error logging/notification

* Prevent capabilities from being represented my multiple platforms

* Improved logging of received updates

* Updates based on review feedback
2019-02-18 13:29:03 -08:00
René-Marc Simard
834d8940a8 Return None if no GTFS departures found (#20919) 2019-02-18 13:26:26 -08:00
Paulus Schoutsen
933076560b Updated frontend to 20190218.0 2019-02-18 13:25:55 -08:00
Paulus Schoutsen
d1ebe2cbac Updated frontend to 20190218.0 2019-02-18 13:25:43 -08:00
Paulus Schoutsen
d2fea76fd7 Add context to service call event (#21181) 2019-02-18 13:07:44 -08:00
sjabby
463c4ae5c9 Fix for #19072 (#21175)
* Fix for #19072

PR #19072 introduced the custom_effect feature but it didnt make it optional as the documentation states.
This causes error on startup and the component does not work.
```
Error while setting up platform flux_led
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/flux_led.py", line 135, in setup_platform
    device[CONF_CUSTOM_EFFECT] = device_config[CONF_CUSTOM_EFFECT]
KeyError: 'custom_effect'
```

Changing this line to make the custom_effect optional as the original intention.

* Update flux_led.py
2019-02-18 13:05:46 -08:00
Paulus Schoutsen
600070af3a Make sure that device trackers is always a list during creation (#21193) 2019-02-18 13:04:04 -08:00
Robert Svensson
9ce8f4737d deCONZ thermostat support (#20586)
* Add support for thermostats in deCONZ by adding Climate platform
2019-02-18 17:43:22 +01:00
David F. Mulcahey
3f9e6a7064 Add power source to device and clean up zha listeners (#21174)
check available and add comments

ensure order on API test
2019-02-18 16:55:41 +01:00
Martin Hjelmare
0ab9b006f0 Clean up upc_connect tests (#21150) 2019-02-18 08:58:25 -06:00
Mattias Welponer
0b77a89a2f Fix HomematicIP Cloud fix cover position property (#21154) 2019-02-18 08:54:23 -06:00
Fabian Affolter
4d410bf5b9 Upgrade psutil to 5.5.1 (#21171) 2019-02-18 15:51:21 +01:00
John Mihalic
1afbc22ad5 Update pyEight for Python 3.7 Compatability (#21161) 2019-02-18 11:20:31 +01:00
Fabian Affolter
6cdc5a5c2d Upgrade sqlalchemy to 1.2.18 (#21162) 2019-02-18 11:19:40 +01:00
Fabian Affolter
7e855d5b48 Upgrade youtube_dl to 2019.02.18 (#21164) 2019-02-18 11:19:21 +01:00
Fabian Affolter
2b86fc3841 Upgrade voluptuous-serialize to 2.1.0 (#21166) 2019-02-18 11:18:40 +01:00
Diogo Gomes
3b5ed7a20f Fix track_change error in utility_meter (#21134)
* split validation

* remove any()
2019-02-17 20:40:51 -08:00
CV
ce7f678b9b RSSI_PEER and RSSI_DEVICE are different things (fixes #20900) (#20902)
* Fix #20900: RSSI_PEER and RSSI_DEVICE are different things

This change is fixing issue #20900.

Wireless actors are having two RSSI values. The way the component was programmed one of them was overwritten.

* Added deprecation comment

* Fixed long line

* Fix: pylint comment

* Lint

* flake8

* flake8 again

* Update __init__.py
2019-02-17 20:53:57 -06:00
lapy
425b9851fc Add traccar monitored_conditions option (#21149)
* Add traccar monitored_conditions option

User defined additional parameters to track from the traccar platform

* Version bump for pytraccar client

* Update traccar.py

* Remove default value

* Update homeassistant/components/device_tracker/traccar.py

Co-Authored-By: lapy <lapy@users.noreply.github.com>

* Update traccar.py
2019-02-17 23:38:04 +01:00
ktnrg45
72ef9670e6 Add component media player.ps4 (#21074)
* Added PS4/ __init__.py

* Create en.json

* Create config_flow.py

* Create const.py

* Create media_player.py

* Create services.yaml

* Create strings.json

* Create __init__.py

* Add test_config_flow.py/ Finished adding PS4 files

* Rewrote for loop into short-hand

* bumped pyps4 to 0.2.8

* Pass in helper()

* Rewrite func

* Fixed test

* Added import in init

* bump to 0.2.9

* bump to 0.3.0

* Removed line

* lint

* Add ps4 to flows list

* Added pyps4-homeassistant with script

* Added pyps4

* Added pypys4 to test

* removed list def

* reformatted service call dicts

* removed config from device class

* typo

* removed line

* reformatted .. format

* redefined property

* reformat load games func

* Add __init__ and media_player.py to coveragerc

* Fix for test

* remove init

* remove blank line

* remove mock_coro

* Revert "remove init"

This reverts commit b68996aa34699bf38781e153acdd597579e8131f.

* Correct permissions

* fixes

* fixes
2019-02-17 15:41:55 -05:00
lapy
4e7cfc923d Add traccar scan_interval configuration option (#21079)
* Added scan_interval configuration option

* Fixed trailing whitespace and indentation

* Update traccar.py

* Update homeassistant/components/device_tracker/traccar.py

Co-Authored-By: lapy <lapy@users.noreply.github.com>
2019-02-17 17:55:06 +01:00
Robert Svensson
9251860201 Logging to find what deCONZ events get created (#20551)
* Helpful logging to easily find what events get created
2019-02-17 16:58:46 +01:00
Daniel Perna
847711ddc9 Add webhook support for Netatmo Cameras (#20755)
Add webhook support for Netatmo Cameras
2019-02-17 12:31:47 +01:00
René-Marc Simard
33b8dbe73a Return None if no GTFS departures found (#20919) 2019-02-17 11:46:08 +01:00
msvinth
df598544d6 Make Netatmo able to discover both Weather station and Health Coach (#20274)
* Resolve conflicts and review comments

* Corretly handle HomeCoach in manual setup

* Fix code reivew comments

* Move import back int methods

* Formatting fix

* Lint fix
2019-02-17 11:45:58 +01:00
Ville Skyttä
816364bfd9 Upgrade pytest to 4.2.1 (#21112)
* Upgrade pytest to 4.2.0

* Upgrade pytest to 4.2.1

* Make litejet switch test work with pytest 4.2
2019-02-17 09:55:33 +01:00
Paulus Schoutsen
7d111c2b4e Bump pychromecast to 2.5.2 (#21127) 2019-02-16 23:52:26 -08:00
Paulus Schoutsen
30c8c689d8 Handle ValueError (#21126) 2019-02-16 23:52:25 -08:00
cdce8p
017f34770b Fix battery_level error - HomeKit (#21120) 2019-02-16 23:52:25 -08:00
Paulus Schoutsen
f881a3af82 Bumped version to 0.88.0b2 2019-02-16 23:52:04 -08:00
Otto Winter
6f0b853547 Update bootstrap.py 2019-02-16 23:51:59 -08:00
Otto Winter
9696a8b8a9 Add persistent notification 2019-02-16 23:51:59 -08:00
Otto Winter
219ca336a9 Lint 2019-02-16 23:51:59 -08:00
Otto Winter
26a79dff99 Fix tests 2019-02-16 23:51:59 -08:00
Otto Winter
0023da778a Add legacy PLATFORM_SCHEMA config validation 2019-02-16 23:51:59 -08:00
Rohan Kapoor
84053103f0 Deprecate conf_update_interval (#20924)
* Deprecate update_interval and replace with scan_interval

* Update tests

* Fix Darksky tests

* Fix Darksky tests correctly

This reverts commit a73384a223ba8a93c682042d9351cd5a7a399183.

* Provide the default for the non deprecated option

* Don't override default schema for sensors
2019-02-16 23:48:37 -08:00
Diogo Gomes
bc17adda8d Don't expose services in Utility_Meter unless tariffs are available (#20878)
* only expose services when tariffs configured

* don't register services multiple times
2019-02-16 23:48:37 -08:00
Jason Hu
2155a861cd Remove outdated url pattern match support for static file hosting (#21109) 2019-02-16 23:06:42 -08:00
Paulus Schoutsen
f1b84962ed Add legacy PLATFORM_SCHEMA config validation (#21072)
* Add legacy PLATFORM_SCHEMA config validation

* Fix tests

* Lint

* Add persistent notification

* Update bootstrap.py
2019-02-16 23:05:06 -08:00
cdce8p
9125e49628 Fix battery_level error - HomeKit (#21120) 2019-02-16 23:04:29 -08:00
Markus Jankowski
8c5763624c Add Groups to Homematic IP (#21076)
* Added HmIP-Groups

* Fix imports

* Removed config options from conflig_flow

* fix tests

* Removed config options

* reverted smaller code changes

* changes after review

* minor fix

* Fixed comments
2019-02-17 06:24:13 +01:00
Rohan Kapoor
481439d387 Deprecate conf_update_interval (#20924)
* Deprecate update_interval and replace with scan_interval

* Update tests

* Fix Darksky tests

* Fix Darksky tests correctly

This reverts commit a73384a223ba8a93c682042d9351cd5a7a399183.

* Provide the default for the non deprecated option

* Don't override default schema for sensors
2019-02-17 06:23:09 +01:00
Matthew Garrett
ad9ec2190c Merge pull request #21133 from mjg59/eufy
Update Lakeside dependency in Eufy component
2019-02-16 20:59:20 -08:00
Diogo Gomes
9cab597bc4 Don't expose services in Utility_Meter unless tariffs are available (#20878)
* only expose services when tariffs configured

* don't register services multiple times
2019-02-16 20:04:56 -08:00
Paulus Schoutsen
9c92880b5a Handle ValueError (#21126) 2019-02-16 19:38:52 -08:00
Paulus Schoutsen
ea592a003b Bump pychromecast to 2.5.2 (#21127) 2019-02-16 20:48:43 -05:00
Matthew Garrett
451241b481 Update Lakeside dependency in Eufy component
This should fix #16834
2019-02-16 15:43:30 -08:00
Nick Horvath
c91512d55d Bump thermoworks_smoke version to get new pyrebase version (#21100) 2019-02-16 12:15:15 -08:00
Paulus Schoutsen
d34fe106e4 Updated frontend to 20190216.0 2019-02-16 12:15:04 -08:00
Paulus Schoutsen
66267474dc Updated frontend to 20190216.0 2019-02-16 12:00:04 -08:00
Fabian Affolter
1a6c79d5e2 Order imports (#21117) 2019-02-16 17:03:08 +01:00
Otto Winter
a49686879d Update bootstrap.py 2019-02-16 14:51:30 +01:00
Nick Horvath
f7d9031486 Bump thermoworks_smoke version to get new pyrebase version (#21100) 2019-02-16 11:18:13 +01:00
Andrew Sayre
b39b66ef65 Fix SmartThings Translation Error (#21103) 2019-02-16 10:49:24 +01:00
Matt Snyder
4c23ccad98 Owlet baby monitor component (#21108) 2019-02-16 10:12:16 +01:00
David Barrera
4509caefde Add index parameter to scrape sensor (#21084)
* Add index parameter to scrape sensor

The scrape sensor selects the first element of the list returned by
BeautifulSoup. This commit adds an optional index parameter to allow the
selection of a different element from the list of results. To make this
a non-breaking change, if no index value is configured, the sensor
defaults to the previous behaviour of returning the first element.

* Set default value for index to avoid later checks
2019-02-16 09:29:24 +01:00
Paulus Schoutsen
5cf936c777 Bumped version to 0.88.0b1 2019-02-15 10:32:28 -08:00
Aaron Bach
91a2c73a2c Bump aioambient to 0.1.2 (#21098) 2019-02-15 10:32:23 -08:00
Paulus Schoutsen
90da9120e8 Update pychromecast (#21097) 2019-02-15 10:32:23 -08:00
Paulus Schoutsen
da672c6593 Fix hue retry crash (#21083)
* Fix Hue retry crash

* Fix hue retry crash

* Fix tests
2019-02-15 10:32:22 -08:00
Paulus Schoutsen
2de65af3fa Check against unlinked user (#21081) 2019-02-15 10:32:22 -08:00
Phil Hawthorne
dc606b40ac Set uvloop version consistent with hass.io (#21080)
This sets the uvloop version in Docker containers to 0.11.3, which is the
same version that hass.io uses.

uvloop might be causing issues with some Docker containers on some host
systems, as reported in #20829
2019-02-15 10:32:21 -08:00
Paulus Schoutsen
8973852a2e Fix pushover schema 2019-02-15 10:32:05 -08:00
David F. Mulcahey
2b6b922e3f Set ZHA device availability on new join (#21066)
* set availability on device join

* fix new join test
2019-02-15 10:30:43 -08:00
Aaron Bach
539d24dd60 Bump aioambient to 0.1.2 (#21098) 2019-02-15 10:28:23 -08:00
Phil Hawthorne
9203ae201f Set uvloop version consistent with hass.io (#21080)
This sets the uvloop version in Docker containers to 0.11.3, which is the
same version that hass.io uses.

uvloop might be causing issues with some Docker containers on some host
systems, as reported in #20829
2019-02-15 10:25:03 -08:00
David F. Mulcahey
3a6a246746 Set ZHA device availability on new join (#21066)
* set availability on device join

* fix new join test
2019-02-15 13:14:58 -05:00
Paulus Schoutsen
6c574a4eb4 Updated frontend to 20190215.0 2019-02-15 10:09:24 -08:00
Paulus Schoutsen
f7a6027466 Updated frontend to 20190215.0 2019-02-15 10:09:09 -08:00
Paulus Schoutsen
05808afe75 Update pychromecast (#21097) 2019-02-15 09:46:03 -08:00
Otto Winter
06f2aa93a4 Add persistent notification 2019-02-15 18:40:46 +01:00
Jason Hu
46efc0eafb Refactor http CachingStaticResource (#21062)
* Simplify http.CachingStaticResource implementation

* Sync up CachingStaticResource._handle() implementation from aiohttp

* Ignore pylint duplicate-base warning

* Try to disable pylint for http/static.py

Caused by https://github.com/PyCQA/astroid/issues/633#issuecomment-463879288

* Remove pylint ignore

* Ignore pylint duplicate-base warning
2019-02-15 09:31:54 -08:00
Andrew Sayre
383813bfe6 Config Entry migrations (#20888)
* Updated per review feedback.

* Fixed line length

* Review comments and lint error

* Fixed mypy typeing error

* Moved migration logic to setup

* Use new migration error state

* Fix bug and ignore mypy type error

* Removed SmartThings example and added unit tests.

* Fixed test comments.
2019-02-15 09:30:47 -08:00
Paulus Schoutsen
1130ccb325 Fix hue retry crash (#21083)
* Fix Hue retry crash

* Fix hue retry crash

* Fix tests
2019-02-15 08:43:30 -08:00
Andrew Sayre
93f84a5cd1 SmartThings Component Enhancements/Fixes (#21085)
* Improve component setup error logging/notification

* Prevent capabilities from being represented my multiple platforms

* Improved logging of received updates

* Updates based on review feedback
2019-02-15 17:40:54 +01:00
Jonas Pedersen
7d0f847f83 Add switch platform for Danfoss Air and additional sensors. (#21046)
* Add switch platform for Danfoss Air and additional sensors.

* Solve lint issues.

* Correct style.

* Minor changes

* Minor changes

* Minor changes

* Update file header

* Remove space

* Remove space
2019-02-15 14:54:25 +01:00
Phil Cole
656d39e3ec Nissan Leaf Integration (Carwings / NissanConnect EV) (#19786)
* Added work so far.

* Change interval so nobody drains their battery when I put this online

* Added the warning notice.

* Async setup

* Still broken, but we're getting there.

* Back to synchronous, moved refresh stuff into DataStore

* Functional sensors!

* Added working switches, tweaked intervals a bit

* Fixed turn off result

* Moved plug status to binary_sensor, added smart intervals

* Documentation and car nickname stuff

* Syntax fixes and coveragerc additions

* Style fixes

* Fixing the final line length

* Fixed an issue with newer models and bad climate data

* Forgot to check my line endings.

* New icons for most of the components

* Hotfix for handling Nissan's awful servers

* Merge in fixes made by Phil Cole

Remove invalid FIXMEs and update TODOs
Fixes for pylint and test for CarwingsError exception rather than Exception
Flake8 fixes
Add pycarwings2 to requirements_all.txt
Add extra configuration documentation.
Use pycarwings2 from pip. Check server dates between requests.
Add sensor device class for battery.
Async conversion fixes
flake8 fixes and docstrings
Non-async charging is OK
Handle multiple cars in the configuration
Convert to async. Better imports for platforms
Fix scanning interval & prevent extra refreshes.  async switchover
Check discovery_info to prevent load of platforms
Ensure update frequency is always above a minimum interval (1 min).
Platforms don't have return values
Use values() instead of items() when not using key
Use snake_case (LeafCore becomes leaf_core)

commit 418b6bbcc49cf2909aac85869440435410abf3fd

* Add pycarwings2 to requirements_all.txt

* Make stopping charge error an 'info'. Remove TODO.

* Request update from car after sending start charging command.

* Delay initial (slow) update for 15 seconds and make async

* Flake8 line length fixes

* Try to fix D401 'imperative mood' git diff tox errors

* Try to fix more D401 'imperative mood' tox errors

* Default interval of an hour in code, to match comments.

* Update to pycarwings2 2.3

* Update to pycarwings2 2.3 in requirements_all.txt

* Remove documentation, instead refering to home-assistant.io

* Remove unneeded dispatcher_send()

* Remove unneeded requirements comments

* Combine excess debugging.

* Remove single line method signal_components()

* Bump to version 2.4 of pycarwings2

* Remove unused dispatcher_send

* Simplify logging of LeafEntity registration

* Update requirements_all.txt

* Multiple changes

Increase timeout to 30 seconds
Only consider battery_status
Fix plugged in status
Better attempts at try/exception handling

* Fix line length

* Use pycarwings 2.5

* Remove pointless 'is True'

* Remove unnecessary 'is True/False'

* Remove unnecessary 'is True/False'

* Use LENGTH_MILES and LENGTH_KILOMETERS

* Remove excess logging in setup_platform()

* Remove unnecessary 'is True'

* Use pycarwings2 version 2.6

* Require pycarwings2 version 2.7.

* Increase sleep delay for climate and location reponses.

* Remove unnecessary 'is True'

* Increase frequent polling warning to _LOGGER.warning()

* Use DEVICE_CLASS_BATTERY

* Remove extraneous 'is True'.

* Move icon strings to constants.

* Remove unneeded key.

* LeafRangeSensor ac_on property is internal.

* Flake8 missing line

* Remove homebridge attributes.

* Remove round battery % and range to whole numbers

* Use pycarwings2 2.8

* Move to embedded component model

* Reduce maximum attempts to 10 (5 mins)

* Include attempt count in 'waiting' log message

* Use await instead of yield. Remove @asyncio.coroutine decorators.

* Add @filcole as nissan_leaf codeowner

* Fix checking for if not data returned from vehicle. Don't double send signal on location update.

* Exposed updated_on, update_in_progress and next_update attributes.

* Add nissan_leaf.update service that triggers an update.

* Flake8 line fixes

* Remove excess and double logging.

* Add updated_on attribute for device tracker.

* Fix crash if pycarwings2 doesn't provide cruising ranges.

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes
2019-02-15 14:35:25 +01:00
Klaudiusz Staniek
7b19428279 Times of The Day Binary Sensor (#20068)
* First commit

* Times of the Day binary sensor added

* Python 3.5 fixes and logging removed

* Code refactored according to reviewer's suggestions

* Fixed config template with friendly name support

* Finall pep8 fixes

* Removed async_generate_entity_id and moved initial calculation to async_added_to_hass

* Change the configuration schema to follow the current requirements

* Update according latest suggestsion

* Fix typos and minor changes

* Fix lint issue
2019-02-15 14:13:44 +01:00
Fredrik Erlandsson
f3786e2f2b Point alarm control (#20972)
* initial working example of alarm_control

* fixes for alarm_control

* arm home is the same as arm away

* updated documentation

* final fixes

* pypoint version up

* fixes for Martin
2019-02-15 12:19:42 +01:00
Eliran Turgeman
b44ff38f5a Fix "Unable to find entity" at Waze component (#21087)
Should fix https://github.com/home-assistant/home-assistant/issues/20953 
(Unable to create this issue on my HA platform)
2019-02-15 11:48:27 +01:00
Fabian Affolter
eb573c2701 Meteo france (#21065)
* Move files

* Move file

* Update .coveragerc

* Sort import and update file header

* Minor changes
2019-02-15 10:57:47 +01:00
Otto Winter
f6ae054e9f Lint 2019-02-15 10:57:02 +01:00
Otto Winter
b7607ff472 Fix tests 2019-02-15 10:51:52 +01:00
John Mihalic
c115c89afd Bump pyHik library to 0.2.2, improve connections, add sensors (#21086) 2019-02-15 07:18:12 +01:00
Paulus Schoutsen
12c18d63fd Fix pushover schema (#21073) 2019-02-14 15:54:48 -08:00
Paulus Schoutsen
ab7fda4286 Check against unlinked user (#21081) 2019-02-14 15:54:38 -08:00
Fabian Affolter
cdc4dc3f11 Rename CONF_ATTRIBUTION to ATTRIBUTION (#21069)
* Rename CONF_ATTRIBUTION to ATTRIBUTION

* Update homeassistant/components/sensor/irish_rail_transport.py

Co-Authored-By: fabaff <mail@fabian-affolter.ch>
2019-02-14 22:09:22 +01:00
Paulus Schoutsen
d60934c028 Fix pushover schema 2019-02-14 12:06:25 -08:00
Otto Winter
9c09a98c9e Add legacy PLATFORM_SCHEMA config validation 2019-02-14 20:55:51 +01:00
Fabian Affolter
03ec3ac16e Update file header (#21067) 2019-02-14 20:35:47 +01:00
Joakim Plate
c5de32e7b1 Climate const.py move (#20945)
* Move constants to const.py

* Import from const instead of climate
2019-02-14 20:34:43 +01:00
Fabian Affolter
dc62cb6a88 Update file header 2019-02-14 16:42:03 +01:00
Fabian Affolter
3736120c6a Update file header (#21061)
* Update file header

* Fix lint issue

* Fix lint issue
2019-02-14 16:01:46 +01:00
Victor Cerutti
f4b2573c4b Météo-France platform for the weather component (#18404)
* new weather component for meteofrance

* linting

* upgrade meteofrance package version

* Update .coveragerc

* Remove updates to the weather component architecture

* Rewrite Météo-France as a component

* Update .coveragerc

* Update requirements_all.txt

* remove Weather Card option

* Update conf name

Changing conf name to something more universal for worldwide weather forecast (postal code was only relevent for France)

* Update meteofrance pypi package

* fix line too long

* Update requirements_all.txt

* prevent from calling an API endpoint if not in monitored conditions

* fix stale url and remove blank line

* Insure that all cities are unique

* rename CONF_ATTRIBUTION

* Updating data from component setup

* fix missing extra lines
2019-02-14 14:40:27 +01:00
Paulus Schoutsen
801401e9cb Bumped version to 0.89.0.dev0 2019-02-13 20:47:04 -08:00
Paulus Schoutsen
e404afc0d0 Bumped version to 0.88.0b0 2019-02-13 20:37:46 -08:00
Paulus Schoutsen
3c8c6688be Merge remote-tracking branch 'origin/master' into dev 2019-02-13 20:37:22 -08:00
Paulus Schoutsen
882f5ed079 Don't directly update config entries (#20877)
* Don't directly update config entries

* Use ConfigEntryNotReady

* Fix tests

* Remove old test

* Lint
2019-02-13 20:36:06 -08:00
Fabian Affolter
161c368c9d Update file header (#21054)
* Update file header

* Update __init__.py
2019-02-13 20:35:12 -08:00
Fabian Affolter
3a386e627e Upgrade ruamel.yaml to 0.15.88 (#21055) 2019-02-13 20:29:11 -08:00
Fredrik Erlandsson
1faf2f49d0 fix webhook update (#21048) 2019-02-13 20:27:17 -08:00
Diogo Gomes
f1f3074612 Add integration method to sensor.integration (#21050)
* add integration method and respective new methods

* ack @ottowinter tip

* align const name with value
2019-02-13 20:26:27 -08:00
Paulus Schoutsen
81d2ec9618 Person: Ignore unavailable states (#21058)
* Ignore unavailable states

* Revert validation
2019-02-13 20:10:31 -08:00
Paulus Schoutsen
4d3790e2d4 Person checks (#21056)
* Do not allow creating/updating persons with invalid user IDs

* Unset user_id from person when user deleted

* Lint

* Lint

* Lint
2019-02-13 20:04:08 -08:00
Paulus Schoutsen
50ba3d0427 Create a person during onboarding (#21057) 2019-02-13 20:00:08 -08:00
Alok Saboo
bf0a50cdb2 Add template support to Bayesian sensor (#20757)
* Add template support to Bayesian sensor

* Removed unused import
2019-02-13 17:39:53 -07:00
Ben Dews
c20e0b985a Add Lock capability to SmartThings platform (#20977)
* Bumped pysmartthings version to 0.6.1

* Added Lock to supported platforms

* Added SmartThings Lock component

* Updated lock to eagerly set state

* Updated requirements_all.txt & requirements_test_all.txt with pysmartthings==0.6.1

* Added SmartThings Lock tests

* Removed inapplicable comment

* Removed unused import (STATE_UNLOCKED)

* Populated device_state_attributes with values provided by SmartThings

* Condensed if_lock assertion function

* Updated gathered attributes

* Fixed typo

* Updated tests to use new setup_platform

* Updated assignment of device state attributes

* Updated tests to utilise the LOCK_DOMAIN constant where suitable

* Fixed false positive for Switch test: (test_unload_config_entry)

* Implemented constant to contain expected SmartThings state for is_locked check

* Improved allocation of State Attributes

* Improved allocation of state attributes

* Fixed lint error (was running lint checks against the wrong file, whoops)

* Added test for unloading lock config

* Use isinstance instead of type()

* Updated device state to explicitly check for is not None instead of a truthy value
2019-02-13 18:36:49 -06:00
Paulus Schoutsen
02f207ea8e Update translations 2019-02-13 15:44:18 -08:00
Paulus Schoutsen
c2579d1d8a Updated frontend to 20190213.0 2019-02-13 15:43:55 -08:00
Otto Winter
faeb6295b6 Fix updated file header (#21049) 2019-02-13 22:52:48 +01:00
Ryan Wagoner
62b2b23d0b Add night arm mode to MQTT alarm control panel (#20961)
* Add night arm mode to MQTT alarm control panel

* Add unit test for MQTT alarm night mode
2019-02-13 22:52:32 +01:00
Fabian Affolter
127c55e0c1 Update file header (#21023)
* Update file header

* Update file header

* Update file header

* Update file header

* Update file header

* Fix lint issues
2019-02-13 21:21:14 +01:00
emontnemery
22af9707ad Add support for device_class to MQTT cover (#21044) 2019-02-13 19:58:46 +00:00
Kevin Fronczak
67780dfb4e Update scan interval to 5 minutes. (#21041) 2019-02-13 17:47:38 +01:00
Colby Rome
136b1e1f6c Fix broken links to code examples (#21039) 2019-02-13 17:14:59 +01:00
David F. Mulcahey
d692251e62 Run tasks when ZHA devices become available (#20998)
* use tasks for message interception

* update available handling

* review comments and cleaned up check

* review comments
2019-02-13 08:52:29 -05:00
Fabian Affolter
8db8a58763 Upgrade sqlalchemy to 1.2.17 (#21020)
* Upgrade sqlalchemy to 1.2.17

* Update requirements_all.txt

* Update requirements_test_all.txt

* Run script again
2019-02-13 12:30:37 +01:00
Aaron Bach
8a6235fdac Bump aioambient to 0.1.1 (#21024)
* Bump aioambient to 0.1.1

* Requirements
2019-02-12 22:57:53 -07:00
Andrew Sayre
d037359bda Add lock config entry unload support. (#21025) 2019-02-12 22:35:20 -06:00
Fabian Affolter
6bbc663d0b Add missing helpers (#21021) 2019-02-12 20:52:02 -06:00
Jef D
d1950cd75c Update co2signal==0.4.2 to fix #20805 (#21022)
Update co2signal==0.4.2 to fix #20805
2019-02-12 20:51:10 -06:00
David F. Mulcahey
561ff33641 Update entity state when ZHA device becomes available (#20993)
* correctly update device entity state

* update state when device becomes available

* constants

* review comments
2019-02-12 20:37:39 -05:00
emontnemery
888345e4ff Fix discovery of audio groups (#20947)
* Fix discovery of audio groups

* Fix tests

* Re-discover

* Review comments

* Remove failing tests

* Update dependencies

* Fix test
2019-02-12 15:00:54 -08:00
Paulus Schoutsen
6fad9e1a0a RFC: Embed platforms without component for remote component. (#20809)
* Embed platforms for remote component.

* Update reqs
2019-02-12 14:57:13 -08:00
rbflurry
f1a00cc0f9 Allow target all timer services using 'entity_id: all' (#21008) 2019-02-12 23:18:45 +01:00
Paulus Schoutsen
4d1d22070c Bump frontend to 20190212.0 2019-02-12 13:48:11 -08:00
Daniel Høyer Iversen
7b7720d0ea Norway air, minor fix (#21016) 2019-02-12 13:45:12 -08:00
Fabian Affolter
b6854a82cf Upgrade restrictedpython to 4.0b8 (#21015) 2019-02-12 13:44:32 -08:00
Otto Winter
fe9800e784 Prevent OverflowError in ESPHome integration (#21014) 2019-02-12 22:34:06 +01:00
Fabian Affolter
d795410b27 Update ordering (#21013) 2019-02-12 21:44:30 +01:00
David F. Mulcahey
80442e655d Update ZHA API to be device oriented (#20990)
* update cluster API

* swap to device focused API

* update test
2019-02-12 15:05:02 -05:00
Jason Hu
6b46ed850b Upgrade cryptography to 2.5 (#21011) 2019-02-12 19:52:24 +01:00
carstenschroeder
d1c8d39107 Add unique id to ADS platforms (#20511)
* Add friendly_name option

* Correct hound findings

* correct hound findings 2

* add unique id

* add unique id to all ads platforms
2019-02-12 18:42:09 +01:00
Fredrik Erlandsson
d89c56829c Fix Point does I/O in event loop (#20939)
* call I/O operations via hass.async_add_executor_job

* asyncio fixes

* Fixes from @amelchio

* async _update_callback
2019-02-12 17:15:02 +01:00
Daniel Høyer Iversen
2702c75fb0 Norway air quality (#20683)
* Add norway air quality sensor

* style

* library

* Refacotr to air_quality

* fix norway air comments
2019-02-12 16:40:22 +01:00
Paulus Schoutsen
00b8d57cd0 Add frontend storage (#20880)
* Add frontend storage

* Update storage.py
2019-02-12 16:38:19 +01:00
carstenschroeder
1e69848af4 Updates pyatmo to 1.8 and adds exception handling (#20938)
* switch to pyatmo 1.7 & add exception handling

* STATE_UNKNOWN => None

* correct too long line

* delete whitespace

* remove fancy update logic
2019-02-12 11:12:44 +00:00
Paulus Schoutsen
5dfaec5967 Update to Python 3.7 (#20988) 2019-02-12 10:33:03 +01:00
Paulus Schoutsen
9cbb26bee2 Bump feedparser version to py3.7 compat (#20987)
* Bump feedparser version to py3.7 compat

* Update requirements_test_all.txt

* Update gen_requirements_all.py
2019-02-12 10:30:09 +01:00
Thomas Passer Jensen
69df620ad6 Add Rejseplanen danish public transport sensor component (#19885)
* Add Rejseplanen danish public transport sensor component

* Removed commented out code and fixed style errors

* Use rjpl pypi package for API calls.

* Fix platform schema config and code cleanup.

* Use updated rjpl library with specific exceptions

* API error message is now logged, unknown state attributes excluded
2019-02-12 09:26:46 +01:00
Andrew Sayre
e8ed56ca52 Add SmartThings Climate platform (#20963)
* Add SmartThings Climate platform

* Add SmartThings Climate platform
2019-02-12 08:11:36 +01:00
arigilder
0d98f9783f Add lagging hdate for sensors that should lag to update (#20655)
* Add lagging hdate for sensors that should lag to update

* Fix indentation

* Lint fix
2019-02-11 23:34:48 +01:00
Aaron Bach
b5b03f5b7f Fix bug with monitored_conditions in Ambient PWS (#20837)
* Make monitored_conditions more specific in Ambient PWS

* Revert messing around with storing monitored_conditions elsewhere

* Come on, Aaron

* Fix bug with monitored_conditions in Ambient PWS
2019-02-11 23:31:49 +01:00
Otto Winter
55f9db6992 Bump aioesphomeapi to 1.5.0 (#20986)
* Bump aioesphomeapi to 1.5.0

* Update requirements_all.txt

* Fix editor line length setting
2019-02-11 21:57:17 +01:00
Fabian Affolter
277f37423e Sort imports (#20985) 2019-02-11 15:22:12 -05:00
Brian Towles
c3c92232da Unique Ids for August entities to allow renames (#20887)
* working unique ids for august

* cleanup blank lines

* cleanup blank lines

* cleanup blank lines

* rebase

* get the oneline back in

* blank line stuff

* whitespace cleanup

* Blank Line .

* blank line again
2019-02-11 14:48:02 -05:00
Fabian Affolter
4cb408f8f9 Sort imports (#20984) 2019-02-11 14:46:21 -05:00
David F. Mulcahey
868820c424 add device info API (#20950) 2019-02-11 14:38:04 -05:00
Ben Van Mechelen
861d58f58f Support for Multiple modbus hubs (#19726)
* modbus: support multiple modbus hub

* update data after entities added

* pass hub object to each entity. and save hub to hass.data but not in module level

* add hub_client setup log

* don't update when adding device, because hub_client is not ready right now

* support restore last state

* remove useless func

* compatible with python35

* removed unrelated style changes

* Update flexit for multi-device modbus

* change how hubs are referenced in the configuration

* Also update climate/modbus.py

* Remove unwanted whitescapce

* Defined common constants centrally

* Update DOMAIN in climate and switch components

* Removed unnecessary vol.schema

* Make hub name optional

* Add name property to ModbusHub
2019-02-11 14:00:37 -05:00
Patrick T.C
49ecca9cb9 Set cover level using emulated_hue (#19594)
* set cover level using emulated_hue

* changed mapping for service turn_on/off for cover.

* removed whitespace for the sake of hound

* using const for domains instead of hardcoded strings.

* change length of lines for the sake of hound

* fixed under-intended line

* changed intent for the sake of hound
2019-02-11 13:59:34 -05:00
Fabian Affolter
788f7988e7 Upgrade ruamel.yaml to 0.15.87 (#20955) 2019-02-11 17:18:25 +01:00
Fabian Affolter
0425c8195f Upgrade slixmpp to 1.4.2 (#20971) 2019-02-11 08:33:57 -05:00
Stefan Burke
de2892caa8 Update pyHS100 to 0.3.4 (#20979) 2019-02-11 08:32:43 -05:00
Mattias Welponer
e538320901 HomematicIP fix cover direction (#20901)
* Fix cover direction

* Update for better readability

* Fix lint
2019-02-11 10:20:00 +01:00
Aaron Bach
a55c2514d1 Add missing data fields to Ambient PWS (#20808)
* Fix binary sensor in Ambient PWS

* Add missing data points for Ambient PWS

* Member comments

* Binary sensor doesn't need state property
2019-02-11 09:54:29 +01:00
Oliver
88d0aa14ee Update denonavr to 0.7.8 (add various sound modes) (#20951) 2019-02-10 19:13:03 -06:00
CrazYoshi
fd991bd1a4 Ebusd integration (#19607)
* ebusd component and sensor splitted

ebusd component and sensor splitted and tested

* houndci-bot fixes

* pep8 validated

* Update requirements_all.txt

* travis fixes

* Fix __init__.py for travis

* translation updated

* proposed changed

* move logic from component to ebusdpy lib

* hound fixes

* Update requirements_all.txt

* update pypi library to V0.0.11

* error management in command_result

Avoid sensor status change in case an error in reading occurs

* add opMode translations

add opMode translations

* send type to read ebusdpy API

* timeframe as attribute for time schedule type sensors

* hound fix

* bugfix on library

* ebusd sensor moved to ebusd component directory

* update ebusdpy dependency

* improvement proposed

* travis fix

* update error managing

* insert log debug start setup

* changes requested

* exception tuple on init

* cla-bot stucked pull

* added bai circuit support

* merged coveragerc from dev

* configuration get change
2019-02-10 13:04:18 -08:00
Rohan Kapoor
8f249f9149 Use CONF_RECIPIENT for default recipient in config (#20925)
* Use CONF_RECIPIENT for default recipient in config

* Fix typo
2019-02-10 21:52:35 +01:00
Rudolf Offereins
203a6fd349 Fixed Thethingsnetwork sensor issue so that it takes the most recent (last) item from the TTN data storage query result instead of the first. (#20790)
* Fixed Thethingsnetwork sensor issue so that it takes the most recent (last) item from the TTN data storage query result instead of the first.

* Update sensor.py

More pythonic way to get the last item of the sensor value list.
2019-02-10 21:49:45 +01:00
Fredrik Erlandsson
5df02f3a78 fix missing sensor values for Point (#20937) 2019-02-10 21:48:33 +01:00
Tim van Cann
d049b521b2 Add Google pubsub component (#20049)
* Add google pubsub component

* Add tests and requirements

* Make python3.5 compatible

* Fix linting

* Fix pubsub test

* Code review comments

* Add missing docstrings

* Update requirements_all

* Code review comment

- Remove pylint ignores
- Don't modify global environment
2019-02-10 21:45:46 +01:00
Markus Jankowski
1ebdc2e2c2 Add device HmIP-BSL to Homematic IP (#20865)
* Added support from HmIP-BSL

* Fixed setup of initial on

* Minor changes

Removed Black from Dictionary
added extra case to turn_on
added comments

* moved 3rd party libraries inside methods

* Fixed comment

* Removed code block to keep component behavior consisten to other dimmers

Minimum brightness is 10, otherwise the led is not visible anymore

* moved 3rd party libraries inside methods 2nd

* corrected spelling and variable assignment

* implemented feedback

* removed own state implementation

it is  the same as in parent class

* reduced device_state_attributes

brightness is alread in parent class

* On/Off is only determined by brightness now

turn_off sets brightness to 0.
turn_on now uses the previous used color an sets the brightness to 255

* Fixed string sorting of unique_id

* improved usage of base class

* Update code after review by MartinHjelmare

* Fix for the hound
2019-02-10 19:49:16 +01:00
On Freund
d8993af548 CoolMasterNet Climate platform (#20787)
* CoolMasterNet Climate platform

* Address Coolmaster PR comments

* Fix docstrings on climate demo platform

* Additional CoolMaster PR review fixes
2019-02-10 19:34:39 +01:00
Paulus Schoutsen
4a559cd4df Merge pull request #20930 from home-assistant/rc
0.87.1
2019-02-10 10:06:50 -08:00
David F. Mulcahey
16154ab445 Update ZHA helpers (#20898)
* update helpers

* review comments

* remove ternary

* use correct timeout
2019-02-10 19:01:07 +01:00
Aaron Godfrey
9f7443ba97 Reverts 2105724. (#20915)
This change broke functionality for existing users using hdmi grabbers.
2019-02-10 09:41:29 -06:00
Martin Gross
852d67b95c Fix #19990: Alexa-support for climate in manual-mode (#20910) 2019-02-10 09:02:53 -06:00
Matt White
44d7c3584d Added IDs and enabled workarounds for Yale YRD220, YRL220, YRD120 (#20929) 2019-02-10 09:00:03 -06:00
David F. Mulcahey
898b699311 Add quirks info to ZHA device (#20923)
* add quirks info to zha device

* move import

* remove device entity part
2019-02-10 08:56:27 -06:00
Peter Nijssen
ace1ae85dd add fan support for spider thermostats (#20897)
* add fan support for spider thermostats

* resolved feedback on pull request
2019-02-10 07:54:30 -06:00
javicalle
13421b326b Fix RFLink restore state (#20588)
* some minor tests refactor

* unused import

* async/await refactor

* Correct tests failures

* Restore state bug
added call to super().async_added_to_hass()

* Show brightness attribute if device supports it

* Fix light/test_rflink 

Dimmable devices defaults to 255 brightness

* delete super().device_state_attributes call
2019-02-10 12:50:40 +01:00
emontnemery
5f7f7777a0 Fix encoding for MQTT camera (#20932) 2019-02-10 12:35:54 +01:00
CV
5def64156f Missing Binary Sensor (#20921)
TiltIP Binary Sensor is missing in the discover list.
2019-02-10 12:34:54 +01:00
David F. Mulcahey
326010629c Add some api tests for ZHA (#20909)
* start API tests

* blank lines
2019-02-10 06:29:36 -05:00
Paulus Schoutsen
3a4b3a2f81 Bumped version to 0.87.1 2019-02-09 22:48:17 -08:00
Matt N
f601e9f774 Upgrade zm-py to 0.3.3 (#20886)
Fixes #20833
2019-02-09 22:48:11 -08:00
Paulus Schoutsen
c66ec87b69 Use text= instead of body= for creating web responses (#20879) 2019-02-09 22:48:09 -08:00
Daniel Høyer Iversen
81cad8cd52 Fix STATE_UNLOCKED for verisure (#20858) 2019-02-09 22:48:08 -08:00
Jc2k
5a762c74f4 Fix homekit_controller non-standard hk characteristics (#20824) 2019-02-09 22:48:07 -08:00
jonudewux
21583d25e2 Add Transmission component 'scan_interval' option (#20575)
* Transmission component fix 'scan_interval' option

* Fix dict[key] comments

* Fix latest mess
2019-02-09 22:48:06 -08:00
Eliran Turgeman
b5e40669c9 Fix waze_travel_time component ERROR on startup (#20316)
* Fix waze_travel_time component ERROR on startup

Fix the unhandled exception with Waze Travel Time sensor upon startup,
by adding Throttle before update_interval are starting.

* add missing whitespace after ','

* fix line too long (80 > 79 characters)

* lint

* fix interval to use const

* Change to Throttle as a decorator to update

Change to Throttle as a decorator to update instead of self.update = Throttle(interval)(self.update)
remove unnecessary code.

* fix  indentations

* Update waze_travel_time.py

* Update waze_travel_time.py

* Update waze_travel_time.py
2019-02-09 22:48:05 -08:00
Jason Hu
8137b0bb9e Fix coroutine never awaited warning in test (#20892) 2019-02-09 15:13:12 -06:00
Paulus Schoutsen
987b5cd905 Person component: add storage and WS commands (#20852)
* Forbid duplicate IDs

* Allow loading persons from storage

* Convert to PersonManager

* Add storage support and WS commands to Person component

* Convert list command to differentiate types

* Allow loading person component without defining persons

* Fix cleanups after update/delete

* Address comments

* Start tracking when HA started
2019-02-09 10:41:40 -08:00
Eliran Turgeman
cfd1563bc8 Added more language options (#20890)
This is a Small PR, Just Added 3 more language : 
* he: Hebrew
* ko: Korean
* lv: Latvian
2019-02-09 09:47:35 -06:00
Brian Towles
24914aade5 Set August doorbell availability state from online state (#20883)
The available state for the August Doorbell is currently set based on the state of the binary ding sensor.  This means that if there is no door bell rings in a while on startup the doorbell is shown as Unavailable (#20421) . This ties the availability of the doorbell to the  actual online state thats in the device information retrieved from august so that even if there has not been a doorbell ring activity on a while the device shows as online when it is.
2019-02-09 09:01:02 -06:00
Paulus Schoutsen
33dcb071da Use text= instead of body= for creating web responses (#20879) 2019-02-08 23:10:04 -08:00
Ville Skyttä
876e2a0a11 Upgrade mypy to 0.660 (#20873) 2019-02-09 08:32:14 +02:00
Matt N
33d607bb22 Upgrade zm-py to 0.3.3 (#20886)
Fixes #20833
2019-02-09 06:44:33 +01:00
René-Marc Simard
a014c2be59 Cleanup GTFS query (#20874) 2019-02-08 21:47:02 -06:00
René-Marc Simard
9db9a81793 Set GTFS icon by route type (#20876) 2019-02-08 21:38:39 -06:00
Joakim Plate
d16d14b648 Media player const.py move (#20822)
* Move more constants to const.py

* Import constants directly from const

* ATTR_ENTITY_ID is not defined in media_player

* MEDIA_PLAYER_PLAY_MEDIA_SCHEMA is still in __init__.py

* Correct imports in tts

* PLATFORM_SCHEMA, SCHEMA is still defined in __init__.py

* Pandora imports several services

* Some additional fixes for move of const in media_player

* Fix hound lengths
2019-02-08 14:18:18 -08:00
MatteGary
faf7ae29b1 Fix init of TransmissionData (#20817)
* Fix init of TransmissionData

 Fix in order to avoid null object on first update of Turtle Mode Switch

* Using async functionality

* Various fix

* HoundBot fix

* Removed some async calls

* Fix compilation Error

* Fix

* PEP fix
2019-02-08 18:15:14 +01:00
Daniel Høyer Iversen
6a78ad8ab6 Fix STATE_UNLOCKED for verisure (#20858) 2019-02-08 14:35:38 +01:00
Fabian Affolter
c99d140651 Upgrade youtube_dl to 2019.02.08 (#20859) 2019-02-08 07:44:08 -05:00
Markus Jankowski
ca0e5a75ec Add additional devices and features to Homematic IP (#20747)
* Homematic IP: updated dependency homematicip to 0.10.5

* Homematic IP: Added LightSensor

* Homematic IP: Added power measure for XXXSwitchMeasuring

* reverted unnessessary change

* reverted unnessessary change

* removed device_class from core

* Removed optional property device_class

* Added description for property

* Changed comment to fix travis build

* Changed comment to fix travis build
2019-02-08 12:43:48 +01:00
Rohan Kapoor
d5fad33599 Add better handling of deprecated configs (#20565)
* Add better handling of deprecated configs

* Embed the call to has_at_most_one_key in deprecated

* Add tests for checking the deprecated logs

* Add thoroughly documented tests

* Always check has_at_most_one_key

* Fix typing

* Move logging helpers to homea new logging helper

* Lint

* Rename to KeywordMessage instead of BraceMessage

* Remove unneeded KeywordStyleAdapter

* Lint

* Use dict directly rather than dict.keys() when creating set

* Patch the version in unit tests, update logging and use parse_version

* Re-add KeywordStyleAdapter and fix tests

* Lint

* Lint
2019-02-08 11:14:50 +01:00
Jc2k
ee3631e93e Fix homekit_controller non-standard hk characteristics (#20824) 2019-02-08 11:00:51 +01:00
Diogo Gomes
55d1d3d8ae Move weather.ipma into a component (#20706)
* initial version

* works

* lint

* move

* hound

* fix formatting

* update

* add extra features

* houmd

* docstring

* fix tests

* lint

* update requirements_all.txt

* new tests

* lint

* update CODEOWNERS

* MockDependency pyipma

* hound

* bump pyipma version

* add config_flow tests

* lint

* improve test coverage

* fix test

* address comments by @MartinHjelmare

* remove device_info

* hound

* stale comment

* Add deprecation warning

* address comments

* lint
2019-02-08 10:55:58 +01:00
Marvin Wichmann
1e95719436 Support knx tunable white and color temperature lights (#19699)
* KNX: Bumped version to 0.9.4 and added support for tunable white and color temperature for lights.

* Updated to the latest changes

* return None when ct value is unknown

- return None instead of default value when ct is unknown
- remove DEFAULT_COLOR_TEMPERATURE

* use Kelvin as base for relative color temperature

use Kelvin as base for relative color temperature instead of Mireds

* moved fallback value tests for clarity

* Update request from oliverblaha

Co-Authored-By: marvin-w <marvin@fam-wichmann.de>

* Address suggested changes

* Update homeassistant/components/knx/light.py

Co-Authored-By: marvin-w <marvin@fam-wichmann.de>

* Update homeassistant/components/knx/light.py

Co-Authored-By: marvin-w <marvin@fam-wichmann.de>
2019-02-08 08:28:52 +01:00
Andrew Sayre
706810bbce Add SmartThings Sensor platform (#20848)
* Add Sensor platform and update pysmartthings 0.6.0

* Add tests for Sensor platform

* Redesigned capability subscription process

* Removed redundant Entity inheritance

* Updated per review feedback.
2019-02-07 21:51:17 -07:00
Aaron Bach
c7df4cf092 Make monitored_conditions more specific in Ambient PWS (#20803)
* Make monitored_conditions more specific in Ambient PWS

* Revert messing around with storing monitored_conditions elsewhere

* Come on, Aaron
2019-02-07 21:39:30 -07:00
Paulus Schoutsen
e59240fa00 Add default_config component (#20799)
* Add default config component

* Add default_config to default config

* Fix comments
2019-02-07 20:07:15 -08:00
Aaron Bach
222c4ea6f3 Added Ambient PWS to device registry (#20841) 2019-02-07 21:12:58 -06:00
Paulus Schoutsen
49bab574b9 Clean up Z-Wave pt2 (#20842) 2019-02-07 17:27:31 -08:00
Martin Hjelmare
5f76628665 Add MVP person component (#20290)
* Add person component

* Required first name.
* Optional last name and user id.
* Optionally track device trackers. Last device tracker state change will
  set state.
* Set device tracker state entity_id as source attribute.
* Set coordinates of device tracker state as state attributes.
* Restore state.

* Parse restored state too

* Clean up

* Add missing property decorator

* Validate source entities as device trackers

* Only use name instead of first and last name

* Add user_id validation

* Add unique_id

* Remove not needed properties

* Uniform docstrings

* Fail component setup if no valid entities

* Add tests

* Add id and use that for unique_id

* Clean up
2019-02-07 15:25:30 -08:00
David F. Mulcahey
32f2221b22 Fix zha light bugs (#20825) 2019-02-08 00:09:47 +01:00
Markus Ressel
542f024356 XS1 component (#19115)
* added xs1 main component
added implementations for switch, sensor, climate and binary_sensor

* updated code
fixed styling
added comments
removed binary_sensor (wasn't working)

* ran "gen_requirements_all.py" script

* fixed linting issues

* added config options for port and ssl
small fixes

* use already defined config constants instead of defining new ones

* avoid passing in hass to the entity

* use async keyword and proper asyncio calls
limit updates with a global lock to prevent overwhelming the gateway with concurrent requests
change info logger calls to debug

* update dependency

* removed unneeded constant

* fix lint issues

* updated requirements

* removed unused imports

* fixed some flake8 errors

* fixed some flake8 errors

* changed imports to absolute paths

* fixed some lint errors

* fixed some lint errors

* fix update of attached sensor

* reordered imports
added config defaults
check if platform is available
changed docstring

* lint fix

* review fixes

* isort

* import fix

* review fix

* review fix

* review fix

* removed unused imports

* lint fix

* lint fix

* climate fix
exclude sensors that will be used in climate component from default sensor category

* .coveragerc fix

* lint fix

* moved platform to it's own package
2019-02-07 23:21:41 +01:00
Paulus Schoutsen
a9672b0d52 Load as many components in parallel as possible (#20806)
* Load as many components in parallel as possible

* Lint
2019-02-07 22:56:40 +01:00
Paulus Schoutsen
f3b20d138e Embed Z-Wave platforms (#20810) 2019-02-07 22:50:59 +01:00
Aaron Bach
d24ccbd1e6 Fix binary sensor in Ambient PWS (#20801)
* Fix binary sensor in Ambient PWS

* Correctly load entities

* Corrected what on and off means for existing sensor

* Make sure to return a boolean

* Member comments

* Binary sensor doesn't need state property
2019-02-07 14:35:23 -07:00
Ville Skyttä
d45f25ce2c Add more type hints to helpers (#20811)
* Add type hints to helpers.aiohttp_client

* Add type hints to helpers.area_registry
2019-02-07 13:34:14 -08:00
Paulus Schoutsen
16159cc3d0 Update platform loading path (#20807)
* Warn when platform loaded from an entity component folder

* Fix tests
2019-02-07 13:33:12 -08:00
Diogo Gomes
e0f63132e8 Deduplication of log entries in system_log (#20493)
* Deduplication of log entries

* fix
2019-02-07 13:32:37 -08:00
Timmo
968f98706e GitHub Sensor (#19561)
*  Add GitHub sensor

* 👕 fix tox lint warning

* 🔨 Add GitHub to .coveragerc

* 👕 Fix pylint warning

* 🔨 Use config.get

* 🔥 Tighten validation

* 👕 fix linter error

* 🔨 Add path for context in errors

*  Add releases

*  Add GitHub Enterprise server support

* 🔨 remove unused constant

* 🔨 Requested changes

* 🔨 Reorder imports

* 🔨 Change to CONF_URL

* 🔨 Add docstring

* 🔨 Add validation for repo list

* ⬆️ Update PyGithub to 1.43.5

* 🔨 Sort attributes

* 🔥 Fix validation

* 👕 Fix linting issue

* 🔨 Fail platform setup when data init fails with bad credentials etc

* 👕 Fix whitespace lint error

* 🔨 Fix requirements_all version

* 👕 Linter fix attempt

* 🔥 Missing bracket

* 🔥 Another attempt to at a linter fix

* 🔥 Fix indentation

* 🔨 Reduce exception down to main one

* 🔥 Remove update throttle logic

* 🔨 Reduce calls

* 👕 Remove unused imports

* 🔥 🔨 Reduce attribute data

* 👕 Remove unused json import

* 🔨 Remove username and password

* 🔥 Fix counts

* 🔨 Update attrs and add any missing

* 🔨 Add unique_id

* 🔥 Convert uuid to string

* 🔥 Replace UUID with repository path

* 🔨 Cleanup

* 🔨 Cleanup

* 🔥 Remove unused variable

* 🔨 Change to update instead of _update

* 🔨 Improved consistency

* 🔨 Improve consistency

* 👕 Fix line lengths

* 🔨 Fix length

* 🔨 Fix syntax
2019-02-07 18:34:27 +01:00
David F. Mulcahey
d177e1324c Add device ieee to zha events (#20791) 2019-02-07 16:31:24 +01:00
David F. Mulcahey
d4c34c6b02 Cleanup zha listener lifecycle (#20789) 2019-02-07 09:23:01 +01:00
David F. Mulcahey
03ab152c82 Enable the available property for zha entities (#20788) 2019-02-07 09:14:19 +01:00
Fabian Affolter
1715a2070b Upgrade astral to 1.9.2 (#20796) 2019-02-06 22:00:39 -08:00
William Scanlon
ff84c01d41 Remove wink sensor log calls (#20798)
* Removed log calls

* pass during exception
2019-02-07 06:22:44 +01:00
Daniel Høyer Iversen
850556d6c3 upgrade switchmate lib (#20792) 2019-02-06 21:41:38 -05:00
Fabian Affolter
a611fb1664 Upgrade distro to 1.4.0 (#20797) 2019-02-06 21:40:38 -05:00
Robert Schindler
06f3e8137a Added command_line auth provider that validates credentials by calling a command (#19985)
* Added external auth provider that calls a configurable program

Closes #19975

* Raise proper InvalidAuth exception on OSError during program execution

* Changed name of external auth provider to command_line

* Renamed program config option to command in command_line auth provider

* Made meta variable parsing in command_line auth provider optional

* Added tests for command_line auth provider

* Fixed indentation

* Suppressed wrong pylint warning

* Fixed linting

* Added test for command line auth provider login flow

* Log error when user fails authentication

* Use %r formatter instead of explicit repr()

* Mix all used names of typing module into module namespace

I consider this nasty and bad coding style, but was requested by
@awarecan for consistency with the remaining codebase.

* Small code style change

* Strip usernames with command_line auth provider
2019-02-06 16:36:41 -08:00
Paulus Schoutsen
c366fa00d8 Merge pull request #20794 from home-assistant/rc
0.87.0
2019-02-06 14:57:53 -08:00
Paulus Schoutsen
180689fb04 Bumped version to 0.87.0 2019-02-06 11:49:56 -08:00
Paulus Schoutsen
9912e0fc48 Make sure Locative doesn't submit invalid device IDs (#20784) 2019-02-06 11:49:08 -08:00
Erik Hendrix
58b7905276 Update version for pymyq to 1.1.0
Update version of pymyq to 1.1.0; this version brings improved functionality, reducing errors for retrieving current state for the MyQ covers.
2019-02-06 11:48:20 -08:00
Fredrik Erlandsson
a6bcb515f9 Fix tellduslive responsiveness (#20603)
* use async_call_later for update

* no need to timeout

* fixes

* move init tasks to hass.loop

* version bump of tellduslive

* fixes for @MartinHjelmare

* fixes task cancel

* don't return from new client
2019-02-06 11:47:32 -08:00
Greg Johnson
fb1da53568 Allow both VOLUME_STEP and VOLUME_SET (#20732)
* Allow both VOLUME_STEP and VOLUME_SET

Seems like it should be possible to support both at the same time.

* Update test to allow VOLUME_SET and VOLUME_STEP
2019-02-06 11:16:21 -08:00
Paulus Schoutsen
59393ab085 Prevent template changing options (#20775)
* Prevent complex template validation changing input value

* Remove deprecation warnings
2019-02-06 11:15:27 -08:00
David F. Mulcahey
e6cd04d711 ZHA component rewrite (#20434)
* rebase reorg

* update coveragerc for now

* sensor cleanup

* remove availability tracking for entities

* finish removing changes from tests

* review comments pass 1

* use asyncio.gather - review comments

* review comments

* cleanup - review comments

* review comments

* review comments

* cleanup

* cleanup - review comments

* review comments

* review comments

* use signal for removal

* correct comment

* remove entities from gateway

* remove dead module

* remove accidently committed file

* use named tuple - review comments

* squash bugs

* squash bugs

* add light and sensor back to coveragerc until % is higher
2019-02-06 13:33:21 -05:00
Paulus Schoutsen
65a225da75 Make sure Locative doesn't submit invalid device IDs (#20784) 2019-02-06 09:50:48 -08:00
Pawel
208f1a4a47 Allow pausing xiaomi vacuum in all states (#20620)
* fix state update when no cleaning is yet performed
allow pause vacuum when returning to base

* revert checking of atttribute updates. Will be fixed in upstream lib.

* remove unnecesarry if on pause_commadn
2019-02-06 13:04:01 +01:00
Eliran Turgeman
3de21d3fda Fix waze_travel_time component ERROR on startup (#20316)
* Fix waze_travel_time component ERROR on startup

Fix the unhandled exception with Waze Travel Time sensor upon startup,
by adding Throttle before update_interval are starting.

* add missing whitespace after ','

* fix line too long (80 > 79 characters)

* lint

* fix interval to use const

* Change to Throttle as a decorator to update

Change to Throttle as a decorator to update instead of self.update = Throttle(interval)(self.update)
remove unnecessary code.

* fix  indentations

* Update waze_travel_time.py

* Update waze_travel_time.py

* Update waze_travel_time.py
2019-02-06 11:42:11 +01:00
Oleksii Serdiuk
574823fcbb Flux Led: Add support for defining custom effect (#19072)
Flux Led controllers support defining a custom effect. User may define
up to 16 colors, speed of switching between them, and transition type.

Additional changes:

 - add support for reporting currently running effect on the controller.

 - make effects list sorted, so it's easier to find specific effect in
   the list.
2019-02-06 11:40:57 +01:00
OleksandrBerchenko
a1477fa156 Fix error handling in switch.broadlink module (#20772)
* Fix error handling in switch.broadlink module

* Improve error messages
2019-02-06 11:39:56 +01:00
Paulus Schoutsen
b8cc547fa3 Move components to folders (#20774)
* Move all components into folders

* Move component tests into folders

* Fix init moving

* Move tests

* Lint

* Update coverage

* Fix service descriptions

* Update CODEOWNERS
2019-02-05 19:31:15 -08:00
William Scanlon
d13b2ca6ef Added egg age to the eggminder sensor (#20758)
* Added egg age to the eggminder sensor
2019-02-05 21:26:54 -05:00
Joakim Plate
3bb5caabe2 Reproduce states by letting each component opt in on handling state recovery itself (#18700)
* Move group to it's own setup

* Let each component to handle restore of state

* Move constants for climate into const.py

For now import all into __init__.py to keep backword compat

* Move media plyaer constants to const.py file

For now import all constants into __init__.py to keep
backword compatibility

* Move media player to it's own file

* Move climate to it's own file

* Remove ecobee service from common components

BREAKING CHANGE

* Add tests for climate

* Add test for media_player

* Make sure we clone timestamps of state

* Add tests for groups

* Remove old tests for media player, it's handled by other tests

* Add tests for calls to component functions

* Add docstring for climate const

* Add docstring for media_player const

* Explicitly import constants in climate

* Explicitly import constants in media_player

* Add period to climate const

* Add period to media_player const

* Fix some lint errors in climate

* Fix some lint errors in media_player

* Fix lint warnings on climate tests

* Fix lint warnings on group tests

* Fix lint warnings on media_player tests

* Fix lint warnings on state tests

* Adjust indent for state tests
2019-02-05 17:25:27 -08:00
Fredrik Erlandsson
c76a61ad16 Fix tellduslive responsiveness (#20603)
* use async_call_later for update

* no need to timeout

* fixes

* move init tasks to hass.loop

* version bump of tellduslive

* fixes for @MartinHjelmare

* fixes task cancel

* don't return from new client
2019-02-05 15:20:23 -08:00
Daniel Høyer Iversen
ca17d4395a Merge pull request #20766 from home-assistant/Danielhiversen-patch-1
Fix opensensemap doc url
2019-02-05 19:57:31 +01:00
Paulus Schoutsen
e8dfc326d3 Bumped version to 0.87.0b6 2019-02-05 08:04:49 -08:00
Paulus Schoutsen
3d75e1c299 Keep cloud tokens always valid (#20762)
* Keep auth token always valid

* Remove unused refresh_auth message

* Capture EndpointConnectionError

* Lint
2019-02-05 08:04:41 -08:00
Daniel Høyer Iversen
5b4cc20ce4 opensensemap doc url 2019-02-05 16:15:41 +01:00
Andreas Hartl
a94a24f6f8 Added HomeKit fan speed based on speed_list (#19767)
Speed_list needs to be in ascending order.
2019-02-05 16:11:19 +01:00
Tomas Hellström
208ea6eae4 SMHI component: Bugfix - calc precipitation (#20745)
* Bugfix - calc precipitation

* Feedback: better way to skip first forecast

* Even less messy way

* lint error
2019-02-05 07:43:04 -05:00
Eliseo Martelli
e581d41ded Fix googlehome alarm sensor platform (#20742)
* fixed googlehome alarm sensor platform

* removed info and moved info discovery out of loop

* moved device info up
2019-02-05 07:42:14 -05:00
Jean Gauthier
aa4a3d8b96 Modifying MTUs acquisition (#20654)
**Description:**

I modified the file because it should not disable a MTU based on voltage or power. If one has programmed a certain amount of MTUs in his Gateway, they should be all visible and show 0W or 0V. 
The problem arises when you have a device that shuts off at night (e.g.: pool pump). It pulls 0W for a while, I don't want my interface to show a big yellow error during that time because the sensor no longer exists. Even the 0V is not a good idea because we can use it to indicate the breaker has tripped.

Hopefully it would be accepted :-)
2019-02-05 11:26:28 +01:00
Daniel Høyer Iversen
ef6b0b8e0b Update flake8 to 3.7.5 (#20761)
* Upgrade flake8

* Upgrade flake8

* Add noqa for hound
2019-02-05 11:12:09 +01:00
Paulus Schoutsen
2733919cd8 Keep cloud tokens always valid (#20762)
* Keep auth token always valid

* Remove unused refresh_auth message

* Capture EndpointConnectionError

* Lint
2019-02-05 10:45:03 +01:00
Steven Looman
7f76210549 Upgrade to async_upnp_client==0.14.4 (#20751) 2019-02-04 22:01:51 -08:00
Jason Hu
a8b4467763 Fix the line reference in config error message (#20743)
* Fix the line reference in config error message

* Fix platform config validation

* Fix test

* Handle error in error handling routine
2019-02-04 22:01:50 -08:00
Pascal Vizeli
cfa03a408e Fix cloud webhook body (#20739)
* Bugfix cloud webhooks text response

* address comments

* Fix lint
2019-02-04 22:01:49 -08:00
Paulus Schoutsen
94ab5dca7f Improve cloud error handling (#20729)
* Improve cloud error handling

* Lint
2019-02-04 22:01:48 -08:00
Jason Hu
207a050dba Fix ffmpeg v4 stream issue (#20314)
* Add ffmpeg version

* Add ffmpeg stream content type

* Change ffmpeg camera stream content type

* Change ffmpeg stream content type

* Lint

* Add a none guard

* Fix

* Fix

* Update onvif.py

* Fix version match regrex

* Fix regrex

* Upgrade ha-ffmpeg to 1.11

* Lint

* Get ffmpeg version in ffmpeg component setup
2019-02-04 22:01:47 -08:00
emontnemery
b1faad0a50 Use PLATFORM_SCHEMA_BASE as base schema for additional components. (#20578)
* Disable extra=vol.ALLOW_EXTRA for additional platforms.

* Remove PLATFORM_SCHEMA_2

* Add entity_namespace to base platform schema
2019-02-04 21:52:19 -08:00
Daniel Høyer Iversen
154b401d0a Update version for pymyq to 1.1.0 (#20756)
Update version of pymyq to 1.1.0; this version brings improved functionality, reducing errors for retrieving current state for the MyQ covers.
2019-02-05 06:42:39 +01:00
Andrew Sayre
f84317e325 Update pysmartthings to 0.5.0 (#20759) 2019-02-05 06:42:30 +01:00
Steven Looman
e0d534c3fb Upgrade to async_upnp_client==0.14.4 (#20751) 2019-02-05 00:36:25 +00:00
Erik Hendrix
3880a70965 Update version for pymyq to 1.1.0
Update version of pymyq to 1.1.0; this version brings improved functionality, reducing errors for retrieving current state for the MyQ covers.
2019-02-04 16:48:35 -07:00
jonudewux
cd04661101 Add Transmission component 'scan_interval' option (#20575)
* Transmission component fix 'scan_interval' option

* Fix dict[key] comments

* Fix latest mess
2019-02-04 20:08:38 +00:00
Pascal Vizeli
29b64d56be Fix cloud webhook body (#20739)
* Bugfix cloud webhooks text response

* address comments

* Fix lint
2019-02-04 10:58:38 -08:00
Jason Hu
c812176e94 Fix the line reference in config error message (#20743)
* Fix the line reference in config error message

* Fix platform config validation

* Fix test

* Handle error in error handling routine
2019-02-04 10:58:06 -08:00
emontnemery
79d3f533a9 Add missing abbreviations (#20741) 2019-02-04 10:54:40 -08:00
Jason Hu
7455d950b1 Fix ffmpeg v4 stream issue (#20314)
* Add ffmpeg version

* Add ffmpeg stream content type

* Change ffmpeg camera stream content type

* Change ffmpeg stream content type

* Lint

* Add a none guard

* Fix

* Fix

* Update onvif.py

* Fix version match regrex

* Fix regrex

* Upgrade ha-ffmpeg to 1.11

* Lint

* Get ffmpeg version in ffmpeg component setup
2019-02-04 09:57:22 -08:00
Eliseo Martelli
a40c5bf70e Add google home alarm sensor (#20709)
* added googlehome alarm sensor

* splitted update method

* fix linting

* remove whitespace

* removed whitespace in line

* changed accordingly to the review

* removed redundant method

* Update homeassistant/components/googlehome/__init__.py

Co-Authored-By: eliseomartelli <martely98@gmail.com>
2019-02-04 07:44:23 -08:00
David F. Mulcahey
0cf71d5bcb Add ZHA light tests (#20713)
* add sensor tests

* add light test

* update comments

* fix coveragerc after rebase
2019-02-04 06:51:47 -05:00
David F. Mulcahey
ff9a33ba36 Add ZHA fan tests (#20712)
* add sensor tests

* add fan tests

* hound

* fix coveragerc

* update comments
2019-02-04 06:51:32 -05:00
David F. Mulcahey
b9d108284b Add ZHA binary sensor tests (#20711)
* add sensor tests

* add binary sensor tests

* add comments

* fix coveragerc after rebase
2019-02-04 06:51:13 -05:00
Paulus Schoutsen
07b5b68a51 Improve cloud error handling (#20729)
* Improve cloud error handling

* Lint
2019-02-04 10:14:30 +01:00
Rohan Kapoor
a3c8439ce2 Split out speedtest into a component and a sensor platform (#20527)
* Move sensor.speedtest to the new speedtestdotnet component.

* Split out speedtest.net into a component and sensor platform

* Remove the throttle and add async_track_time_interval

* Add should_poll and cleanup

* Update requirements_all.txt

* Move time interval tracking out of the data class and into the setup method

* Add now=None argument to update
2019-02-04 00:47:04 -08:00
Rohan Kapoor
ec625f02fc Clean up fastdotcom by doing time tracking outside of the data object (#20725) 2019-02-03 22:43:59 -08:00
Paulus Schoutsen
7d334783de Bumped version to 0.87.0b5 2019-02-03 15:27:14 -08:00
David Lie
027fcf269b Revert pyfoscam back to libpyfoscam (#20727)
* Change foscam python library to pyfoscam, which is more up to date and has several critical bug fixes.

* Update requirements_all.txt to match.

* Inserting automatically generated requirements.txt

* Revert changes until pyfoscam captures recent bug fixes. The pyfoscam version pulled by pip is currently broken.

* Updated requirements_all.txt based on changing pyfoscam back to libpyfoscam.
2019-02-03 15:26:19 -08:00
Aaron Bach
e1509bcc0c Fix temperature unit conversion in Ambient PWS (#20723) 2019-02-03 15:26:18 -08:00
Andrew Sayre
9a13aafeea Add SmartThings button support via events (#20707)
* Add event support for buttons

* binary_sensor test clean-up
2019-02-03 15:26:17 -08:00
Paulus Schoutsen
1fe67fb1b0 Updated frontend to 20190203.0 2019-02-03 15:24:46 -08:00
Aaron Bach
a05031c22e Fix temperature unit conversion in Ambient PWS (#20723) 2019-02-03 15:23:30 -08:00
David Lie
ce05af2720 Revert pyfoscam back to libpyfoscam (#20727)
* Change foscam python library to pyfoscam, which is more up to date and has several critical bug fixes.

* Update requirements_all.txt to match.

* Inserting automatically generated requirements.txt

* Revert changes until pyfoscam captures recent bug fixes. The pyfoscam version pulled by pip is currently broken.

* Updated requirements_all.txt based on changing pyfoscam back to libpyfoscam.
2019-02-03 14:47:38 -08:00
Aaron Bach
e90011fd88 Remove SUPPORT_VOLUME_SET from Fire TV component (#20718)
Volume control isn't actually implemented, so it shouldn't show as being supported.
2019-02-03 14:58:00 -07:00
Jeff Irion
5c4dc3a54f Add app_id property to Fire TV component (#20719) 2019-02-03 14:57:17 -07:00
Dane
5506569c3a Change log level for 'loading devices' message (#20721)
The 'Loading [wireless] devices from Mikrotik ([ip address])' message
is incredibly spammy at the info log level, such that in the last 24
hours on my installation, that log message has appeared 6732 times,
versus 70 for every other log message. I've moved this message to the
debug log level as I don't believe it adds anything at the info level,
and makes it harder to diagnose other problems.
2019-02-03 13:06:39 -08:00
David F. Mulcahey
9c11602674 Add ZHA sensor tests (#20710)
* add sensor tests

* update switch test

* add sensor back to coveragerc

* review comments

* added comments
2019-02-03 22:03:35 +01:00
Paulus Schoutsen
5f2d209dec Updated frontend to 20190203.0 2019-02-03 11:32:26 -08:00
Jeff Irion
0e5aa5801a Remove SUPPORT_VOLUME_SET from Fire TV component
Volume control isn't actually implemented, so it shouldn't show as being supported.
2019-02-03 09:27:49 -08:00
David F. Mulcahey
74cdf7c347 Add tests for ZHA switch (#20691)
* start test setup

test cleanup

test deps

update switch test

actually update test deps

cleanup and remove switch from coveragerc

comment

refactor to use fixtures and shared components

lint

* remove availability part that isn't in zha yet

* review comments and cleanup

* review comments

* add switch back unil post reorg merge
2019-02-03 07:03:31 -05:00
Andrew Sayre
38ea43b678 Add SmartThings button support via events (#20707)
* Add event support for buttons

* binary_sensor test clean-up
2019-02-02 22:08:37 -08:00
Paulus Schoutsen
b0200cdbfe Bumped version to 0.87.0b4 2019-02-02 20:28:03 -08:00
Diogo Gomes
c9f64af85a fix test commented in #20678 (#20680) 2019-02-02 17:05:40 -08:00
Paulus Schoutsen
e4d45bf53a Test is broken 2019-02-02 17:04:48 -08:00
Paulus Schoutsen
e984868762 Bumped version to 0.87.0b3 2019-02-02 16:32:26 -08:00
Paulus Schoutsen
e5835eb7c8 Remove fingerprint middleware (#20682)
* Remove fingerprint middleware

* Lint
2019-02-02 16:32:20 -08:00
Paulus Schoutsen
3553d26f6b Updated frontend to 20190202.0 2019-02-02 14:12:23 -08:00
Paulus Schoutsen
c2eec16721 Update translations 2019-02-02 14:12:23 -08:00
Paulus Schoutsen
f73cb0eba5 Bumped version to 0.87.0b2 2019-02-02 14:09:55 -08:00
Andrew Sayre
d3e011ff50 Add SmartThings Binary Sensor platform (#20699)
* Add SmartThings binary_sensor platform

* Fixed comment typo.
2019-02-02 14:09:44 -08:00
emontnemery
4255f2c62f Add entity_namespace to PLATFORM_SCHEMA (#20693)
* Add entity_namespace to base platform schema

* Add test

* Fix
2019-02-02 14:09:43 -08:00
Andrew Sayre
b669e1498a Add SmartThings Fan platform (#20681)
* Add SmartThings fan

* Removed unnecessary update method

* Corrected usage of async_schedule_update_ha_state

* Clean-up/optimization
2019-02-02 14:09:42 -08:00
Rohan Kapoor
c0fd22c285 Fix allow extra in locative webhook schema validation (#20657)
* Allow extra in locative webhook schema validation (fixes #20566)

* Remove extra attribute
2019-02-02 14:09:41 -08:00
Andrew Sayre
785b42ecde Add SmartThings Light platform (#20652)
* Add SmartThings Light platform and tests

* Cleaned a few awk comments

* Updates per review feedback

* Switched to super

* Changes per review feedback
2019-02-02 14:09:40 -08:00
Andrew Sayre
6458abca2e Add SmartThings Binary Sensor platform (#20699)
* Add SmartThings binary_sensor platform

* Fixed comment typo.
2019-02-02 14:06:30 -08:00
Andrew Sayre
acf5b04231 Add SmartThings Fan platform (#20681)
* Add SmartThings fan

* Removed unnecessary update method

* Corrected usage of async_schedule_update_ha_state

* Clean-up/optimization
2019-02-02 14:04:29 -08:00
Paulus Schoutsen
8988ee5b34 Updated frontend to 20190202.0 2019-02-02 14:03:37 -08:00
Paulus Schoutsen
61b2f1bff0 Update translations 2019-02-02 14:03:37 -08:00
emontnemery
bada9b5e0b Add entity_namespace to PLATFORM_SCHEMA (#20693)
* Add entity_namespace to base platform schema

* Add test

* Fix
2019-02-02 18:31:28 +01:00
Peter Nijssen
fee3468b7a add peternijssen as codeowner of spider component (#20695) 2019-02-02 09:23:20 -08:00
Paulus Schoutsen
e2d3c27e85 Embed all platforms into components (#20677)
* Consolidate all components with platforms

* Organize tests

* Fix more tests

* Fix Verisure tests

* one final test fix

* Add change

* Fix coverage
2019-02-02 07:13:16 -08:00
Andrew Sayre
a24da611c5 Add SmartThings Light platform (#20652)
* Add SmartThings Light platform and tests

* Cleaned a few awk comments

* Updates per review feedback

* Switched to super

* Changes per review feedback
2019-02-02 07:12:24 -08:00
Diogo Gomes
ca143f8a35 print() left behind (#20689) 2019-02-02 14:54:46 +01:00
Paulus Schoutsen
47f60e6cf2 Remove fingerprint middleware (#20682)
* Remove fingerprint middleware

* Lint
2019-02-02 11:52:34 +01:00
Diogo Gomes
384a9625c9 fix test commented in #20678 (#20680) 2019-02-01 22:11:50 -08:00
Rohan Kapoor
fcccf133ba Split out fastdotcom into a component and a sensor platform (#20341)
* Split out fastdotcom into a component and a sensor platform

* Update .coveragerc

* Switching to async and using a Throttle

* Add the async_track_time_interval call

* Remove the throttle

* Reorder sensor methods and add should_poll property
2019-02-01 21:50:22 -08:00
Paulus Schoutsen
9e765fb05d Merge pull request #20678 from home-assistant/skip-broken-test
Test is broken
2019-02-01 16:33:02 -08:00
Paulus Schoutsen
c9671f8205 Test is broken 2019-02-01 16:31:53 -08:00
Paulus Schoutsen
ec57db78b5 Consolidate config flow components (#20635)
* Consolidate config flow components

* Fix tests

* Fix tests

* Put unifi back

* Fix reqs

* Update coveragerc
2019-02-01 15:45:44 -08:00
Paulus Schoutsen
224c258876 Bumped version to 0.87.0b1 2019-02-01 14:35:23 -08:00
Oliver Völker
e4d76d5c44 InfluxDB - change connection test method (#20666) 2019-02-01 14:10:39 -08:00
emontnemery
c702e1e3c6 Add PLATFORM_SCHEMA_BASE support to check_config.py (#20663) 2019-02-01 14:10:39 -08:00
zewelor
47660f9312 Fix parsing yeelight custom effects, when not present in config (#20658) 2019-02-01 14:10:38 -08:00
Kevin Fronczak
1a5028f56f Upgrade blinkpy to re-enable motion detection (#20651) 2019-02-01 14:10:38 -08:00
Paulus Schoutsen
ca729b178b Fix geofency requiring a configuration.yaml entry (#20631) 2019-02-01 14:10:37 -08:00
emkay82
557b745053 Fix pjlink issue (#20510)
* Fix issue #16606

Some projectors do not respond to pjlink requests during a short period after the status changes or when its in standby, resulting in pypjlink2 throwing an error. This fix catches these errors. Furthermore, only the status 'on' and 'warm-up' is interpreted as switched on, because 'cooling' is actually a switched off status.

* Update pjlink.py

Improved error handling

* Update pjlink.py

Improved error handling

* Update pjlink.py

Clean up
2019-02-01 14:10:37 -08:00
Paulus Schoutsen
57ef8c271e Fix geofency requiring a configuration.yaml entry (#20631) 2019-02-01 14:09:23 -08:00
Till
495524ecc0 Update miflora.py to have relevant sensor icons (#20650)
* Update miflora.py to have relevant sensor icons

Adds relevant default icons for the sensors of the Mi Flora plant sensor component.

* Clean up code
2019-02-01 14:08:03 -08:00
Paulus Schoutsen
0400e29f7a Updated frontend to 20190201.0 2019-02-01 12:51:17 -08:00
Paulus Schoutsen
da807b20a0 Updated frontend to 20190201.0 2019-02-01 12:50:58 -08:00
Fabian Affolter
198dc2b7a9 Upgrade rxv to 0.6.0 (#20669) 2019-02-01 21:37:00 +01:00
Ville Skyttä
3f997aefc1 Add huawei_lte notify component (#19544)
* Add huawei_lte notify component

* Use CONF_RECIPIENT instead of ATTR_TARGET in config
2019-02-01 18:42:45 +01:00
Oliver Völker
aec8ad2188 InfluxDB - change connection test method (#20666) 2019-02-01 18:35:49 +01:00
Akın Ömeroğlu
f19bbaec08 Update deconz integration text for PWA (#20634)
Text should reflect the GUI it describes
2019-02-01 18:28:30 +01:00
emontnemery
44c2a83105 Add PLATFORM_SCHEMA_BASE support to check_config.py (#20663) 2019-02-01 08:14:02 -08:00
emkay82
47d24759f2 Fix pjlink issue (#20510)
* Fix issue #16606

Some projectors do not respond to pjlink requests during a short period after the status changes or when its in standby, resulting in pypjlink2 throwing an error. This fix catches these errors. Furthermore, only the status 'on' and 'warm-up' is interpreted as switched on, because 'cooling' is actually a switched off status.

* Update pjlink.py

Improved error handling

* Update pjlink.py

Improved error handling

* Update pjlink.py

Clean up
2019-02-01 14:53:40 +01:00
zewelor
7429b9d87e Fix parsing yeelight custom effects, when not present in config (#20658) 2019-02-01 10:59:05 +01:00
Kevin Fronczak
25e1639050 Upgrade blinkpy to re-enable motion detection (#20651) 2019-02-01 00:52:30 -08:00
Rohan Kapoor
3e2dae62c0 Fix allow extra in locative webhook schema validation (#20657)
* Allow extra in locative webhook schema validation (fixes #20566)

* Remove extra attribute
2019-02-01 00:40:27 -08:00
Rohan Kapoor
9e7d7354ed Fix sensor.cpuspeed inside docker container (#20614) (#20656) 2019-02-01 08:58:29 +01:00
Thomas Hervé
5f930debd4 Fix xiaomi default gateway in services (#20623)
When xiaomi_aqara services with one gateway, the default should be set
to the sid of the gateway, not the python object itself, otherwise the
call fails.
2019-02-01 06:59:31 +01:00
Julius Mittenzwei
74794102c8 Support for new velux api, added cover.velux (#18738)
* Support for new velux api, added cover.velux

* More steps on new velux covers.

* correct position handling of velux windows

* Following suggestion from hound.

* bumped version

* added cover stop

* bumped version of pyvlx

* Bumped version to 0.2.8

* removed log_frames parameter
2019-02-01 02:13:47 +01:00
Alok Saboo
c63a37d0ad Revert #20611: code in Abode alarm panel (#20629) 2019-01-31 21:24:52 +01:00
Jason Hu
d7b61f7ff6 Move mqtt_mock to tests/components/mqtt/conftest.py (#20621)
* Move mqtt_mock to tests/components/mqtt/conftest.py

* Move mqtt room presence sensor test to tests/components/mqtt

* Revert "Move mqtt room presence sensor test to tests/components/mqtt"

This reverts commit e08bc143

* Decouple mqtt room presence sensor test and mqtt_mock
2019-01-31 21:22:29 +01:00
Joakim Sørensen
632b2042e4 Split googlehome to a component with device tracker platform (#19971)
* Add component for googlehome

* Add missing name in CODEOWNERS

* Linting issues

* googledevices version bump

* Use NAME from component instead of DOMAIN

* Cleaner handling of accepted devices in for loop

* Fixes one linting issue

* Validate device_types

* Fixes one linting issue

* Fixes linting issue

* Revert 0abb642 and import DOMAIN as GOOGLEHOME_DOMAIN

* Return false if discovery_info is None

* Combine if's in for loop

* Use async_load_platfrom

* Fix line length

* Add error message to user

* Shorter log message

* error -> warning, remove period

* Update .coveragerc

* Move to correct place
2019-01-31 21:16:31 +01:00
Sander Zumbrink
e20c2aa113 Add precision parameter to dsmr sensor (#19873)
* Added precision parameter to dsmr sensor

* Added precision parameter to dsmr sensor, added whitespace after comma

* Added precision parameter to dsmr sensor

* Added precision parameter to dsmr sensor, fixed test

* Changed try except as requested
2019-01-31 16:46:54 +01:00
Julien Brochet
c9971673da Update synology-srm dependency to 0.0.4 (#20625) 2019-01-31 15:26:42 +01:00
Thomas Hervé
511e35e8fd Fix typo in config entries doc (#20619)
This fixes a typo in the docstring of config_entries which was
propagated in the point component.
2019-01-31 10:52:42 +01:00
Paulus Schoutsen
7151c4bcd7 Bumped version to 0.88.0.dev0 2019-01-30 17:38:17 -08:00
Paulus Schoutsen
8db2152230 Bumped version to 0.87.0b0 2019-01-30 17:37:56 -08:00
Paulus Schoutsen
47848e26f9 Merge remote-tracking branch 'origin/master' into dev 2019-01-30 17:37:38 -08:00
Diogo Gomes
c7ff8d4996 fix #20571 (#20589) 2019-01-30 17:33:52 -08:00
Andrew Sayre
69ec7980ad Add SmartThings component and switch platform (#20148)
* Added SmartThings component and switch platform

* Corrected comment typos.

* Embedded switch platform.

* Replaced custom view usage with webhook component.

* Replaced urls with tokens in strings.

* Fixed line length.

* Use generated webhook id instead of static one.

* Reuse core constant instead of defining again.

* Optimizations in anticipation of future platforms.

* Use async_generate_path instead of hard-coded path.

* Fixed line length.

* Updates per review feedback.

* Updates per latest review feedback.
2019-01-30 17:31:59 -08:00
Jasper van der Neut - Stulen
5a0c707a37 Fix duplicate luftdaten entities (#20226)
* Use same data schema for configflow, make sensor_id a positive integer.

* Change sensor_id to int and remove duplicate Luftdaten config entries.

This fixes #18838, and also fixes the root cause
of #19981 and #19622.

* Use pure type for boolean.
2019-01-30 17:12:59 -08:00
Paulus Schoutsen
473bf93973 Updated frontend to 20190130.1 2019-01-30 17:00:36 -08:00
David F. Mulcahey
ed75549123 ZHA component rewrite part 4 - add device module (#20469)
* add device module

* spelling

* review comments

* filter out endpoint id 0 (ZDO)

* review comments

* change name

* remove return
2019-01-30 16:44:22 -05:00
Alok Saboo
3e98aad8a2 Added code to Abode Alarm control panel (#20611) 2019-01-30 13:02:23 -08:00
Gido
542160fc56 Add sensor platform for Rova Garbage Collection (#18868)
* Adding sensor for SolarEdge Monitoring API support

* Adding support for Rova garbage calendar

* Added Rova platform to retrieve garbage pickup times

* Update async to new syntax
Added async_update to sensor class
Added Throttle to Rova update function
Minor code style changes

* Small style fixes

* Removed domain

* Update debug to error messages
Change CONF_MONITORED_VARIABLES to CONF_MONITORED_CONDITIONS
Update async update call to normal update

* Update requirements to rova v0.0.2
Add address check to see if ROVA collects in the given area

* Rename entity names to English
Add json_key to Sensor entities

* Add device_class to the RovaSensor

* Fix pylint and flake8 messages

* Add check for None in case collection date is unknown

* Return device class constant
2019-01-30 21:58:41 +01:00
Paulus Schoutsen
e2cc1564a0 Add lovelace systeam health (#20592) 2019-01-30 12:57:56 -08:00
William Scanlon
2836ff86fe Update to the newest python-wink and fix push updates! (#20594)
* Update to the newest python-wink and make post session call to Wink to keep pubnub working.

* Update __init__.py
2019-01-30 11:35:47 -08:00
Paulus Schoutsen
cb07ea0d60 RFC: Add system health component (#20436)
* Add system health component

* Remove stale comment

* Fix confusing syntax

* Update test_init.py

* Address comments

* Lint

* Move distro check to updater

* Convert to websocket

* Lint

* Make info callback async

* Fix tests

* Fix tests

* Lint

* Catch exceptions
2019-01-30 10:57:53 -08:00
Anders Melchiorsen
91aa874c0c Fix LIFX for single-zone strip extensions (#20604) 2019-01-30 10:47:28 -08:00
Paulus Schoutsen
ca0ee509e7 Fix map icons (#20602) 2019-01-30 09:50:58 -08:00
Paulus Schoutsen
8062f48973 Add remove commmand to entity registry (#20597) 2019-01-30 09:50:32 -08:00
choss
ed299a9137 Add support for FRITZ DECT 100 (temp sensor) (#20308) 2019-01-30 18:44:36 +01:00
starkillerOG
349de19316 Philips Hue: add prompt to update bridge/bulb (#20590)
* Philips Hue: add prompt to update bridge/bulb

* bump aiohue to v1.9.0

* bump aiohue to v1.9.0

* bump aiohue to v1.9.0
2019-01-30 09:42:18 -08:00
Paulus Schoutsen
7c9597f824 Fix area registry config being loaded (#20598)
* Fi area registry config being loaded

* Mark area_id optional
2019-01-30 09:41:55 -08:00
Alok Saboo
a011048a4e Change Unifi timeout (#20606) 2019-01-30 18:40:40 +01:00
Bram Kragten
0ef9882e2e Fix map icons 2019-01-30 17:09:56 +01:00
mindakas
ec4495bd0c Bump pymodbus to 1.5.2 (#20582) 2019-01-30 11:57:14 +00:00
Tommy Jonsson
c5c64e738e html5 notifications add VAPID support (#20415)
* html5 notifications add VAPID support

* fix lint errors

* replace httpapi with websocketapi

* Address my own comment
2019-01-29 14:49:33 -08:00
emontnemery
89fc3b2a1b Disable extra=vol.ALLOW_EXTRA for MQTT platforms. (#20562) 2019-01-29 09:29:02 -08:00
merc1031
48f0e8311b add empy all groups view. Makes Brilliant Lightpad work (#20564) 2019-01-29 09:26:07 -08:00
Jc2k
e0e5b860e4 Homekit Motion Sensor Review feedback (#20568) 2019-01-29 11:25:18 -05:00
kennedyshead
988bcf9399 Fixing the openssl issue (#20570) 2019-01-29 07:42:38 -08:00
MatteGary
e95c50c742 New Transmission component (#19230)
* New Transmission component and interaction

First commit for New Transmission component and interaction

* Fix commit

* Fix commit

* Fix + Switch checkin

Fix according to failed build and request, first checkin for Turtle Mode Switch in Transmission, still have to figure it out why it's not working.

* Bugfixing

* Fix commit

Multiple fix

* Fix

* fix for missing config

* Update on requirements_all.txt

* Fix in requirements_all.txt

* Fix

* Fix for build

* fix

* Fix

* Fix (again)

* Fix

* Fix indentation

* Fix indentation

* Fix Throttle

* Update .coveragerc

* Fix import and coveragerc
2019-01-29 10:27:26 +01:00
Stealth Hacker
6ff4ea1126 Add Recollect Waste (#20121)
* Added Recollect Waste Curbside Collection sensor for tracking next collection date and for which types of waste.

* Added missing schema attributes.

* Adding requirements and coverage entries for Recollect Waste platform.

* Added exception handling, some other fixes and suggestions from code review.

* Fixed reference to incorrect exception type.

* Updated requirements_all.txt with new version of recollect-waste.

* Added true to add_entities. Created constant for default time interval. Used different pylint exclusion comment.

* Using HA's CONF_SCAN_INTERVAL now. Unique_id is now set in @property.

* Changed parameter of timedelta from seconds to days.

* Added test run of recollect client during setup_platform. Using built in SCAN_INTERVAL now.

* Return nothing in setup_platform if there is an exception.
2019-01-29 09:38:01 +01:00
Richard Mitchell
a7c74151bc Treat each player as a 'device' for non-client devices. (#20074) 2019-01-29 09:15:42 +01:00
Julien Brochet
6859d5216e Add Synology SRM device tracker (#20320) 2019-01-29 09:12:10 +01:00
Paulus Schoutsen
73a0c664b8 Allow usernames to be case-insensitive (#20558)
* Allow usernames to be case-insensitive

* Fix typing

* FLAKE*
2019-01-29 08:28:52 +01:00
Diogo Gomes
b0ff51b0ef Add an Integration sensor (#19703)
* initial version

* Tested

* set state added

* lint

* lint

* remove artifacts

* Use Decimal instead of float

* simplify

* travis lint fix

* addres comments by @ottowinter

* remove job

* better sanity check

* lower error -> warning

* hound

* fix state validation

* refactor energy -> integration

* address @MartinHjelmare comments

* new style string format

* remove async_set_state

* patching the source function
2019-01-29 08:25:36 +01:00
Jc2k
e22802a4d4 Add support for HomeKit motion sensor devices (#20555) 2019-01-28 20:30:56 -08:00
Paulus Schoutsen
aa29eeba04 Merge pull request #20559 from home-assistant/rc
0.86.4
2019-01-28 20:28:08 -08:00
Rohan Kapoor
cc74035c3b Move CONF_UPDATE_INTERVAL to homeassistant.const (#20526) 2019-01-28 20:26:31 -08:00
Rohan Kapoor
fe47253f68 Fix linting error (#20488) 2019-01-28 20:26:02 -08:00
emontnemery
3ee3acd550 Update device registry of MQTT light (#20441)
* Update device registry of MQTT light

* Move config_entry to constructor
2019-01-28 19:45:34 -08:00
Paulus Schoutsen
234c759b45 Bumped version to 0.86.4 2019-01-28 17:52:42 -08:00
Fredrik Erlandsson
ba4d4bcd29 fix #20387 devices without model/protocol (#20530) 2019-01-28 17:52:36 -08:00
starkillerOG
d7bbdb033d Add check to validate gamut (#20518)
* color.util - Add check to validate gamut

* fix indents

* fix typo

* Add check to validate gamut

* Add tests for gamut checker

* fix test

* fix pylint issues

* fix hue light gamut tests

* add check to validate gamut

* move None check

* Move None check

* Include prompt to update bridge/bulb on error

* fix wrong commit

* fix error message

* Update light.py
2019-01-28 17:52:35 -08:00
kennedyshead
63fd5f2d31 Bumps aioasuswrt (#20432) 2019-01-28 17:52:35 -08:00
starkillerOG
f353d51ab1 Add check to validate gamut (#20518)
* color.util - Add check to validate gamut

* fix indents

* fix typo

* Add check to validate gamut

* Add tests for gamut checker

* fix test

* fix pylint issues

* fix hue light gamut tests

* add check to validate gamut

* move None check

* Move None check

* Include prompt to update bridge/bulb on error

* fix wrong commit

* fix error message

* Update light.py
2019-01-28 17:52:00 -08:00
Per Osbäck
3f484228cb Add missing switch for motion_detect (#20540) 2019-01-28 16:48:55 -08:00
Fredrik Erlandsson
717a0c2b2d fix #20387 devices without model/protocol (#20530) 2019-01-28 16:46:37 -08:00
David F. Mulcahey
34090bd021 ZHA component rewrite part 3 - update helpers (#20463)
* update helpers

* address comments

* remove ieee

* cluster id as hex too
2019-01-28 16:40:00 -08:00
emontnemery
bb1583c453 Add discovery update support to MQTT camera (#20529) 2019-01-28 16:21:38 -08:00
emontnemery
d7ba2aad1d Add COMPONENT_SCHEMA and use it in alarm_control_panel (#20224)
* Add COMPONENT_SCHEMA and use in alarm and mqtt

* Revert MQTT changes

* Lint

* Small tweak

* Add tests

* Rename COMPONENT_SCHEMA to PLATFORM_SCHEMA_BASE

* Fix tests

* Improve tests
2019-01-28 16:14:55 -08:00
emontnemery
bb4ca1f525 Cleanup if discovered mqtt vacuum can't be added (#20549) 2019-01-28 15:56:47 -08:00
Robert Svensson
bd335e1ac1 Area registry (#20435)
* First draft of area registry

* Refactor based on input

* Add tests for areas
Add tests for updating device

* Updating a device shouldn't require area

* Fix Martins comment

* Require admin

* Save after deleting

* Rename read to list_areas
Fix device entry_dict
Remove area id from device when deleting area

* Fix tests
2019-01-28 15:52:42 -08:00
Aaron Bach
2c7060896b Make Ambient PWS async and cloud-push (#20332)
* Moving existing sensor file

* Initial functionality in place

* Added test for config flow

* Updated coverage and CODEOWNERS

* Linting

* Linting

* Member comments

* Hound

* Moving socket disconnect on HASS stop

* Member comments

* Removed unnecessary dispatcher call

* Config entry fix

* Added support in config flow for good accounts with no devices

* Hound

* Updated comment

* Member comments

* Stale docstrings

* Stale docstring
2019-01-28 15:35:39 -08:00
Jc2k
abeb875c61 Homekit controller BLE groundwork (part 2) (#20548)
* Only fetch values of characteristics we are tracking.

* Use callbacks on subclasses to update individual values

* Update alarm_control_panel to use update callbacks

* Update climate to use update callbacks

* Update cover to use update callbacks

* Update light to use update callbacks

* Update lock to use update callbacks

* Update switch to use update callbacks

* Remove compatibility code as all entities migrated

* pylint by name rather than code
2019-01-28 21:27:26 +01:00
Jc2k
41c1997b88 Homekit controller BLE groundwork (#20538)
* Define the characteristics to poll (or subscribe to) up front

* Configure characteristics immediately instead of during first poll

* Do as much cover configuration upfront as possible

* Remove test workaround as no longer needed

* Remove switch code that is already handled by HomeKitEntity

* Remove lock code already handled by HomeKitEntity

* Remove light code already handled by HomeKitEntity

* Remove alarm code already handled by HomeKitEntity

* Remove climate code already handled by HomeKitEntity
2019-01-28 17:21:20 +01:00
Jc2k
995758b8ac Add more HomeKit controller tests (#20515)
* homekit_controller tests: automatically find entity ids in tests

Some entities use dynamic ids because of the nature of the test fakes it is
hard to predict the name of the entity that will be created. This inspects the
EntityComponent of the domain to find the freshly created entity.

* homekit_controller: Tests can now define their own Service models.

All existing tests use models as defined upstream. But upstream only defines a
few service models. This adds a generic model helper for creating test
service/characteristic models.

* homekit_controller: Add cover tests

* homekit_controller: Add lock tests

* homekit_controller: Add alarm_control_panel tests

* homekit_controller: Update light tests for color_temp.

* Revert "homekit_controller tests: automatically find entity ids in tests"

This reverts commit 506caa4c3e.

* homekit_controller: Mock entity name so entity_id is consistent.

Also remove spurious subclass overrides that are identical to parent class.

* homekit_controler: Make tests less awkward as allowed top level imports
2019-01-28 13:20:32 +01:00
Christian Biamont
f33e432cab Reset Brottsplatskartan incident types every day (#20117)
* Reset the incident types count every day

* Remove functionality that was never implemented

We don't need to keep track of previous incidents because it's not used
anywhere.

* Create empty dictionary with a pair of braces: {}
2019-01-28 12:30:15 +01:00
David Lie
29984efd8c Use more up-to-date version of pyfoscam library (#20419)
* Change foscam python library to pyfoscam, which is more up to date and has several critical bug fixes.

* Update requirements_all.txt to match.

* Inserting automatically generated requirements.txt
2019-01-28 08:07:39 +01:00
Rohan Kapoor
d179686edf Load/unload gpslogger entities correctly between component and platform (#20448)
* Embed device_tracker in gpslogger

* Load/unload gpslogger entities correctly between component and platform

* Await the coroutine directly
2019-01-27 15:37:19 -08:00
Rohan Kapoor
0c87fb421e Load/unload locative entities correctly between component and platform (#20498)
* Embed device_tracker in locative

* Load/unload locative entities correctly between component and platform

* Await the coroutine directly

* Await the correct coroutine
2019-01-27 23:43:16 +01:00
Rohan Kapoor
f575d1d3a6 Load/unload geofency entities correctly between component and platform (#20497)
* Load/unload geofency entities correctly between component and platform

* Lint

* Await the coroutine directly
2019-01-27 13:18:20 -08:00
Eliseo Martelli
3d4f2926e9 Add Iliad Italy (Mobile Telephony Provider) Sensor (#19645)
* working state

* Attrs

* > requirements generated

* linting

* fixes

* coveragerc

* ordered imports and fixed auth

* Added Throttle

* moved throttle to decorator

* remove scan interval

* lower throttle

* moved to scan interval

* Add attribution
2019-01-27 21:44:19 +01:00
Heine Furubotten
7412d0f97c Add nilu air_quality platform (#19674)
* Add nilu air_pollutants platform

* Code Review - validation, DRYs, rm state override, new attr
- Repeated code moved to own method.
- Removed override of state property.
- New attr for showing nilu pollution recommendations.
- More validation of stations input.
- Minor fixes and typos.

* Removed unused prop

* Check for none result from client before entity add

* Moved platform to air_quality component

* Updated outdated docstrings

* Minor changes
2019-01-27 21:32:23 +01:00
Daniel Høyer Iversen
f91ff76b95 Upgrade mill library (#20514) 2019-01-27 19:20:43 +01:00
emontnemery
648adcc708 Small cleanup of MQTT platforms (#20503)
* Move CONF_UNIQUE_ID to init

* Sort imports

* Update ordering
2019-01-27 18:54:52 +01:00
emontnemery
8804f55fcc Update device registry of MQTT Vacuum (#20500) 2019-01-27 17:43:16 +01:00
emontnemery
1f93984fd5 Update device registry of MQTT Lock (#20501) 2019-01-27 17:42:45 +01:00
Daniel Høyer Iversen
ae84a91ea8 Upgrade tibber library (#20504)
* Upgrade tibber library

* Upgrade tibber library
2019-01-27 17:39:56 +01:00
Steven Looman
2aab646be2 Upgrade to async-upnp-client==0.14.3 (#20502) 2019-01-27 13:52:51 +01:00
Jc2k
10e3698fd7 Add homekit_controller tests (#20457)
* Add a test for a homekit_controller switch

* Add a test for a homekit_controller lightbulb

* Add a test for homekit_controller thermostat

* Changes from review

* Patch utcnow to known time in HK tests

* Neater fixture use per review
2019-01-27 12:34:49 +01:00
Rohan Kapoor
7368c623d4 Split out dovado to a component and sensor platform (#20339)
* Split out dovado to a component and sensor platform

* Lint

* Address code review comments (#20339)

* Switch to using a notify platform for dovado SMS (#20339)

* Optimizing imports

* Remove return on `setup_platform`.

* Clean up unneeded constants
2019-01-27 10:36:10 +01:00
Rohan Kapoor
d82e5ecbb0 Upgrade zm-py to 0.3.1 (#20489) 2019-01-27 10:28:20 +01:00
Aaron Bach
239c60c09f Use HASS latitude/longitude as defaults for Lyft (#20491) 2019-01-26 23:21:51 -07:00
Rohan Kapoor
38c33bd01e Fix linting error (#20488) 2019-01-26 17:11:09 -08:00
Paulus Schoutsen
86f5f0226c Bumped version to 0.87.0.dev0 2019-01-26 14:15:36 -08:00
Paulus Schoutsen
c78d3b6154 Merge pull request #20485 from home-assistant/rc
0.86.3
2019-01-26 14:14:06 -08:00
Paulus Schoutsen
dcfe7b2280 Bumped version to 0.86.3 2019-01-26 14:11:44 -08:00
Shantanu Tushar
a368db9ad4 Include exception details in the error log (#20461)
* Include exception details in the error log

I see this error quite often in my HA logs and this will be helpful for anyone who is attempting to debug this.

* Minor change

* Remove line break
2019-01-26 14:11:16 -08:00
Paulus Schoutsen
6330bb1004 Warn for old slugs/entity ids (#20478)
* Warn for old slugs/entity ids

* add comments

* Lint

* LInt

* Lint

* Lint
2019-01-26 14:10:05 -08:00
starkillerOG
672a896124 Philips Hue, include debug message for color gamut (#20455) 2019-01-26 14:10:04 -08:00
Paulus Schoutsen
87316c4e83 Warn for old slugs/entity ids (#20478)
* Warn for old slugs/entity ids

* add comments

* Lint

* LInt

* Lint

* Lint
2019-01-26 14:09:41 -08:00
Fabian Affolter
38b1ce3fe0 Upgrade psutil to 5.5.0 (#20462) 2019-01-26 22:11:36 +01:00
Fabian Affolter
9920699bb8 Upgrade sqlalchemy to 1.2.16 (#20474) 2019-01-26 22:11:00 +01:00
starkillerOG
b9bf6963fd Philips Hue, include debug message for color gamut (#20455) 2019-01-26 12:50:34 -08:00
emontnemery
60dc337f3f Update device registry of MQTT cover (#20443)
* Update device registry of MQTT cover

* Move config_entry to constructor
2019-01-26 10:52:41 -08:00
emontnemery
85c72fbca6 Update device registry of MQTT alarm (#20439) 2019-01-26 10:48:35 -08:00
emontnemery
85ccd71d39 Update device registry of MQTT sensor (#20440) 2019-01-26 10:48:18 -08:00
Paulus Schoutsen
09cbcb74bc Merge pull request #20442 from emontnemery/mqtt_binary_sensor_update_device_info
Update device registry of MQTT binary_sensor
2019-01-26 10:47:57 -08:00
Paulus Schoutsen
0e453fe492 Update device registry of MQTT climate (#20444) 2019-01-26 10:47:29 -08:00
emontnemery
1d16bb2cd4 Update device registry of MQTT fan (#20445) 2019-01-26 10:46:41 -08:00
David F. Mulcahey
05d41bc0ee introduce gateway (#20460) 2019-01-26 13:28:13 -05:00
Jef D
f3285f96bb Add Co2signal sensor (#19204)
* Initial commit for the co2signal sensor

* Clean code

* Run script gen_requirements_all.py

* remove unintended character

* Remove redundancy

* Remove unused imports

* Code style

* Code style fixes

* Code style

* Fix comments PR

Comments by @fabaff
* Remove redundant comments and variables
* Follow the latest home-assistant guidelines

* Bump CO2Signal version

* Round API result

* Improve default latitude/longitude handling

* Improve friendly name

* Improve config handling

* Make lines shorter

* Style

* Convert default to variable

None does not pass cv.string

* Message if not inclusive

* Shorten line

* Update requirements

* Update co2signal.py

Group imports;  remove empty lines; refactor use of location_type; remove logging messages; remove unused functions; add global variables

* Update co2signal.py

Import platform schema from sensor

* Small fix

* Update co2signal.py

Remove last mentions of location_type

* Review changes

Add attribution
Formatting

* Missing whitespace

* Update co2signal.py

Fix pylint

* Update co2signal.py

Change blank lines

* Update co2signal.py

Initialise _data
2019-01-26 19:02:46 +01:00
Diogo Gomes
1d5ffe9ad5 Utility meter (#19718)
* initial commit

* test service calls

* lint

* float -> Decimal

* extra tests

* lint

* lint

* lint

* lint

* fix self reset

* clean

* add services

* improve service example description

* add optional paused initialization

* fix

* travis fix

* fix YEARLY

* add tests for previous bug

* address comments and suggestions from @ottowinter

* lint

* remove debug

* add discoverability capabilities

* no need for _hass

* Update homeassistant/components/sensor/utility_meter.py

Co-Authored-By: dgomes <diogogomes@gmail.com>

* Update homeassistant/components/sensor/utility_meter.py

Co-Authored-By: dgomes <diogogomes@gmail.com>

* correct comment

* improve error handling

* address @MartinHjelmare comments

* address @MartinHjelmare comments

* one patch is enought

* follow @ballob suggestion in https://github.com/home-assistant/architecture/issues/131

* fix tests

* review fixes

* major refactor

* lint

* lint

* address comments by @MartinHjelmare

* rename variable
2019-01-26 16:33:11 +01:00
Jonas Pedersen
ed6e349515 Correct minor comments from PR#20138. (#20454) 2019-01-26 15:55:25 +01:00
Fabian Affolter
a85e018bc4 Upgrade astral to 1.8 (#20459) 2019-01-26 15:54:35 +01:00
David F. Mulcahey
a0b93c2add ZHA component rewrite part 1 (#20456)
* rearrange files

* add init to module

* update imports

* update coveragerc

* put blank line back... git raw view be damned
2019-01-26 08:54:49 -05:00
Anders Melchiorsen
e593383b4d Error handling for recorder purge (#20424) 2019-01-26 11:02:16 +01:00
Austin Drummond
b3c3721a79 Add alarm type workaround zwave lock Yale YRD240 (#20438) 2019-01-26 11:01:04 +01:00
Adam Belebczuk
310c073c64 WeMo - Fix device discovery issues (#20446) 2019-01-26 11:00:06 +01:00
Louis Matthijssen
d39784906b Fix HTTP login attempts check triggering too late (#20431) 2019-01-26 03:13:44 +01:00
emontnemery
6d2e7db123 Update device registry of MQTT climate 2019-01-26 09:04:02 +08:00
emontnemery
d8e43978b7 Update device registry of MQTT binary_sensor 2019-01-26 08:58:08 +08:00
kennedyshead
76c0295403 Bumps aioasuswrt (#20432) 2019-01-25 23:27:44 +01:00
coreGreenberet
2bc7444427 Fix homematicip cloud alarm_arm_home (#20321) 2019-01-25 19:45:42 +01:00
coreGreenberet
4518e6bdf7 Fix minor homematicip cloud binary sensor issues (#20398)
* fix for smoke detection

* a tilted window is now considered as "open"/on

* changed comparison to enum

* line length

* insert brackets for line length and comparison

* indentation should now be ok for hound
changed api version to 0.10.4

* indentation should now be ok for hound
changed api version to 0.10.4

* updating requirement files

* satisfy lint
2019-01-25 19:00:37 +01:00
zewelor
d6c12e47f4 Fix cast platform album name property (#20411) 2019-01-25 18:49:50 +01:00
Jc2k
cea2bf94bd Move homekit_controller entity types under homekit_controller platform (#20376)
* Move homekit_controller entity types under homekit_controller platform

* Update coveragerc as homekit_controller moved
2019-01-25 07:43:01 -08:00
jonudewux
1fcaaf93ad Upgrade youtube_dl to 2019.01.24 (#20408) 2019-01-25 11:57:13 +01:00
Andrey Kupreychik
d4c7515681 Add time_throttle filter to sensor.filter (#20334)
* Added time_throttle filter

* Added time_throttle filter test

* Updated comments for time_throttle filter
2019-01-25 10:07:45 +00:00
Anders Melchiorsen
c94834d8f6 Add LIFX listen port advanced configuration (#20299) 2019-01-24 22:50:26 -08:00
emontnemery
ec5da05804 Add character encoding to MQTT automation. (#20292) 2019-01-24 22:43:56 -08:00
emontnemery
d84cd01cbf Cleanup if discovered mqtt light can't be added (#19740)
* Cleanup if discovered mqtt light can't be added

* No bare except

* Clear ALREADY_DISCOVERED list with helper

* Use constant instead of string literal
2019-01-24 22:40:52 -08:00
emontnemery
a1da6a677a Update device registry of MQTT Switch (#19540)
* MQTT Switch: Update device registry

* Move config_entry to constructor

* Remove duplicated code

* Fix merge error
2019-01-24 22:39:16 -08:00
Jasper van der Neut - Stulen
55943cfac0 Return windspeed and windgust in km/h instead of m/s. (#20340)
Darksky dev docs state (https://darksky/dev/docs):
`ca: same as si, except that windSpeed and windGust are in kilometers per
hour`
2019-01-24 22:36:25 -08:00
Daniel Perna
400aaf8a3a Update pyhomematic to 0.1.55 (#20397) 2019-01-24 17:53:31 -08:00
Fabian Affolter
046683ee3f Upgrade numpy to 1.16.0 (#20396) 2019-01-24 17:53:17 -08:00
Paulus Schoutsen
c7f5beb794 history allowed to load states with invalid entity IDs (#20399) 2019-01-24 17:53:01 -08:00
starkillerOG
c508ba166c Philips Hue - Remove unnessesary warning (#20394)
for white hue bulbs and bulbs from other brands like Ikea and Innr, this warning will be issued while this is not really a problem.
So just remove the warning.
2019-01-24 23:46:55 +01:00
mindigmarton
68bd5f5df8 Upgrade emulated_roku to 0.1.8 to fix invalid encodings, fixes #20388 (#20390) 2019-01-24 22:51:15 +01:00
Anders Melchiorsen
70c5807976 Improve deprecation warnings (#20391) 2019-01-24 13:37:30 -08:00
Daniel Høyer Iversen
3b1534c126 Remove logging from tibber (#20382)
* Remove logging from tibber

* keep guard
2019-01-24 21:56:44 +01:00
zewelor
2559bc4226 Add yeelight start_flow service and ability to declare custom effects (#20107) 2019-01-24 17:41:07 +01:00
Fréderic Kinnaer
0be922dc9c SongPal: do not crash if active_source is not (yet) available - fixes #20343 (#20344)
* SongPal: error handling if active_source can't be detected

* sonpal: Add comment to the use of getattr() for property source

* songpal: make comment single-line
2019-01-24 12:55:39 +01:00
Fabian Affolter
7038dd484a Upgrade TwitterAPI to 2.5.9 (#20372) 2019-01-24 09:37:25 +01:00
Daniel Høyer Iversen
1bd31e3459 Change STATE_UNKOWN to None (#20337)
* Change STATE_UNKOWN to None

* Change STATE_UNKOWN to None

* tests

* tests

* tests

* tests

* tests

* style

* fix comments

* fix comments

* update fan test
2019-01-24 08:20:20 +01:00
Diogo Gomes
074fcd96ed Fix error when API doesn't return a forecast. (#20365)
* add guard

* wrong logic
2019-01-23 21:14:21 -08:00
Paulus Schoutsen
5580bec1d3 Calling save before load would crash Lovelace storage (#20368) 2019-01-23 21:13:55 -08:00
Paulus Schoutsen
af3afb673a Fix restore state crashing invalid entity ID (#20367) 2019-01-23 21:12:38 -08:00
Daniel Høyer Iversen
697c331903 Clean up concord232 (#20353)
* Clean up concord232

* concord cleanup

* clean up

* fix import
2019-01-23 17:05:56 -08:00
Eliseo Martelli
971d933140 [FIX] Time reporting incorrect in sensor.gtt (#20362)
* quick fix

* remove print statement

* fixes

* remove lambda

* added pylint disable

* should be fine now
2019-01-23 17:05:16 -08:00
Paulus Schoutsen
0300ef2040 Fix entity registry comments (#20357) 2019-01-23 16:33:21 -08:00
Jc2k
a396ee2cb5 Bump homekit==0.12.2 + improve controller reliability (#20325)
Sessions were timing out and requiring a HA restart in order to restore
functionality. Network disconnects are now handled and sessions will be
automatically recovered after they fail.
2019-01-23 20:44:21 +01:00
Kevin Fronczak
7ca7951526 Hotfix for blink initialization failure. Fixes #20335 (#20351) 2019-01-23 20:37:21 +01:00
Daniel Høyer Iversen
5bf3b2dd9f clean up of islamic_prayer_times (#20352)
update_sensors was not awaited in async_track_point_in_time()
2019-01-23 20:17:45 +01:00
Jonas Pedersen
c6cee1ccd3 Add Danfoss Air HRV support (#20138)
* Add support for Danfoss Air HRV systems.

* Correct lint errors after initial commit of Danfoss Air HRV support.

* A couple of lint fixes for danfoss_air.

* Refactor to comply with HA standards.

* Style fix.

* Use wildcard for danfoss_air in .coveragerc.

* Remove config example from header documentation.
Correct import name for platforms.
2019-01-23 11:58:45 -05:00
Corey Edwards
16a4180fab Fix mpd logging format string field (#20333)
* Fix format string field

* Remove str.format and let _LOGGER handle formatting

* Remove trailing period from log message
2019-01-23 11:50:04 -05:00
shbatm
e8f0e534f9 Update Requirement for PyISY Package in isy994 Component to v1.1.1 (#20349) 2019-01-23 11:48:35 -05:00
Fabien Piuzzi
07f1e2ce75 Add Octoprint custom path (#20302)
* Added custom path config option to octoprint component

* Added some debug logging

* removed debug logging for base url

* Fixed single/double quotes style
2019-01-23 12:50:17 +01:00
Malte Franken
eaa9c4d437 Remove creation of geolocation default group (#20338) 2019-01-23 10:04:41 +01:00
Frank
db277ad023 Add data/data_template/title to alert component (#17616)
* Add data/data_template/title to alert component

* Fix line length

* Fix tests

* Fix lint

* fix line length

* Fix tests, make title templatable

* Fix test

* Fix test

* Optimize data, make title templated

* Fix line length

* Add title template

* typo

* Fix tests
2019-01-23 08:47:37 +01:00
Sebastian Muszynski
3484e506e8 Fix xiaomi speed attribute name clash (#20312) 2019-01-23 05:04:13 +01:00
Paulus Schoutsen
e964750ac1 Fix invalid entity ID in entity registry (#20328) 2019-01-22 14:07:17 -08:00
Paulus Schoutsen
c87c5797db Updated frontend to 20190121.1 2019-01-22 12:58:53 -08:00
Richard Mitchell
5b25188474 Should require the 'GATTOOL' setup extras which includes pexpect. (#20263)
* Should require the 'GATTOOL' setup extras which includes pexpect.

* Also fix skybeacon's requirement and requirements_all.
2019-01-22 18:50:21 +01:00
Fabian Affolter
91ef78adc5 Upgrade youtube_dl to 2019.01.17 (#20318) 2019-01-22 18:45:16 +01:00
rolfberkenbosch
e2a4fdeadf Update locationsharinglib to version 3.0.11 (#20322)
* Update google_maps.py

There are known bug in locationsharinglib version 3.0.9, the developer has fixed this in 3.0.11. (https://github.com/costastf/locationsharinglib/issues/42)

* Update requirements_all.txt
2019-01-22 08:24:40 -08:00
Mateusz Korniak
9b7780edf0 Ecoal (esterownik.pl) static fuel boiler and pump controller (#18480) - matkor
* Starting work on ecoal boiler controller iface.

* Sending some values/states to controller.

* Basic status parsing, and simple settings.

* Platform configuration.

* Temp sensors seems be working.

* Switch from separate h/m/s to datetime.

* Vocabulary updates.

* secondary_central_heating_pump -> central_heating_pump2

* Pumps as switches.

* Optional enabling pumps via config.

* requests==2.20.1 added to REQUIREMENTS.

* Optional enabling temp sensors from configuration yaml.

* autopep8, black, pylint.

* flake8.

* pydocstyle

* All style checkers again.

* requests==2.20.1 required by  homeassistant.components.sensor.ecoal_boiler.

* Verify / set switches in update().
Code cleanup.

* script/lint + travis issues.

* Cleanup, imperative mood.

* pylint, travis.

* Updated .coveragerc.

* Using configuration consts from homeassistant.const

* typo.

* Replace global ECOAL_CONTR with hass.data[DATA_ECOAL_BOILER].
Remove requests from REQUIREMENTS.

* Killed .update()/reread_update() in Entities __init__()s.
Removed debug/comments.

* Removed debug/comments.

* script/lint fixes.

* script/gen_requirements_all.py run.

* Travis fixes.

* Configuration now validated.

* Split controller code to separate package.

* Replace in module docs with link to https://home-assistant.io .

* Correct component module path in .coveragerc.
More vals from  const.py.
Use dict[key] for required config keys.
Check if credentials are correct during component setup.
Renamed add_devices to add_entities.

* Sensor/switch depends on ecoal_boiler component.
EcoalSwitch inherits from SwitchDevice.
Killed same as default should_poll().
Remove not neede schedule_update_ha_state() calls from turn_on/off.

* lint fixes.

* Move sensors/switches configuration to component setup.

* Lint fixes.

* Invalidating ecoal iface cache instead of force read in turn_on/off().

* Fail component setup before adding any platform entities.
Kill NOTE.

* Disallow setting entity names from config file, use code defined default names.

* Rework configuration file to use monitored_conditions like in rainmachine component.

* Killed pylint exception.
Log error when connection to controller fails.

* A few fixes.

* Linted.
2019-01-22 08:14:27 -05:00
Jason Hu
f84c0ee473 Upgrade python-nest to 4.1.0 (#20313) 2019-01-22 13:23:33 +01:00
Mattias Welponer
89ba374d51 HomematicIP add cover FROLL and BROLL devices (#19794)
* Add cover FROLL and BROLL devices

* Fix import

* Fix async calls

* Update cover functions and async fixes

* Update test

* Cleanup code

* Update header

* Merge imports

* Update

* Remove init

* Update coveragerc file

* Update coveragerc
2019-01-22 09:22:45 +01:00
krygal
a8ef7a2774 Add device tracker support for EE Brightbox 2 router (#19611)
* Added device tracker support for EE Brightbox 2

* removed timeago dependency

* get scanner checks and improved tests

* fixed lint issues

* removed redundant timeago from test requirements

* fixed variable naming in test

* removed unecessary blank line
2019-01-22 09:16:35 +01:00
Johann Kellerman
5a30b0507d Add git to the development Dockerfile (#20276)
* git_on_dev

* feedback
2019-01-22 08:21:43 +01:00
Fabien Piuzzi
d419471372 Fix typo C02 to CO2 (#20306)
* Fix type C02 to CO2 and added VOC to air quality platform

* singularized volatile_organic_compound

* Remove VOC prop

* Update __init__.py

* Update __init__.py
2019-01-21 21:22:38 -08:00
Fabien Piuzzi
3e056a24dd Bugfix: prevent error notification when octoprint server auto detected but no configuration present. (#20303) 2019-01-21 21:21:59 -08:00
Johann Kellerman
6511e11ec9 Config Validator: schema_with_slug_keys (#20298)
* schema_with_slug_keys

* Update config_validation.py

* Update config_validation.py
2019-01-21 16:36:04 -08:00
Ted Drain
4b3cdb9f4e Add radiotherm is_on method to return on/off (#20283)
* Added state method to return current operating state to fix #18244 for radiotherm component.

* Changed to set the is_on property when actively heating or cooling.
2019-01-21 12:05:42 -08:00
Andrew Sayre
bb21cb6c89 Remove trailing slash from base_url and added ability to generate webhook path. (#20295) 2019-01-21 20:50:41 +01:00
Johann Kellerman
c36c708068 Align valid_entity_id with new slugify (#20231)
* slug

* ensure a dot

* fix

* schema_with_slug_keys

* lint

* test
2019-01-21 09:45:11 -08:00
Paulus Schoutsen
6ca0da5c52 Updated frontend to 20190121.0 2019-01-21 09:21:11 -08:00
Daniel Høyer Iversen
e4f42d1282 Update Tibber lib (#20289) 2019-01-21 16:12:03 +01:00
Andrey Kupreychik
ec9575a86f Added Xiaomi AirPurifier 2S profile (#20285) 2019-01-21 09:22:44 +01:00
Andrew Sayre
5c208da82e Added recursive detection of functools.partial. (#20284) 2019-01-20 22:27:32 -08:00
Jon Caruana
9482a6303d Add EverLights light component (#19817)
* EverLights light integration. Supports single color (with color and brightness parameters) or saved pattern (with effect parameter).

* Fix pylint parameter name warning.

* Code review feedback.

* Add tests for the two helper functions of EverLights component.

* Fixes for review feedback.

* Change test style.

* Style fixes for hound.
2019-01-21 04:23:36 +01:00
Paulus Schoutsen
5999df1953 Clean up build artifacts correctly 2019-01-20 17:31:09 -08:00
Phil Bruckner
935e5c67a3 Handle non-string values in JSON renderer (#20233)
Handle the case of async_render_with_possible_json_value's value argument
being something other than a string. This can happen, e.g., when using the
SQL sensor to extract a datetime column such as last_changed and also using
its value_template to convert that datetime to another format. This was
causing a TypeError from json.loads, but async_render_with_possible_json_value
was only catching ValueError's.
2019-01-20 16:46:14 -08:00
emontnemery
3fcbcd5a38 Add JSON attribute topic to MQTT alarm (#20238) 2019-01-20 16:42:56 -08:00
emontnemery
dbba3eb0d4 Add JSON attribute topic to MQTT climate (#20239) 2019-01-20 16:42:35 -08:00
emontnemery
89e9d827a2 Add JSON attribute topic to MQTT fan (#20240) 2019-01-20 16:42:17 -08:00
emontnemery
ab4e4787e3 Add JSON attribute topic to MQTT lock (#20241) 2019-01-20 16:41:50 -08:00
Paulus Schoutsen
b6e1675c46 Add JSON attribute topic to MQTT vacuum (#20242) 2019-01-20 16:36:24 -08:00
Teemu R
e69ca810e4 Print a message when reconnected after a connection failure, requirement for IQS silver (#20261) 2019-01-20 16:36:01 -08:00
Anders Melchiorsen
62844e237c Allow 'all' entity_id in service schema (#20278) 2019-01-20 16:33:39 -08:00
Anders Melchiorsen
1218127d83 Fix 'all' entity_id in service call extraction (#20281) 2019-01-20 16:33:11 -08:00
koreth
08a57959b9 Reduce log noise from Envisalink component (#20282) 2019-01-20 16:32:01 -08:00
Paulus Schoutsen
f771667c14 Updated frontend to 20190120.0 2019-01-20 16:22:42 -08:00
Andre Lengwenus
d5dcb8f140 Add discovery_info check to LCN light platform (#20280)
* Added discovery_info check to LCN light platform

* Removed whitespaces
2019-01-20 15:49:28 -08:00
Anders Melchiorsen
362ac725bf Remove double logging of automation action (#20264) 2019-01-21 00:10:12 +01:00
Ville Skyttä
58bb6f2e99 Add type hints to helpers.condition (#20266) 2019-01-21 00:03:12 +01:00
NotoriousBDG
5b8cb10ad7 Make Netatmo battery_percent icon dynamic (#20275) 2019-01-20 22:30:17 +01:00
Daniel Høyer Iversen
2eb5ce9dfe Update Tibber library (#20273) 2019-01-20 21:37:02 +01:00
koreth
fd2cff6b1c Fire events for Lutron RadioRA2 keypad buttons (#20090)
* Add binary sensor for Lutron RadioRA2 keypad buttons

Allow automations to be triggered from RadioRA2 keypads by exposing
each button as a binary sensor.

* Remove binary sensor component; fire events directly instead.

* Address comments from code review
2019-01-20 21:16:48 +01:00
kbickar
0e5fa010a7 Updated sense library to 0.6.0 (#20271) 2019-01-20 21:02:36 +01:00
Andre Lengwenus
7c25389f0d Add LCN switch platform (#20267)
* Add LCN switch platform

* Added guard clause for discovery_info check and removed unnecessary parathesis
2019-01-20 20:49:30 +01:00
Andre Lengwenus
a8d3a904e7 Support for relay ports for LCN light platform (#19632)
* Added relay ports to LCN lights platform

* Exchanged validation for ports with uppercase validator. Makes interfacing with pypck enums much more simple.

* Removed supported_features property as it is correctly inherited from parent

* Removed type annotations.
2019-01-20 14:50:29 +01:00
Matthew Wegner
6bf42ad43d Added Search Configuration to IMAP Sensor (#19749)
* Added Search Configuration to IMAP Sensor

The IMAP sensor currently only counts unread emails in a folder.  By exposing the IMAP search parameter, the sensor can be used to count other results:

- All emails in an inbox
- Emails sent from an address
- Emails matching a subject
- Other advanced searches, especially with vendor-specific extensions.  Gmail in particular supports X-GM-RAW, which lets you use any Gmail search directly ("emails with X label older than 14 days with", etc)

For my use case, I just wanted total emails in a folder, to show an "X/Y" counter for total/unread.  I started work on a one-off script to throw the data in, but figured I'd try to extend Home Assistant more directly, especially since this IMAP sensor correctly handles servers that push data.  This is my first Home Assistant contribution, so apologies in advance if something is out of place!  It's a pretty minimal modification.

* Added Server Response Checking

Looks like no library exception is thrown, so check for response text before parsing out results (previous code just counts spaces, so an error actually returns a state value of 4).

* IMAP Warning -> Error, Count Initializes to None

IMAP search response parsing throws an error instead of a warning.

Email count initializes as None instead 0.

Email count is untouched in case of failure to parse response (i.e. if server is temporarily down or throwing errors, or maybe due to user updating their authentication/login/etc).

Fixed line length on error so it fits under 80 characters.

* Fixed Indent on Logger Error

Sorry about the churn!  Python is pretty far from my daily-use language.  (I did run this one through pep8, at least)
2019-01-19 21:37:02 +01:00
Daniel Høyer Iversen
0987219b28 Tibber Pulse for homes without subscriptions (#20246) 2019-01-19 10:23:22 -08:00
Victor Vostrikov
fb52f66da0 Use local IP to discover IGD device (#20035)
* Use local_ip from config to discover IGD device

In case of multi-homed server UPNP discovery finds IGD device on some "default" interface. WIth this modification discovery will be performed from 'local_ip'.

* Update device.py

* Changed version of async_upnp_client in requirements

* Used aysnc_upnp_client==0.14.0

* Changed requirement to async_upnp_client==0.14.0.dev0

* Changed requirement to async_upnp_client==0.14.0.dev0

* Changed requirement to async_upnp_client==0.14.0.dev0

* Fixed code style

* Fixed code style

* Changed version of async_upnp_client in requerements

* Changed version of async_upnp_client in requirements

* Regenerated requirements (new async_upnp_client)

* Regenerated requirements (new async_upnp_client)

* Changed requirement to async_upnp_client=0.14.1

* Changed requirement to async_upnp_client=0.14.1

* Updated requirements

* Updated requirements.txt

* Corrected requirements

* Corrected import of DeviceState

* Constants changed according new async_upnp_client

* Upgraded for async_upnp_client==0.14.2
2019-01-19 17:08:53 +00:00
Otto Winter
8000b97180 Bump aioesphomeapi to 1.4.2 (#20247)
* Bump aioesphomeapi to 1.4.2

* Update requirements_all.txt
2019-01-19 17:13:32 +01:00
Erik
5b8f64093b Add JSON attribute topic to MQTT vacuum 2019-01-19 11:58:21 +01:00
Joakim Lindbom
440d479be8 Fix for issue #19086 (#20225) 2019-01-18 22:12:56 -08:00
Louis Matthijssen
e80702a45c Fix unused friendly name for SolarEdge sensor (#20109) 2019-01-18 15:02:27 +01:00
Anders Melchiorsen
63b19094c1 Improve Sonos discovery (#20196) 2019-01-18 13:43:48 +01:00
Rohan Kapoor
84b1fcbc36 Add verify_ssl to restful_command and switch.rest (#20199) (#20207) 2019-01-18 13:42:52 +01:00
zhujisheng
81a5208762 Add platform image_processing.qrcode (#20215)
* Add platform image_processing.qrcode

* Update qrcode.py
2019-01-18 13:40:49 +01:00
ehendrix23
afa019ae47 Set ehendrix23 as owner for harmony platform (#20203)
Put myself (ehendrix23) as code owner for remote.harmony platform
2019-01-17 19:35:45 -07:00
emontnemery
6800871c13 Log exceptions thrown by signal callbacks (#20015)
* Log exceptions thrown by signal callbacks

* Fix unsub

* Simplify traceback print

* Typing

* Add test

* lint

* Review comments

* Rework MQTT test case

* Fix bad merge

* Fix bad merge
2019-01-17 14:44:57 -08:00
emontnemery
f094a7369d Add JSON attribute topic to MQTT switch (#20192) 2019-01-17 10:55:22 -08:00
emontnemery
234f348ba1 Add JSON attribute topic to MQTT light (#20191) 2019-01-17 10:54:22 -08:00
emontnemery
d1c6eb4f3e Add JSON attribute topic to MQTT cover (#20190)
* Add JSON attribute topic to MQTT cover

* Lint
2019-01-17 10:53:52 -08:00
Rohan Kapoor
5232df34cb Add a Zoneminder availability sensor (#20184)
* Embed zoneminder platforms into component

* Add a binary sensor for ZoneMinder availability

* Lint

* Add missing docstrings
2019-01-17 10:52:53 -08:00
Paulus Schoutsen
0fe5d567a2 Add command to refresh auth (#20183) 2019-01-17 19:33:01 +01:00
Paulus Schoutsen
136364f5db Distribute reconnect (#20181) 2019-01-17 19:30:47 +01:00
Rohan Kapoor
2de6a94506 Embed zoneminder platforms into component (#20182) 2019-01-17 11:13:15 +01:00
Paulus Schoutsen
e1b63d9706 Sensibo to use HA operation modes (#20180) 2019-01-16 23:12:18 -08:00
Aaron Godfrey
27a8171a8b Remove color call to set lights to black. (#20176)
Calling clear all is enough to turn off the light.  Calling the color
command makes the light no longer function until clear all is called
again.  The component calls clear all beforing turning it on which is
why it works through home assistant.  However if you try to control the
light via the hyperion app or through kodi after it has been turned off
via home assistant it will not function until you call clear all again.
2019-01-16 21:19:52 -08:00
6252 changed files with 341054 additions and 260727 deletions

272
.circleci/config.yml Normal file
View File

@@ -0,0 +1,272 @@
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2.1
executors:
python:
parameters:
tag:
type: string
default: latest
docker:
- image: circleci/python:<< parameters.tag >>
- image: circleci/buildpack-deps:stretch
working_directory: ~/repo
commands:
docker-prereqs:
description: Set up docker prerequisite requirement
steps:
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends
libudev-dev libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev
libswscale-dev libswresample-dev libavfilter-dev
install-requirements:
description: Set up venv and install requirements python packages with cache support
parameters:
python:
type: string
default: latest
all:
description: pip install -r requirements_all.txt
type: boolean
default: false
test:
description: pip install -r requirements_test.txt
type: boolean
default: false
test_all:
description: pip install -r requirements_test_all.txt
type: boolean
default: false
steps:
- restore_cache:
keys:
- v1-<< parameters.python >>-{{ checksum "homeassistant/package_constraints.txt" }}-<<# parameters.all >>{{ checksum "requirements_all.txt" }}<</ parameters.all>>-<<# parameters.test >>{{ checksum "requirements_test.txt" }}<</ parameters.test>>-<<# parameters.test_all >>{{ checksum "requirements_test_all.txt" }}<</ parameters.test_all>>
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -q -U pip
pip install -q -U setuptools
<<# parameters.all >>pip install -q --progress-bar off -r requirements_all.txt -c homeassistant/package_constraints.txt<</ parameters.all>>
<<# parameters.test >>pip install -q --progress-bar off -r requirements_test.txt -c homeassistant/package_constraints.txt<</ parameters.test>>
<<# parameters.test_all >>pip install -q --progress-bar off -r requirements_test_all.txt -c homeassistant/package_constraints.txt<</ parameters.test_all>>
no_output_timeout: 15m
- save_cache:
paths:
- ./venv
key: v1-<< parameters.python >>-{{ checksum "homeassistant/package_constraints.txt" }}-<<# parameters.all >>{{ checksum "requirements_all.txt" }}<</ parameters.all>>-<<# parameters.test >>{{ checksum "requirements_test.txt" }}<</ parameters.test>>-<<# parameters.test_all >>{{ checksum "requirements_test_all.txt" }}<</ parameters.test_all>>
install:
description: Install Home Assistant
steps:
- run:
name: install
command: |
. venv/bin/activate
pip install -q --progress-bar off -e .
jobs:
static-check:
executor:
name: python
tag: 3.5.5-stretch
steps:
- checkout
- docker-prereqs
- install-requirements:
python: 3.5.5-stretch
test: true
- run:
name: run static check
command: |
. venv/bin/activate
flake8 homeassistant tests script
- run:
name: run static type check
command: |
. venv/bin/activate
TYPING_FILES=$(cat mypyrc)
mypy $TYPING_FILES
- install
- run:
name: validate manifests
command: |
. venv/bin/activate
python -m script.hassfest validate
- run:
name: run gen_requirements_all
command: |
. venv/bin/activate
python script/gen_requirements_all.py validate
pre-install-all-requirements:
executor:
name: python
tag: 3.5.5-stretch
steps:
- checkout
- docker-prereqs
- install-requirements:
python: 3.5.5-stretch
all: true
test: true
pylint:
executor:
name: python
tag: 3.5.5-stretch
parallelism: 2
steps:
- checkout
- docker-prereqs
- install-requirements:
python: 3.5.5-stretch
all: true
test: true
- install
- run:
name: run pylint
command: |
. venv/bin/activate
PYFILES=$(circleci tests glob "homeassistant/**/*.py" | circleci tests split)
pylint ${PYFILES}
no_output_timeout: 15m
pre-test:
parameters:
python:
type: string
executor:
name: python
tag: << parameters.python >>
steps:
- checkout
- docker-prereqs
- install-requirements:
python: << parameters.python >>
test_all: true
test:
parameters:
python:
type: string
executor:
name: python
tag: << parameters.python >>
parallelism: 2
steps:
- checkout
- docker-prereqs
- install-requirements:
python: << parameters.python >>
test_all: true
- install
- run:
name: run tests with code coverage
command: |
. venv/bin/activate
CC_SWITCH="--cov --cov-report="
TESTFILES=$(circleci tests glob "tests/**/test_*.py" | circleci tests split --split-by=timings)
pytest --timeout=9 --durations=10 --junitxml=test-reports/homeassistant/results.xml -qq -o junit_family=xunit2 -o junit_suite_name=homeassistant -o console_output_style=count -p no:sugar $CC_SWITCH -- ${TESTFILES}
script/check_dirty
codecov
- store_test_results:
path: test-reports
- store_artifacts:
path: htmlcov
destination: cov-reports
- store_artifacts:
path: test-reports
destination: test-reports
# This job use machine executor, e.g. classic CircleCI VM because we need both lokalise-cli and a Python runtime.
# Classic CircleCI included python 2.7.12 and python 3.5.2 managed by pyenv, the Python version may need change if
# CircleCI changed its VM in future.
upload-translations:
machine: true
steps:
- checkout
- run:
name: upload english translations
command: |
pyenv versions
pyenv global 3.5.2
docker pull lokalise/lokalise-cli@sha256:2198814ebddfda56ee041a4b427521757dd57f75415ea9693696a64c550cef21
script/translations_upload
workflows:
version: 2
build:
jobs:
- static-check
- pre-install-all-requirements:
requires:
- static-check
- pylint:
requires:
- pre-install-all-requirements
- pre-test:
name: pre-test 3.5.5
requires:
- static-check
python: 3.5.5-stretch
- pre-test:
name: pre-test 3.6
requires:
- static-check
python: 3.6-stretch
- pre-test:
name: pre-test 3.7
requires:
- static-check
python: 3.7-stretch
- test:
name: test 3.5.5
requires:
- pre-test 3.5.5
python: 3.5.5-stretch
- test:
name: test 3.6
requires:
- pre-test 3.6
python: 3.6-stretch
- test:
name: test 3.7
requires:
- pre-test 3.7
python: 3.7-stretch
# CircleCI does not allow failure yet
# - test:
# name: test 3.8
# python: 3.8-rc-stretch
- upload-translations:
requires:
- static-check
filters:
branches:
only: dev

16
.codecov.yml Normal file
View File

@@ -0,0 +1,16 @@
codecov:
branch: dev
coverage:
status:
project:
default:
target: 90
threshold: 0.09
notify:
# Notify codecov room in Discord. The webhook URL (encrypted below) ends in /slack which is why we configure a Slack notification.
slack:
default:
url: "secret:TgWDUM4Jw0w7wMJxuxNF/yhSOHglIo1fGwInJnRLEVPy2P2aLimkoK1mtKCowH5TFw+baUXVXT3eAqefbdvIuM8BjRR4aRji95C6CYyD0QHy4N8i7nn1SQkWDPpS8IthYTg07rUDF7s5guurkKv2RrgoCdnnqjAMSzHoExMOF7xUmblMdhBTWJgBpWEhASJy85w/xxjlsE1xoTkzeJu9Q67pTXtRcn+5kb5/vIzPSYg="
comment:
require_changes: yes
branches: master

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,7 @@
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Frontend issues should be submitted to the home-assistant-polymer repository: https://github.com/home-assistant/home-assistant-polymer/issues
- iOS issues should be submitted to the home-assistant-iOS repository: https://github.com/home-assistant/home-assistant-iOS/issues
- Do not report issues for components if you are using custom components: files in <config-dir>/custom_components
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!

View File

@@ -8,6 +8,7 @@ about: Create a report to help us improve
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Frontend issues should be submitted to the home-assistant-polymer repository: https://github.com/home-assistant/home-assistant-polymer/issues
- iOS issues should be submitted to the home-assistant-iOS repository: https://github.com/home-assistant/home-assistant-iOS/issues
- Do not report issues for components if you are using custom components: files in <config-dir>/custom_components
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!

View File

@@ -1,9 +1,13 @@
## Breaking Change:
<!-- What is breaking and why we have to break it. Remove this section only if it was NOT a breaking change. -->
## Description:
**Related issue (if applicable):** fixes #<home-assistant issue number goes here>
**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
**Pull request with documentation for [home-assistant.io](https://github.com/home-assistant/home-assistant.io) (if applicable):** home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
## Example entry for `configuration.yaml` (if applicable):
```yaml
@@ -14,18 +18,18 @@
- [ ] The code change is tested and works locally.
- [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)
If the code communicates with devices, web services, or third-party tools:
- [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
- [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).
- [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
- [ ] New files were added to `.coveragerc`.
- [ ] [_The manifest file_][manifest-docs] has all fields filled out correctly. Update and include derived files by running `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt` by running `python3 -m script.gen_requirements_all`.
- [ ] Untested files have been added to `.coveragerc`.
If the code does not interact with devices:
- [ ] Tests have been added to verify that the new code works.
[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L54
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[manifest-docs]: https://developers.home-assistant.io/docs/en/creating_integration_manifest.html

4
.gitignore vendored
View File

@@ -1,4 +1,5 @@
config/*
config2/*
tests/testing_config/deps
tests/testing_config/home-assistant.log
@@ -55,6 +56,7 @@ pip-log.txt
.tox
nosetests.xml
htmlcov/
test-reports/
# Translations
*.mo
@@ -83,7 +85,7 @@ Scripts/
# vimmy stuff
*.swp
*.swo
tags
ctags.tmp
# vagrant stuff

View File

@@ -1,8 +1,18 @@
sudo: false
dist: xenial
addons:
apt:
sources:
- sourceline: "ppa:jonathonf/ffmpeg-4"
packages:
- libudev-dev
- libavformat-dev
- libavcodec-dev
- libavdevice-dev
- libavutil-dev
- libswscale-dev
- libswresample-dev
- libavfilter-dev
matrix:
fast_finish: true
include:
@@ -13,36 +23,11 @@ matrix:
- python: "3.5.3"
env: TOXENV=typing
- python: "3.5.3"
env: TOXENV=cov
after_success: coveralls
- python: "3.6"
env: TOXENV=py36
env: TOXENV=py35
- python: "3.7"
env: TOXENV=py37
dist: xenial
- python: "3.8-dev"
env: TOXENV=py38
dist: xenial
if: branch = dev AND type = push
allow_failures:
- python: "3.8-dev"
env: TOXENV=py38
dist: xenial
cache:
directories:
- $HOME/.cache/pip
install: pip install -U tox coveralls
cache: pip
install: pip install -U tox
language: python
script: travis_wait 30 tox --develop
services:
- docker
before_deploy:
- docker pull lokalise/lokalise-cli@sha256:2198814ebddfda56ee041a4b427521757dd57f75415ea9693696a64c550cef21
deploy:
skip_cleanup: true
provider: script
script: script/travis_deploy
on:
branch: dev
condition: $TOXENV = lint
script: travis_wait 40 tox --develop

View File

@@ -1,3 +1,4 @@
# This file is generated by script/manifest/codeowners.py
# People marked here will be automatically requested for a review
# when the code that they own is touched.
# https://github.com/blog/2392-introducing-code-owners
@@ -7,269 +8,272 @@ setup.py @home-assistant/core
homeassistant/*.py @home-assistant/core
homeassistant/helpers/* @home-assistant/core
homeassistant/util/* @home-assistant/core
homeassistant/components/api.py @home-assistant/core
homeassistant/components/auth/* @home-assistant/core
homeassistant/components/automation/* @home-assistant/core
homeassistant/components/cloud/* @home-assistant/core
homeassistant/components/config/* @home-assistant/core
homeassistant/components/configurator.py @home-assistant/core
homeassistant/components/conversation/* @home-assistant/core
homeassistant/components/frontend/* @home-assistant/core
homeassistant/components/group/* @home-assistant/core
homeassistant/components/history.py @home-assistant/core
homeassistant/components/http/* @home-assistant/core
homeassistant/components/input_*.py @home-assistant/core
homeassistant/components/introduction.py @home-assistant/core
homeassistant/components/logger.py @home-assistant/core
homeassistant/components/lovelace/* @home-assistant/core
homeassistant/components/mqtt/* @home-assistant/core
homeassistant/components/panel_custom.py @home-assistant/core
homeassistant/components/panel_iframe.py @home-assistant/core
homeassistant/components/onboarding/* @home-assistant/core
homeassistant/components/persistent_notification/* @home-assistant/core
homeassistant/components/scene/__init__.py @home-assistant/core
homeassistant/components/scene/hass.py @home-assistant/core
homeassistant/components/script.py @home-assistant/core
homeassistant/components/shell_command.py @home-assistant/core
homeassistant/components/sun.py @home-assistant/core
homeassistant/components/updater.py @home-assistant/core
homeassistant/components/weblink/* @home-assistant/core
homeassistant/components/websocket_api.py @home-assistant/core
homeassistant/components/zone/* @home-assistant/core
# Home Assistant Developer Teams
# Virtualization
Dockerfile @home-assistant/docker
virtualization/Docker/* @home-assistant/docker
homeassistant/components/zwave/* @home-assistant/z-wave
homeassistant/components/*/zwave.py @home-assistant/z-wave
homeassistant/components/hassio/* @home-assistant/hassio
# Individual platforms
homeassistant/components/alarm_control_panel/egardia.py @jeroenterheerdt
homeassistant/components/alarm_control_panel/manual_mqtt.py @colinodell
homeassistant/components/binary_sensor/hikvision.py @mezz64
homeassistant/components/binary_sensor/threshold.py @fabaff
homeassistant/components/binary_sensor/uptimerobot.py @ludeeus
homeassistant/components/camera/yi.py @bachya
homeassistant/components/climate/ephember.py @ttroy50
homeassistant/components/climate/eq3btsmart.py @rytilahti
homeassistant/components/climate/mill.py @danielhiversen
homeassistant/components/climate/sensibo.py @andrey-git
homeassistant/components/cover/brunt.py @eavanvalkenburg
homeassistant/components/cover/group.py @cdce8p
homeassistant/components/cover/template.py @PhracturedBlue
homeassistant/components/device_tracker/asuswrt.py @kennedyshead
homeassistant/components/device_tracker/automatic.py @armills
homeassistant/components/device_tracker/googlehome.py @ludeeus
homeassistant/components/device_tracker/huawei_router.py @abmantis
homeassistant/components/device_tracker/quantum_gateway.py @cisasteelersfan
homeassistant/components/device_tracker/tile.py @bachya
homeassistant/components/device_tracker/traccar.py @ludeeus
homeassistant/components/device_tracker/bt_smarthub.py @jxwolstenholme
homeassistant/components/history_graph.py @andrey-git
homeassistant/components/influx.py @fabaff
homeassistant/components/light/lifx_legacy.py @amelchio
homeassistant/components/light/tplink.py @rytilahti
homeassistant/components/light/yeelight.py @rytilahti
homeassistant/components/light/yeelightsunflower.py @lindsaymarkward
homeassistant/components/lock/nello.py @pschmitt
homeassistant/components/lock/nuki.py @pschmitt
homeassistant/components/media_player/emby.py @mezz64
homeassistant/components/media_player/kodi.py @armills
homeassistant/components/media_player/liveboxplaytv.py @pschmitt
homeassistant/components/media_player/mediaroom.py @dgomes
homeassistant/components/media_player/monoprice.py @etsinko
homeassistant/components/media_player/mpd.py @fabaff
homeassistant/components/media_player/sonos.py @amelchio
homeassistant/components/media_player/xiaomi_tv.py @fattdev
homeassistant/components/media_player/yamaha_musiccast.py @jalmeroth
homeassistant/components/no_ip.py @fabaff
homeassistant/components/notify/file.py @fabaff
homeassistant/components/notify/flock.py @fabaff
homeassistant/components/notify/instapush.py @fabaff
homeassistant/components/notify/mastodon.py @fabaff
homeassistant/components/notify/smtp.py @fabaff
homeassistant/components/notify/syslog.py @fabaff
homeassistant/components/notify/xmpp.py @fabaff
homeassistant/components/notify/yessssms.py @flowolf
homeassistant/components/plant.py @ChristianKuehnel
homeassistant/components/scene/lifx_cloud.py @amelchio
homeassistant/components/sensor/airvisual.py @bachya
homeassistant/components/sensor/alpha_vantage.py @fabaff
homeassistant/components/sensor/bitcoin.py @fabaff
homeassistant/components/sensor/cpuspeed.py @fabaff
homeassistant/components/sensor/cups.py @fabaff
homeassistant/components/sensor/darksky.py @fabaff
homeassistant/components/sensor/file.py @fabaff
homeassistant/components/sensor/filter.py @dgomes
homeassistant/components/sensor/fixer.py @fabaff
homeassistant/components/sensor/flunearyou.py.py @bachya
homeassistant/components/sensor/gearbest.py @HerrHofrat
homeassistant/components/sensor/gitter.py @fabaff
homeassistant/components/sensor/glances.py @fabaff
homeassistant/components/sensor/gpsd.py @fabaff
homeassistant/components/sensor/irish_rail_transport.py @ttroy50
homeassistant/components/sensor/jewish_calendar.py @tsvi
homeassistant/components/sensor/launch_library.py @ludeeus
homeassistant/components/sensor/linux_battery.py @fabaff
homeassistant/components/sensor/miflora.py @danielhiversen @ChristianKuehnel
homeassistant/components/sensor/min_max.py @fabaff
homeassistant/components/sensor/moon.py @fabaff
homeassistant/components/sensor/netdata.py @fabaff
homeassistant/components/sensor/nsw_fuel_station.py @nickw444
homeassistant/components/sensor/pi_hole.py @fabaff
homeassistant/components/sensor/pollen.py @bachya
homeassistant/components/sensor/pvoutput.py @fabaff
homeassistant/components/sensor/qnap.py @colinodell
homeassistant/components/sensor/ruter.py @ludeeus
homeassistant/components/sensor/scrape.py @fabaff
homeassistant/components/sensor/serial.py @fabaff
homeassistant/components/sensor/seventeentrack.py @bachya
homeassistant/components/sensor/shodan.py @fabaff
homeassistant/components/sensor/sma.py @kellerza
homeassistant/components/sensor/sql.py @dgomes
homeassistant/components/sensor/statistics.py @fabaff
homeassistant/components/sensor/swiss*.py @fabaff
homeassistant/components/sensor/sytadin.py @gautric
homeassistant/components/sensor/tautulli.py @ludeeus
homeassistant/components/sensor/time_data.py @fabaff
homeassistant/components/sensor/version.py @fabaff
homeassistant/components/sensor/waqi.py @andrey-git
homeassistant/components/sensor/worldclock.py @fabaff
homeassistant/components/shiftr.py @fabaff
homeassistant/components/spaceapi.py @fabaff
homeassistant/components/switch/switchbot.py @danielhiversen
homeassistant/components/switch/switchmate.py @danielhiversen
homeassistant/components/switch/tplink.py @rytilahti
homeassistant/components/vacuum/roomba.py @pschmitt
homeassistant/components/weather/__init__.py @fabaff
homeassistant/components/weather/darksky.py @fabaff
homeassistant/components/weather/demo.py @fabaff
homeassistant/components/weather/met.py @danielhiversen
homeassistant/components/weather/openweathermap.py @fabaff
homeassistant/components/xiaomi_aqara.py @danielhiversen @syssi
# A
homeassistant/components/arduino.py @fabaff
homeassistant/components/*/arduino.py @fabaff
homeassistant/components/*/arest.py @fabaff
homeassistant/components/*/axis.py @kane610
# B
homeassistant/components/blink/* @fronzbot
homeassistant/components/*/blink.py @fronzbot
homeassistant/components/bmw_connected_drive.py @ChristianKuehnel
homeassistant/components/*/bmw_connected_drive.py @ChristianKuehnel
homeassistant/components/*/broadlink.py @danielhiversen
# C
homeassistant/components/cloudflare.py @ludeeus
homeassistant/components/counter/* @fabaff
# D
homeassistant/components/daikin.py @fredrike @rofrantz
homeassistant/components/*/daikin.py @fredrike @rofrantz
homeassistant/components/*/deconz.py @kane610
homeassistant/components/digital_ocean.py @fabaff
homeassistant/components/*/digital_ocean.py @fabaff
homeassistant/components/dweet.py @fabaff
homeassistant/components/*/dweet.py @fabaff
# E
homeassistant/components/ecovacs.py @OverloadUT
homeassistant/components/*/ecovacs.py @OverloadUT
homeassistant/components/*/edp_redy.py @abmantis
homeassistant/components/edp_redy.py @abmantis
homeassistant/components/eight_sleep.py @mezz64
homeassistant/components/*/eight_sleep.py @mezz64
homeassistant/components/esphome/*.py @OttoWinter
# H
homeassistant/components/hive.py @Rendili @KJonline
homeassistant/components/*/hive.py @Rendili @KJonline
homeassistant/components/homekit/* @cdce8p
homeassistant/components/huawei_lte.py @scop
homeassistant/components/*/huawei_lte.py @scop
# K
homeassistant/components/knx.py @Julius2342
homeassistant/components/*/knx.py @Julius2342
homeassistant/components/konnected.py @heythisisnate
homeassistant/components/*/konnected.py @heythisisnate
# L
homeassistant/components/lifx.py @amelchio
homeassistant/components/*/lifx.py @amelchio
homeassistant/components/luftdaten/* @fabaff
homeassistant/components/*/luftdaten.py @fabaff
# M
homeassistant/components/matrix.py @tinloaf
homeassistant/components/*/matrix.py @tinloaf
homeassistant/components/melissa.py @kennedyshead
homeassistant/components/*/melissa.py @kennedyshead
homeassistant/components/*/mystrom.py @fabaff
# N
homeassistant/components/ness_alarm.py @nickw444
homeassistant/components/*/ness_alarm.py @nickw444
# O
homeassistant/components/openuv/* @bachya
# P
homeassistant/components/point/* @fredrike
homeassistant/components/*/point.py @fredrike
# Q
homeassistant/components/qwikswitch.py @kellerza
homeassistant/components/*/qwikswitch.py @kellerza
# R
homeassistant/components/rainmachine/* @bachya
homeassistant/components/*/random.py @fabaff
homeassistant/components/*/rfxtrx.py @danielhiversen
# S
homeassistant/components/simplisafe/* @bachya
# T
homeassistant/components/tahoma.py @philklei
homeassistant/components/*/tahoma.py @philklei
homeassistant/components/tellduslive/*.py @fredrike
homeassistant/components/*/tellduslive.py @fredrike
homeassistant/components/tesla.py @zabuldon
homeassistant/components/*/tesla.py @zabuldon
homeassistant/components/thethingsnetwork.py @fabaff
homeassistant/components/*/thethingsnetwork.py @fabaff
homeassistant/components/tibber/* @danielhiversen
homeassistant/components/*/tibber.py @danielhiversen
homeassistant/components/tradfri/* @ggravlingen
homeassistant/components/*/tradfri.py @ggravlingen
# U
homeassistant/components/unifi.py @kane610
homeassistant/components/switch/unifi.py @kane610
homeassistant/components/upcloud.py @scop
homeassistant/components/*/upcloud.py @scop
# V
homeassistant/components/velux.py @Julius2342
homeassistant/components/*/velux.py @Julius2342
# W
homeassistant/components/wemo.py @sqldiablo
homeassistant/components/*/wemo.py @sqldiablo
# X
homeassistant/components/*/xiaomi_aqara.py @danielhiversen @syssi
homeassistant/components/*/xiaomi_miio.py @rytilahti @syssi
# Z
homeassistant/components/zoneminder/ @rohankapoorcom
homeassistant/components/*/zoneminder.py @rohankapoorcom
# Other code
homeassistant/scripts/check_config.py @kellerza
# Integrations
homeassistant/components/airvisual/* @bachya
homeassistant/components/alarm_control_panel/* @colinodell
homeassistant/components/alpha_vantage/* @fabaff
homeassistant/components/amazon_polly/* @robbiet480
homeassistant/components/ambiclimate/* @danielhiversen
homeassistant/components/ambient_station/* @bachya
homeassistant/components/api/* @home-assistant/core
homeassistant/components/arduino/* @fabaff
homeassistant/components/arest/* @fabaff
homeassistant/components/asuswrt/* @kennedyshead
homeassistant/components/auth/* @home-assistant/core
homeassistant/components/automatic/* @armills
homeassistant/components/automation/* @home-assistant/core
homeassistant/components/aws/* @awarecan @robbiet480
homeassistant/components/axis/* @kane610
homeassistant/components/bitcoin/* @fabaff
homeassistant/components/bizkaibus/* @UgaitzEtxebarria
homeassistant/components/blink/* @fronzbot
homeassistant/components/bmw_connected_drive/* @ChristianKuehnel
homeassistant/components/braviatv/* @robbiet480
homeassistant/components/broadlink/* @danielhiversen
homeassistant/components/brunt/* @eavanvalkenburg
homeassistant/components/bt_smarthub/* @jxwolstenholme
homeassistant/components/cisco_ios/* @fbradyirl
homeassistant/components/cisco_mobility_express/* @fbradyirl
homeassistant/components/cisco_webex_teams/* @fbradyirl
homeassistant/components/ciscospark/* @fbradyirl
homeassistant/components/cloud/* @home-assistant/core
homeassistant/components/cloudflare/* @ludeeus
homeassistant/components/config/* @home-assistant/core
homeassistant/components/configurator/* @home-assistant/core
homeassistant/components/conversation/* @home-assistant/core
homeassistant/components/coolmaster/* @OnFreund
homeassistant/components/counter/* @fabaff
homeassistant/components/cover/* @home-assistant/core
homeassistant/components/cpuspeed/* @fabaff
homeassistant/components/cups/* @fabaff
homeassistant/components/daikin/* @fredrike @rofrantz
homeassistant/components/darksky/* @fabaff
homeassistant/components/deconz/* @kane610
homeassistant/components/demo/* @home-assistant/core
homeassistant/components/digital_ocean/* @fabaff
homeassistant/components/discogs/* @thibmaek
homeassistant/components/doorbird/* @oblogic7
homeassistant/components/dweet/* @fabaff
homeassistant/components/ecovacs/* @OverloadUT
homeassistant/components/edp_redy/* @abmantis
homeassistant/components/egardia/* @jeroenterheerdt
homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/emby/* @mezz64
homeassistant/components/enigma2/* @fbradyirl
homeassistant/components/enocean/* @bdurrer
homeassistant/components/ephember/* @ttroy50
homeassistant/components/epsonworkforce/* @ThaStealth
homeassistant/components/eq3btsmart/* @rytilahti
homeassistant/components/esphome/* @OttoWinter
homeassistant/components/essent/* @TheLastProject
homeassistant/components/evohome/* @zxdavb
homeassistant/components/file/* @fabaff
homeassistant/components/filter/* @dgomes
homeassistant/components/fitbit/* @robbiet480
homeassistant/components/fixer/* @fabaff
homeassistant/components/flock/* @fabaff
homeassistant/components/flunearyou/* @bachya
homeassistant/components/foursquare/* @robbiet480
homeassistant/components/freebox/* @snoof85
homeassistant/components/frontend/* @home-assistant/core
homeassistant/components/gearbest/* @HerrHofrat
homeassistant/components/geniushub/* @zxdavb
homeassistant/components/gitter/* @fabaff
homeassistant/components/glances/* @fabaff
homeassistant/components/gntp/* @robbiet480
homeassistant/components/google_translate/* @awarecan
homeassistant/components/google_travel_time/* @robbiet480
homeassistant/components/googlehome/* @ludeeus
homeassistant/components/gpsd/* @fabaff
homeassistant/components/group/* @home-assistant/core
homeassistant/components/gtfs/* @robbiet480
homeassistant/components/harmony/* @ehendrix23
homeassistant/components/hassio/* @home-assistant/hass-io
homeassistant/components/heos/* @andrewsayre
homeassistant/components/hikvision/* @mezz64
homeassistant/components/hikvisioncam/* @fbradyirl
homeassistant/components/history/* @home-assistant/core
homeassistant/components/history_graph/* @andrey-git
homeassistant/components/hive/* @Rendili @KJonline
homeassistant/components/homeassistant/* @home-assistant/core
homeassistant/components/homekit/* @cdce8p
homeassistant/components/homekit_controller/* @Jc2k
homeassistant/components/homematic/* @pvizeli @danielperna84
homeassistant/components/html5/* @robbiet480
homeassistant/components/http/* @home-assistant/core
homeassistant/components/huawei_lte/* @scop
homeassistant/components/huawei_router/* @abmantis
homeassistant/components/hue/* @balloob
homeassistant/components/ign_sismologia/* @exxamalte
homeassistant/components/incomfort/* @zxdavb
homeassistant/components/influxdb/* @fabaff
homeassistant/components/input_boolean/* @home-assistant/core
homeassistant/components/input_datetime/* @home-assistant/core
homeassistant/components/input_number/* @home-assistant/core
homeassistant/components/input_select/* @home-assistant/core
homeassistant/components/input_text/* @home-assistant/core
homeassistant/components/integration/* @dgomes
homeassistant/components/ios/* @robbiet480
homeassistant/components/ipma/* @dgomes
homeassistant/components/iqvia/* @bachya
homeassistant/components/irish_rail_transport/* @ttroy50
homeassistant/components/jewish_calendar/* @tsvi
homeassistant/components/knx/* @Julius2342
homeassistant/components/kodi/* @armills
homeassistant/components/konnected/* @heythisisnate
homeassistant/components/lametric/* @robbiet480
homeassistant/components/launch_library/* @ludeeus
homeassistant/components/lifx/* @amelchio
homeassistant/components/lifx_cloud/* @amelchio
homeassistant/components/lifx_legacy/* @amelchio
homeassistant/components/linux_battery/* @fabaff
homeassistant/components/liveboxplaytv/* @pschmitt
homeassistant/components/logger/* @home-assistant/core
homeassistant/components/logi_circle/* @evanjd
homeassistant/components/lovelace/* @home-assistant/core
homeassistant/components/luci/* @fbradyirl
homeassistant/components/luftdaten/* @fabaff
homeassistant/components/mastodon/* @fabaff
homeassistant/components/matrix/* @tinloaf
homeassistant/components/mediaroom/* @dgomes
homeassistant/components/melissa/* @kennedyshead
homeassistant/components/met/* @danielhiversen
homeassistant/components/meteoalarm/* @rolfberkenbosch
homeassistant/components/miflora/* @danielhiversen @ChristianKuehnel
homeassistant/components/mill/* @danielhiversen
homeassistant/components/min_max/* @fabaff
homeassistant/components/mobile_app/* @robbiet480
homeassistant/components/monoprice/* @etsinko
homeassistant/components/moon/* @fabaff
homeassistant/components/mpd/* @fabaff
homeassistant/components/mqtt/* @home-assistant/core
homeassistant/components/mystrom/* @fabaff
homeassistant/components/nello/* @pschmitt
homeassistant/components/ness_alarm/* @nickw444
homeassistant/components/nest/* @awarecan
homeassistant/components/netdata/* @fabaff
homeassistant/components/nextbus/* @vividboarder
homeassistant/components/nissan_leaf/* @filcole
homeassistant/components/nmbs/* @thibmaek
homeassistant/components/no_ip/* @fabaff
homeassistant/components/notify/* @home-assistant/core
homeassistant/components/nsw_fuel_station/* @nickw444
homeassistant/components/nuki/* @pschmitt
homeassistant/components/ohmconnect/* @robbiet480
homeassistant/components/onboarding/* @home-assistant/core
homeassistant/components/openuv/* @bachya
homeassistant/components/openweathermap/* @fabaff
homeassistant/components/orangepi_gpio/* @pascallj
homeassistant/components/owlet/* @oblogic7
homeassistant/components/panel_custom/* @home-assistant/core
homeassistant/components/panel_iframe/* @home-assistant/core
homeassistant/components/persistent_notification/* @home-assistant/core
homeassistant/components/philips_js/* @elupus
homeassistant/components/pi_hole/* @fabaff
homeassistant/components/plant/* @ChristianKuehnel
homeassistant/components/point/* @fredrike
homeassistant/components/ps4/* @ktnrg45
homeassistant/components/ptvsd/* @swamp-ig
homeassistant/components/push/* @dgomes
homeassistant/components/pvoutput/* @fabaff
homeassistant/components/qnap/* @colinodell
homeassistant/components/quantum_gateway/* @cisasteelersfan
homeassistant/components/qwikswitch/* @kellerza
homeassistant/components/raincloud/* @vanstinator
homeassistant/components/rainmachine/* @bachya
homeassistant/components/random/* @fabaff
homeassistant/components/rfxtrx/* @danielhiversen
homeassistant/components/rmvtransport/* @cgtobi
homeassistant/components/roomba/* @pschmitt
homeassistant/components/ruter/* @ludeeus
homeassistant/components/scene/* @home-assistant/core
homeassistant/components/scrape/* @fabaff
homeassistant/components/script/* @home-assistant/core
homeassistant/components/sensibo/* @andrey-git
homeassistant/components/serial/* @fabaff
homeassistant/components/seventeentrack/* @bachya
homeassistant/components/shell_command/* @home-assistant/core
homeassistant/components/shiftr/* @fabaff
homeassistant/components/shodan/* @fabaff
homeassistant/components/simplisafe/* @bachya
homeassistant/components/sma/* @kellerza
homeassistant/components/smartthings/* @andrewsayre
homeassistant/components/smtp/* @fabaff
homeassistant/components/sonos/* @amelchio
homeassistant/components/spaceapi/* @fabaff
homeassistant/components/spider/* @peternijssen
homeassistant/components/sql/* @dgomes
homeassistant/components/statistics/* @fabaff
homeassistant/components/stiebel_eltron/* @fucm
homeassistant/components/sun/* @home-assistant/core
homeassistant/components/supla/* @mwegrzynek
homeassistant/components/swiss_hydrological_data/* @fabaff
homeassistant/components/swiss_public_transport/* @fabaff
homeassistant/components/switchbot/* @danielhiversen
homeassistant/components/switcher_kis/* @tomerfi
homeassistant/components/switchmate/* @danielhiversen
homeassistant/components/syncthru/* @nielstron
homeassistant/components/synology_srm/* @aerialls
homeassistant/components/syslog/* @fabaff
homeassistant/components/sytadin/* @gautric
homeassistant/components/tahoma/* @philklei
homeassistant/components/tautulli/* @ludeeus
homeassistant/components/tellduslive/* @fredrike
homeassistant/components/template/* @PhracturedBlue
homeassistant/components/tesla/* @zabuldon
homeassistant/components/tfiac/* @fredrike @mellado
homeassistant/components/thethingsnetwork/* @fabaff
homeassistant/components/threshold/* @fabaff
homeassistant/components/tibber/* @danielhiversen
homeassistant/components/tile/* @bachya
homeassistant/components/time_date/* @fabaff
homeassistant/components/toon/* @frenck
homeassistant/components/tplink/* @rytilahti
homeassistant/components/traccar/* @ludeeus
homeassistant/components/tradfri/* @ggravlingen
homeassistant/components/tts/* @robbiet480
homeassistant/components/twilio_call/* @robbiet480
homeassistant/components/twilio_sms/* @robbiet480
homeassistant/components/uber/* @robbiet480
homeassistant/components/unifi/* @kane610
homeassistant/components/upcloud/* @scop
homeassistant/components/updater/* @home-assistant/core
homeassistant/components/upnp/* @robbiet480
homeassistant/components/uptimerobot/* @ludeeus
homeassistant/components/utility_meter/* @dgomes
homeassistant/components/velux/* @Julius2342
homeassistant/components/version/* @fabaff
homeassistant/components/vizio/* @raman325
homeassistant/components/waqi/* @andrey-git
homeassistant/components/weather/* @fabaff
homeassistant/components/weblink/* @home-assistant/core
homeassistant/components/websocket_api/* @home-assistant/core
homeassistant/components/wemo/* @sqldiablo
homeassistant/components/worldclock/* @fabaff
homeassistant/components/xfinity/* @cisasteelersfan
homeassistant/components/xiaomi_aqara/* @danielhiversen @syssi
homeassistant/components/xiaomi_miio/* @rytilahti @syssi
homeassistant/components/xiaomi_tv/* @fattdev
homeassistant/components/xmpp/* @fabaff @flowolf
homeassistant/components/yamaha_musiccast/* @jalmeroth
homeassistant/components/yeelight/* @rytilahti @zewelor
homeassistant/components/yeelightsunflower/* @lindsaymarkward
homeassistant/components/yessssms/* @flowolf
homeassistant/components/yi/* @bachya
homeassistant/components/zeroconf/* @robbiet480
homeassistant/components/zha/* @dmulcahey @adminiuga
homeassistant/components/zone/* @home-assistant/core
homeassistant/components/zoneminder/* @rohankapoorcom
homeassistant/components/zwave/* @home-assistant/z-wave
# Individual files
homeassistant/components/group/cover @cdce8p
homeassistant/components/demo/weather @fabaff

View File

@@ -2,7 +2,7 @@
# When updating this file, please also update virtualization/Docker/Dockerfile.dev
# This way, the development image and the production image are kept in sync.
FROM python:3.6
FROM python:3.7
LABEL maintainer="Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>"
# Uncomment any of the following lines to disable the installation.
@@ -27,7 +27,7 @@ COPY requirements_all.txt requirements_all.txt
# Uninstall enum34 because some dependencies install it but breaks Python 3.4+.
# See PR #8103 for more info.
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet cython tensorflow
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop==0.12.2 cchardet cython tensorflow
# Copy source
COPY . .

View File

@@ -1,4 +1,4 @@
Home Assistant |Build Status| |Coverage Status| |Chat Status|
Home Assistant |Build Status| |CI Status| |Coverage Status| |Chat Status|
=================================================================================
Home Assistant is a home automation platform running on Python 3. It is able to track and control all devices at home and offer a platform for automating control.
@@ -27,8 +27,10 @@ components <https://developers.home-assistant.io/docs/en/creating_component_inde
If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.
.. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=master
.. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=dev
:target: https://travis-ci.org/home-assistant/home-assistant
.. |CI Status| image:: https://circleci.com/gh/home-assistant/home-assistant.svg?style=shield
:target: https://circleci.com/gh/home-assistant/home-assistant
.. |Coverage Status| image:: https://img.shields.io/coveralls/home-assistant/home-assistant.svg
:target: https://coveralls.io/r/home-assistant/home-assistant?branch=master
.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg

186
azure-pipelines.yml Normal file
View File

@@ -0,0 +1,186 @@
# https://dev.azure.com/home-assistant
trigger:
batch: true
branches:
include:
- dev
tags:
include:
- '*'
variables:
- name: versionBuilder
value: '3.2'
- name: versionWheels
value: '0.3'
- group: docker
- group: wheels
- group: github
jobs:
- job: 'Wheels'
condition: eq(variables['Build.SourceBranchName'], 'dev')
timeoutInMinutes: 360
pool:
vmImage: 'ubuntu-16.04'
strategy:
maxParallel: 3
matrix:
amd64:
buildArch: 'amd64'
i386:
buildArch: 'i386'
armhf:
buildArch: 'armhf'
armv7:
buildArch: 'armv7'
aarch64:
buildArch: 'aarch64'
steps:
- script: |
sudo apt-get install -y --no-install-recommends \
qemu-user-static \
binfmt-support
sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
sudo update-binfmts --enable qemu-arm
sudo update-binfmts --enable qemu-aarch64
displayName: 'Initial cross build'
- script: |
mkdir -p .ssh
echo -e "-----BEGIN RSA PRIVATE KEY-----\n$(wheelsSSH)\n-----END RSA PRIVATE KEY-----" >> .ssh/id_rsa
ssh-keyscan -H $(wheelsHost) >> .ssh/known_hosts
chmod 600 .ssh/*
displayName: 'Install ssh key'
- script: sudo docker pull homeassistant/$(buildArch)-wheels:$(versionWheels)
displayName: 'Install wheels builder'
- script: |
cp requirements_all.txt requirements_hassio.txt
# Enable because we can build it
sed -i "s|# pytradfri|pytradfri|g" requirements_hassio.txt
sed -i "s|# pybluez|pybluez|g" requirements_hassio.txt
sed -i "s|# bluepy|bluepy|g" requirements_hassio.txt
sed -i "s|# beacontools|beacontools|g" requirements_hassio.txt
sed -i "s|# RPi.GPIO|RPi.GPIO|g" requirements_hassio.txt
sed -i "s|# raspihats|raspihats|g" requirements_hassio.txt
sed -i "s|# rpi-rf|rpi-rf|g" requirements_hassio.txt
sed -i "s|# blinkt|blinkt|g" requirements_hassio.txt
sed -i "s|# fritzconnection|fritzconnection|g" requirements_hassio.txt
sed -i "s|# pyuserinput|pyuserinput|g" requirements_hassio.txt
sed -i "s|# evdev|evdev|g" requirements_hassio.txt
sed -i "s|# smbus-cffi|smbus-cffi|g" requirements_hassio.txt
sed -i "s|# i2csense|i2csense|g" requirements_hassio.txt
sed -i "s|# python-eq3bt|python-eq3bt|g" requirements_hassio.txt
sed -i "s|# pycups|pycups|g" requirements_hassio.txt
sed -i "s|# homekit|homekit|g" requirements_hassio.txt
sed -i "s|# decora_wifi|decora_wifi|g" requirements_hassio.txt
sed -i "s|# decora|decora|g" requirements_hassio.txt
sed -i "s|# PySwitchbot|PySwitchbot|g" requirements_hassio.txt
sed -i "s|# pySwitchmate|pySwitchmate|g" requirements_hassio.txt
# Disable because of error
sed -i "s|insteonplm|# insteonplm|g" requirements_hassio.txt
displayName: 'Prepare requirements files for Hass.io'
- script: |
sudo docker run --rm -v $(pwd):/data:ro -v $(pwd)/.ssh:/root/.ssh:rw \
homeassistant/$(buildArch)-wheels:$(versionWheels) \
--apk "build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;linux-headers;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev" \
--index https://wheels.hass.io \
--requirement requirements_hassio.txt \
--upload rsync \
--remote wheels@$(wheelsHost):/opt/wheels
displayName: 'Run wheels build'
- job: 'Release'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-16.04'
strategy:
maxParallel: 5
matrix:
amd64:
buildArch: 'amd64'
buildMachine: 'qemux86-64,intel-nuc'
i386:
buildArch: 'i386'
buildMachine: 'qemux86'
armhf:
buildArch: 'armhf'
buildMachine: 'qemuarm,raspberrypi'
armv7:
buildArch: 'armv7'
buildMachine: 'raspberrypi2,raspberrypi3,odroid-xu,tinker'
aarch64:
buildArch: 'aarch64'
buildMachine: 'qemuarm-64,raspberrypi3-64,odroid-c2,orangepi-prime'
steps:
- script: sudo docker login -u $(dockerUser) -p $(dockerPassword)
displayName: 'Docker hub login'
- script: sudo docker pull homeassistant/amd64-builder:$(versionBuilder)
displayName: 'Install Builder'
- script: |
set -e
sudo docker run --rm --privileged \
-v ~/.docker:/root/.docker \
-v /run/docker.sock:/run/docker.sock:rw \
homeassistant/amd64-builder:$(versionBuilder) \
--homeassistant $(Build.SourceBranchName) "--$(buildArch)" \
-r https://github.com/home-assistant/hassio-homeassistant \
-t generic --docker-hub homeassistant
sudo docker run --rm --privileged \
-v ~/.docker:/root/.docker \
-v /run/docker.sock:/run/docker.sock:rw \
homeassistant/amd64-builder:$(versionBuilder) \
--homeassistant-machine "$(Build.SourceBranchName)=$(buildMachine)" \
-r https://github.com/home-assistant/hassio-homeassistant \
-t machine --docker-hub homeassistant
displayName: 'Build Release'
- job: 'ReleasePublish'
condition: and(startsWith(variables['Build.SourceBranch'], 'refs/tags'), succeeded('Release'))
dependsOn:
- 'Release'
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
sudo apt-get install -y --no-install-recommends \
git jq
git config --global user.name "Pascal Vizeli"
git config --global user.email "pvizeli@syshack.ch"
git config --global credential.helper store
echo "https://$(githubToken):x-oauth-basic@github.com > $HOME\.git-credentials
displayName: 'Install requirements'
- script: |
set -e
version="$(Build.SourceBranchName)"
git clone https://github.com/home-assistant/hassio-version
cd hassio-version
dev_version="$(jq --raw-output '.homeassistant.default' dev.json)"
beta_version="$(jq --raw-output '.homeassistant.default' beta.json)"
stable_version="$(jq --raw-output '.homeassistant.default' stable.json)"
if [[ "$version" =~ b ]]; then
sed -i "s|$dev_version|$version|g" dev.json
sed -i "s|$beta_version|$version|g" beta.json
else
sed -i "s|$dev_version|$version|g" dev.json
sed -i "s|$beta_version|$version|g" beta.json
sed -i "s|$stable_version|$version|g" stable.json
fi
git commit -am "Bump Home Assistant $version"
git push

View File

@@ -4,6 +4,23 @@ homeassistant.helpers package
Submodules
----------
homeassistant.helpers.aiohttp_client module
-------------------------------------------
.. automodule:: homeassistant.helpers.aiohttp_client
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.area_registry module
------------------------------------------
.. automodule:: homeassistant.helpers.area_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.condition module
--------------------------------------
@@ -12,6 +29,14 @@ homeassistant.helpers.condition module
:undoc-members:
:show-inheritance:
homeassistant.helpers.config_entry_flow module
----------------------------------------------
.. automodule:: homeassistant.helpers.config_entry_flow
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.config_validation module
----------------------------------------------
@@ -20,6 +45,30 @@ homeassistant.helpers.config_validation module
:undoc-members:
:show-inheritance:
homeassistant.helpers.data_entry_flow module
--------------------------------------------
.. automodule:: homeassistant.helpers.data_entry_flow
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.deprecation module
----------------------------------------
.. automodule:: homeassistant.helpers.depracation
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.device_registry module
--------------------------------------------
.. automodule:: homeassistant.helpers.device_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.discovery module
--------------------------------------
@@ -28,6 +77,14 @@ homeassistant.helpers.discovery module
:undoc-members:
:show-inheritance:
homeassistant.helpers.dispatcher module
---------------------------------------
.. automodule:: homeassistant.helpers.dispatcher
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity module
-----------------------------------
@@ -44,6 +101,38 @@ homeassistant.helpers.entity_component module
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity_platform module
--------------------------------------------
.. automodule:: homeassistant.helpers.entity_platform
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity_registry module
--------------------------------------------
.. automodule:: homeassistant.helpers.entity_registry
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entity_values module
------------------------------------------
.. automodule:: homeassistant.helpers.entity_values
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.entityfilter module
-----------------------------------------
.. automodule:: homeassistant.helpers.entityfilter
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.event module
----------------------------------
@@ -52,10 +141,26 @@ homeassistant.helpers.event module
:undoc-members:
:show-inheritance:
homeassistant.helpers.event_decorators module
---------------------------------------------
homeassistant.helpers.icon module
---------------------------------
.. automodule:: homeassistant.helpers.event_decorators
.. automodule:: homeassistant.helpers.icon
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.intent module
-----------------------------------
.. automodule:: homeassistant.helpers.intent
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.json module
---------------------------------
.. automodule:: homeassistant.helpers.json
:members:
:undoc-members:
:show-inheritance:
@@ -68,6 +173,22 @@ homeassistant.helpers.location module
:undoc-members:
:show-inheritance:
homeassistant.helpers.logging module
------------------------------------
.. automodule:: homeassistant.helpers.logging
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.restore_state module
------------------------------------------
.. automodule:: homeassistant.helpers.restore_state
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.script module
-----------------------------------
@@ -84,6 +205,14 @@ homeassistant.helpers.service module
:undoc-members:
:show-inheritance:
homeassistant.helpers.signal module
-----------------------------------
.. automodule:: homeassistant.helpers.signal
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.state module
----------------------------------
@@ -92,6 +221,38 @@ homeassistant.helpers.state module
:undoc-members:
:show-inheritance:
homeassistant.helpers.storage module
------------------------------------
.. automodule:: homeassistant.helpers.storage
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.sun module
--------------------------------
.. automodule:: homeassistant.helpers.sun
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.system_info module
----------------------------------------
.. automodule:: homeassistant.helpers.system_info
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.temperature module
----------------------------------------
.. automodule:: homeassistant.helpers.temperature
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.template module
-------------------------------------
@@ -100,6 +261,14 @@ homeassistant.helpers.template module
:undoc-members:
:show-inheritance:
homeassistant.helpers.translation module
-----------------------------------------
.. automodule:: homeassistant.helpers.translation
:members:
:undoc-members:
:show-inheritance:
homeassistant.helpers.typing module
-----------------------------------

View File

@@ -7,8 +7,9 @@ import platform
import subprocess
import sys
import threading
from typing import List, Dict, Any # noqa pylint: disable=unused-import
from typing import ( # noqa pylint: disable=unused-import
List, Dict, Any, TYPE_CHECKING
)
from homeassistant import monkey_patch
from homeassistant.const import (
@@ -18,6 +19,9 @@ from homeassistant.const import (
RESTART_EXIT_CODE,
)
if TYPE_CHECKING:
from homeassistant import core
def set_loop() -> None:
"""Attempt to use uvloop."""
@@ -86,10 +90,12 @@ def ensure_config_path(config_dir: str) -> None:
sys.exit(1)
def ensure_config_file(config_dir: str) -> str:
async def ensure_config_file(hass: 'core.HomeAssistant', config_dir: str) \
-> str:
"""Ensure configuration file exists."""
import homeassistant.config as config_util
config_path = config_util.ensure_config_exists(config_dir)
config_path = await config_util.async_ensure_config_exists(
hass, config_dir)
if config_path is None:
print('Error getting configuration path')
@@ -261,6 +267,7 @@ def cmdline() -> List[str]:
async def setup_and_run_hass(config_dir: str,
args: argparse.Namespace) -> int:
"""Set up HASS and run."""
# pylint: disable=redefined-outer-name
from homeassistant import bootstrap, core
hass = core.HomeAssistant()
@@ -275,7 +282,7 @@ async def setup_and_run_hass(config_dir: str,
skip_pip=args.skip_pip, log_rotate_days=args.log_rotate_days,
log_file=args.log_file, log_no_color=args.log_no_color)
else:
config_file = ensure_config_file(config_dir)
config_file = await ensure_config_file(hass, config_dir)
print('Config directory:', config_dir)
await bootstrap.async_from_config_file(
config_file, hass, verbose=args.verbose, skip_pip=args.skip_pip,
@@ -390,7 +397,7 @@ def main() -> int:
if exit_code == RESTART_EXIT_CODE and not args.runner:
try_to_restart()
return exit_code # type: ignore # mypy cannot yet infer it
return exit_code # type: ignore
if __name__ == "__main__":

View File

@@ -100,9 +100,21 @@ class AuthManager:
"""Return a list of available auth modules."""
return list(self._mfa_modules.values())
def get_auth_provider(self, provider_type: str, provider_id: str) \
-> Optional[AuthProvider]:
"""Return an auth provider, None if not found."""
return self._providers.get((provider_type, provider_id))
def get_auth_providers(self, provider_type: str) \
-> List[AuthProvider]:
"""Return a List of auth provider of one type, Empty if not found."""
return [provider
for (p_type, _), provider in self._providers.items()
if p_type == provider_type]
def get_auth_mfa_module(self, module_id: str) \
-> Optional[MultiFactorAuthModule]:
"""Return an multi-factor auth module, None if not found."""
"""Return a multi-factor auth module, None if not found."""
return self._mfa_modules.get(module_id)
async def async_get_users(self) -> List[models.User]:
@@ -113,6 +125,11 @@ class AuthManager:
"""Retrieve a user."""
return await self._store.async_get_user(user_id)
async def async_get_owner(self) -> Optional[models.User]:
"""Retrieve the owner."""
users = await self.async_get_users()
return next((user for user in users if user.is_owner), None)
async def async_get_group(self, group_id: str) -> Optional[models.Group]:
"""Retrieve all groups."""
return await self._store.async_get_group(group_id)
@@ -170,8 +187,7 @@ class AuthManager:
user = await self.async_get_user_by_credentials(credentials)
if user is None:
raise ValueError('Unable to find the user.')
else:
return user
return user
auth_provider = self._async_get_auth_provider(credentials)

View File

@@ -11,13 +11,14 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.util import dt as dt_util
from . import models
from .const import GROUP_ID_ADMIN, GROUP_ID_READ_ONLY
from .const import GROUP_ID_ADMIN, GROUP_ID_USER, GROUP_ID_READ_ONLY
from .permissions import PermissionLookup, system_policies
from .permissions.types import PolicyType # noqa: F401
STORAGE_VERSION = 1
STORAGE_KEY = 'auth'
GROUP_NAME_ADMIN = 'Administrators'
GROUP_NAME_USER = "Users"
GROUP_NAME_READ_ONLY = 'Read Only'
@@ -38,6 +39,7 @@ class AuthStore:
self._perm_lookup = None # type: Optional[PermissionLookup]
self._store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY,
private=True)
self._lock = asyncio.Lock()
async def async_get_groups(self) -> List[models.Group]:
"""Retrieve all users."""
@@ -272,8 +274,16 @@ class AuthStore:
async def _async_load(self) -> None:
"""Load the users."""
[ent_reg, data] = await asyncio.gather(
async with self._lock:
if self._users is not None:
return
await self._async_load_task()
async def _async_load_task(self) -> None:
"""Load the users."""
[ent_reg, dev_reg, data] = await asyncio.gather(
self.hass.helpers.entity_registry.async_get_registry(),
self.hass.helpers.device_registry.async_get_registry(),
self._store.async_load(),
)
@@ -282,7 +292,9 @@ class AuthStore:
if self._users is not None:
return
self._perm_lookup = perm_lookup = PermissionLookup(ent_reg)
self._perm_lookup = perm_lookup = PermissionLookup(
ent_reg, dev_reg
)
if data is None:
self._set_defaults()
@@ -297,6 +309,7 @@ class AuthStore:
# 1. Data from a recent version which has a single group without policy
# 2. Data from old version which has no groups
has_admin_group = False
has_user_group = False
has_read_only_group = False
group_without_policy = None
@@ -314,6 +327,13 @@ class AuthStore:
policy = system_policies.ADMIN_POLICY
system_generated = True
elif group_dict['id'] == GROUP_ID_USER:
has_user_group = True
name = GROUP_NAME_USER
policy = system_policies.USER_POLICY
system_generated = True
elif group_dict['id'] == GROUP_ID_READ_ONLY:
has_read_only_group = True
@@ -361,6 +381,10 @@ class AuthStore:
read_only_group = _system_read_only_group()
groups[read_only_group.id] = read_only_group
if not has_user_group:
user_group = _system_user_group()
groups[user_group.id] = user_group
for user_dict in data['users']:
# Collect the users group.
user_groups = []
@@ -475,7 +499,7 @@ class AuthStore:
'name': group.name
} # type: Dict[str, Any]
if group.id not in (GROUP_ID_READ_ONLY, GROUP_ID_ADMIN):
if not group.system_generated:
g_dict['policy'] = group.policy
groups.append(g_dict)
@@ -528,6 +552,8 @@ class AuthStore:
groups = OrderedDict() # type: Dict[str, models.Group]
admin_group = _system_admin_group()
groups[admin_group.id] = admin_group
user_group = _system_user_group()
groups[user_group.id] = user_group
read_only_group = _system_read_only_group()
groups[read_only_group.id] = read_only_group
self._groups = groups
@@ -543,6 +569,16 @@ def _system_admin_group() -> models.Group:
)
def _system_user_group() -> models.Group:
"""Create system user group."""
return models.Group(
name=GROUP_NAME_USER,
id=GROUP_ID_USER,
policy=system_policies.USER_POLICY,
system_generated=True,
)
def _system_read_only_group() -> models.Group:
"""Create read only group."""
return models.Group(

View File

@@ -5,4 +5,5 @@ ACCESS_TOKEN_EXPIRATION = timedelta(minutes=30)
MFA_SESSION_EXPIRATION = timedelta(minutes=5)
GROUP_ID_ADMIN = 'system-admin'
GROUP_ID_USER = 'system-users'
GROUP_ID_READ_ONLY = 'system-read-only'

View File

@@ -2,6 +2,7 @@
Sending HOTP through notify service
"""
import asyncio
import logging
from collections import OrderedDict
from typing import Any, Dict, Optional, List
@@ -17,7 +18,7 @@ from homeassistant.helpers import config_validation as cv
from . import MultiFactorAuthModule, MULTI_FACTOR_AUTH_MODULES, \
MULTI_FACTOR_AUTH_MODULE_SCHEMA, SetupFlow
REQUIREMENTS = ['pyotp==2.2.6']
REQUIREMENTS = ['pyotp==2.2.7']
CONF_MESSAGE = 'message'
@@ -90,6 +91,7 @@ class NotifyAuthModule(MultiFactorAuthModule):
self._include = config.get(CONF_INCLUDE, [])
self._exclude = config.get(CONF_EXCLUDE, [])
self._message_template = config[CONF_MESSAGE]
self._init_lock = asyncio.Lock()
@property
def input_schema(self) -> vol.Schema:
@@ -98,15 +100,19 @@ class NotifyAuthModule(MultiFactorAuthModule):
async def _async_load(self) -> None:
"""Load stored data."""
data = await self._user_store.async_load()
async with self._init_lock:
if self._user_settings is not None:
return
if data is None:
data = {STORAGE_USERS: {}}
data = await self._user_store.async_load()
self._user_settings = {
user_id: NotifySetting(**setting)
for user_id, setting in data.get(STORAGE_USERS, {}).items()
}
if data is None:
data = {STORAGE_USERS: {}}
self._user_settings = {
user_id: NotifySetting(**setting)
for user_id, setting in data.get(STORAGE_USERS, {}).items()
}
async def _async_save(self) -> None:
"""Save data."""

View File

@@ -1,4 +1,5 @@
"""Time-based One Time Password auth module."""
import asyncio
import logging
from io import BytesIO
from typing import Any, Dict, Optional, Tuple # noqa: F401
@@ -11,7 +12,7 @@ from homeassistant.core import HomeAssistant
from . import MultiFactorAuthModule, MULTI_FACTOR_AUTH_MODULES, \
MULTI_FACTOR_AUTH_MODULE_SCHEMA, SetupFlow
REQUIREMENTS = ['pyotp==2.2.6', 'PyQRCode==1.2.1']
REQUIREMENTS = ['pyotp==2.2.7', 'PyQRCode==1.2.1']
CONFIG_SCHEMA = MULTI_FACTOR_AUTH_MODULE_SCHEMA.extend({
}, extra=vol.PREVENT_EXTRA)
@@ -68,6 +69,7 @@ class TotpAuthModule(MultiFactorAuthModule):
self._users = None # type: Optional[Dict[str, str]]
self._user_store = hass.helpers.storage.Store(
STORAGE_VERSION, STORAGE_KEY, private=True)
self._init_lock = asyncio.Lock()
@property
def input_schema(self) -> vol.Schema:
@@ -76,12 +78,16 @@ class TotpAuthModule(MultiFactorAuthModule):
async def _async_load(self) -> None:
"""Load stored data."""
data = await self._user_store.async_load()
async with self._init_lock:
if self._users is not None:
return
if data is None:
data = {STORAGE_USERS: {}}
data = await self._user_store.async_load()
self._users = data.get(STORAGE_USERS, {})
if data is None:
data = {STORAGE_USERS: {}}
self._users = data.get(STORAGE_USERS, {})
async def _async_save(self) -> None:
"""Save data."""

View File

@@ -11,6 +11,7 @@ from .models import PermissionLookup
from .types import PolicyType
from .entities import ENTITY_POLICY_SCHEMA, compile_entities
from .merge import merge_policies # noqa
from .util import test_all
POLICY_SCHEMA = vol.Schema({
@@ -29,6 +30,10 @@ class AbstractPermissions:
"""Return a function that can test entity access."""
raise NotImplementedError
def access_all_entities(self, key: str) -> bool:
"""Check if we have a certain access to all entities."""
raise NotImplementedError
def check_entity(self, entity_id: str, key: str) -> bool:
"""Check if we can access entity."""
entity_func = self._cached_entity_func
@@ -48,6 +53,10 @@ class PolicyPermissions(AbstractPermissions):
self._policy = policy
self._perm_lookup = perm_lookup
def access_all_entities(self, key: str) -> bool:
"""Check if we have a certain access to all entities."""
return test_all(self._policy.get(CAT_ENTITIES), key)
def _entity_func(self) -> Callable[[str, str], bool]:
"""Return a function that can test entity access."""
return compile_entities(self._policy.get(CAT_ENTITIES),
@@ -65,6 +74,10 @@ class _OwnerPermissions(AbstractPermissions):
# pylint: disable=no-self-use
def access_all_entities(self, key: str) -> bool:
"""Check if we have a certain access to all entities."""
return True
def _entity_func(self) -> Callable[[str, str], bool]:
"""Return a function that can test entity access."""
return lambda entity_id, key: True

View File

@@ -1,12 +1,14 @@
"""Entity permissions."""
from functools import wraps
from typing import Callable, List, Union # noqa: F401
from collections import OrderedDict
from typing import Callable, Optional # noqa: F401
import voluptuous as vol
from .const import SUBCAT_ALL, POLICY_READ, POLICY_CONTROL, POLICY_EDIT
from .models import PermissionLookup
from .types import CategoryType, ValueType
from .types import CategoryType, SubCategoryDict, ValueType
# pylint: disable=unused-import
from .util import SubCatLookupType, lookup_all, compile_policy # noqa
SINGLE_ENTITY_SCHEMA = vol.Any(True, vol.Schema({
vol.Optional(POLICY_READ): True,
@@ -15,6 +17,7 @@ SINGLE_ENTITY_SCHEMA = vol.Any(True, vol.Schema({
}))
ENTITY_DOMAINS = 'domains'
ENTITY_AREAS = 'area_ids'
ENTITY_DEVICE_IDS = 'device_ids'
ENTITY_ENTITY_IDS = 'entity_ids'
@@ -24,148 +27,65 @@ ENTITY_VALUES_SCHEMA = vol.Any(True, vol.Schema({
ENTITY_POLICY_SCHEMA = vol.Any(True, vol.Schema({
vol.Optional(SUBCAT_ALL): SINGLE_ENTITY_SCHEMA,
vol.Optional(ENTITY_AREAS): ENTITY_VALUES_SCHEMA,
vol.Optional(ENTITY_DEVICE_IDS): ENTITY_VALUES_SCHEMA,
vol.Optional(ENTITY_DOMAINS): ENTITY_VALUES_SCHEMA,
vol.Optional(ENTITY_ENTITY_IDS): ENTITY_VALUES_SCHEMA,
}))
def _entity_allowed(schema: ValueType, key: str) \
-> Union[bool, None]:
"""Test if an entity is allowed based on the keys."""
if schema is None or isinstance(schema, bool):
return schema
assert isinstance(schema, dict)
return schema.get(key)
def _lookup_domain(perm_lookup: PermissionLookup,
domains_dict: SubCategoryDict,
entity_id: str) -> Optional[ValueType]:
"""Look up entity permissions by domain."""
return domains_dict.get(entity_id.split(".", 1)[0])
def _lookup_area(perm_lookup: PermissionLookup, area_dict: SubCategoryDict,
entity_id: str) -> Optional[ValueType]:
"""Look up entity permissions by area."""
entity_entry = perm_lookup.entity_registry.async_get(entity_id)
if entity_entry is None or entity_entry.device_id is None:
return None
device_entry = perm_lookup.device_registry.async_get(
entity_entry.device_id
)
if device_entry is None or device_entry.area_id is None:
return None
return area_dict.get(device_entry.area_id)
def _lookup_device(perm_lookup: PermissionLookup,
devices_dict: SubCategoryDict,
entity_id: str) -> Optional[ValueType]:
"""Look up entity permissions by device."""
entity_entry = perm_lookup.entity_registry.async_get(entity_id)
if entity_entry is None or entity_entry.device_id is None:
return None
return devices_dict.get(entity_entry.device_id)
def _lookup_entity_id(perm_lookup: PermissionLookup,
entities_dict: SubCategoryDict,
entity_id: str) -> Optional[ValueType]:
"""Look up entity permission by entity id."""
return entities_dict.get(entity_id)
def compile_entities(policy: CategoryType, perm_lookup: PermissionLookup) \
-> Callable[[str, str], bool]:
"""Compile policy into a function that tests policy."""
# None, Empty Dict, False
if not policy:
def apply_policy_deny_all(entity_id: str, key: str) -> bool:
"""Decline all."""
return False
subcategories = OrderedDict() # type: SubCatLookupType
subcategories[ENTITY_ENTITY_IDS] = _lookup_entity_id
subcategories[ENTITY_DEVICE_IDS] = _lookup_device
subcategories[ENTITY_AREAS] = _lookup_area
subcategories[ENTITY_DOMAINS] = _lookup_domain
subcategories[SUBCAT_ALL] = lookup_all
return apply_policy_deny_all
if policy is True:
def apply_policy_allow_all(entity_id: str, key: str) -> bool:
"""Approve all."""
return True
return apply_policy_allow_all
assert isinstance(policy, dict)
domains = policy.get(ENTITY_DOMAINS)
device_ids = policy.get(ENTITY_DEVICE_IDS)
entity_ids = policy.get(ENTITY_ENTITY_IDS)
all_entities = policy.get(SUBCAT_ALL)
funcs = [] # type: List[Callable[[str, str], Union[None, bool]]]
# The order of these functions matter. The more precise are at the top.
# If a function returns None, they cannot handle it.
# If a function returns a boolean, that's the result to return.
# Setting entity_ids to a boolean is final decision for permissions
# So return right away.
if isinstance(entity_ids, bool):
def allowed_entity_id_bool(entity_id: str, key: str) -> bool:
"""Test if allowed entity_id."""
return entity_ids # type: ignore
return allowed_entity_id_bool
if entity_ids is not None:
def allowed_entity_id_dict(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed entity_id."""
return _entity_allowed(
entity_ids.get(entity_id), key) # type: ignore
funcs.append(allowed_entity_id_dict)
if isinstance(device_ids, bool):
def allowed_device_id_bool(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed device_id."""
return device_ids
funcs.append(allowed_device_id_bool)
elif device_ids is not None:
def allowed_device_id_dict(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed device_id."""
entity_entry = perm_lookup.entity_registry.async_get(entity_id)
if entity_entry is None or entity_entry.device_id is None:
return None
return _entity_allowed(
device_ids.get(entity_entry.device_id), key # type: ignore
)
funcs.append(allowed_device_id_dict)
if isinstance(domains, bool):
def allowed_domain_bool(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed domain."""
return domains
funcs.append(allowed_domain_bool)
elif domains is not None:
def allowed_domain_dict(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed domain."""
domain = entity_id.split(".", 1)[0]
return _entity_allowed(domains.get(domain), key) # type: ignore
funcs.append(allowed_domain_dict)
if isinstance(all_entities, bool):
def allowed_all_entities_bool(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed domain."""
return all_entities
funcs.append(allowed_all_entities_bool)
elif all_entities is not None:
def allowed_all_entities_dict(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed domain."""
return _entity_allowed(all_entities, key)
funcs.append(allowed_all_entities_dict)
# Can happen if no valid subcategories specified
if not funcs:
def apply_policy_deny_all_2(entity_id: str, key: str) -> bool:
"""Decline all."""
return False
return apply_policy_deny_all_2
if len(funcs) == 1:
func = funcs[0]
@wraps(func)
def apply_policy_func(entity_id: str, key: str) -> bool:
"""Apply a single policy function."""
return func(entity_id, key) is True
return apply_policy_func
def apply_policy_funcs(entity_id: str, key: str) -> bool:
"""Apply several policy functions."""
for func in funcs:
result = func(entity_id, key)
if result is not None:
return result
return False
return apply_policy_funcs
return compile_policy(policy, subcategories, perm_lookup)

View File

@@ -8,6 +8,9 @@ if TYPE_CHECKING:
from homeassistant.helpers import ( # noqa
entity_registry as ent_reg,
)
from homeassistant.helpers import ( # noqa
device_registry as dev_reg,
)
@attr.s(slots=True)
@@ -15,3 +18,4 @@ class PermissionLookup:
"""Class to hold data for permission lookups."""
entity_registry = attr.ib(type='ent_reg.EntityRegistry')
device_registry = attr.ib(type='dev_reg.DeviceRegistry')

View File

@@ -5,6 +5,10 @@ ADMIN_POLICY = {
CAT_ENTITIES: True,
}
USER_POLICY = {
CAT_ENTITIES: True,
}
READ_ONLY_POLICY = {
CAT_ENTITIES: {
SUBCAT_ALL: {

View File

@@ -10,9 +10,11 @@ ValueType = Union[
None
]
# Example: entities.domains = { light: … }
SubCategoryDict = Mapping[str, ValueType]
SubCategoryType = Union[
# Example: entities.domains = { light: … }
Mapping[str, ValueType],
SubCategoryDict,
bool,
None
]

View File

@@ -0,0 +1,112 @@
"""Helpers to deal with permissions."""
from functools import wraps
from typing import Callable, Dict, List, Optional, Union, cast # noqa: F401
from .const import SUBCAT_ALL
from .models import PermissionLookup
from .types import CategoryType, SubCategoryDict, ValueType
LookupFunc = Callable[[PermissionLookup, SubCategoryDict, str],
Optional[ValueType]]
SubCatLookupType = Dict[str, LookupFunc]
def lookup_all(perm_lookup: PermissionLookup, lookup_dict: SubCategoryDict,
object_id: str) -> ValueType:
"""Look up permission for all."""
# In case of ALL category, lookup_dict IS the schema.
return cast(ValueType, lookup_dict)
def compile_policy(
policy: CategoryType, subcategories: SubCatLookupType,
perm_lookup: PermissionLookup
) -> Callable[[str, str], bool]: # noqa
"""Compile policy into a function that tests policy.
Subcategories are mapping key -> lookup function, ordered by highest
priority first.
"""
# None, False, empty dict
if not policy:
def apply_policy_deny_all(entity_id: str, key: str) -> bool:
"""Decline all."""
return False
return apply_policy_deny_all
if policy is True:
def apply_policy_allow_all(entity_id: str, key: str) -> bool:
"""Approve all."""
return True
return apply_policy_allow_all
assert isinstance(policy, dict)
funcs = [] # type: List[Callable[[str, str], Union[None, bool]]]
for key, lookup_func in subcategories.items():
lookup_value = policy.get(key)
# If any lookup value is `True`, it will always be positive
if isinstance(lookup_value, bool):
return lambda object_id, key: True
if lookup_value is not None:
funcs.append(_gen_dict_test_func(
perm_lookup, lookup_func, lookup_value))
if len(funcs) == 1:
func = funcs[0]
@wraps(func)
def apply_policy_func(object_id: str, key: str) -> bool:
"""Apply a single policy function."""
return func(object_id, key) is True
return apply_policy_func
def apply_policy_funcs(object_id: str, key: str) -> bool:
"""Apply several policy functions."""
for func in funcs:
result = func(object_id, key)
if result is not None:
return result
return False
return apply_policy_funcs
def _gen_dict_test_func(
perm_lookup: PermissionLookup,
lookup_func: LookupFunc,
lookup_dict: SubCategoryDict
) -> Callable[[str, str], Optional[bool]]: # noqa
"""Generate a lookup function."""
def test_value(object_id: str, key: str) -> Optional[bool]:
"""Test if permission is allowed based on the keys."""
schema = lookup_func(
perm_lookup, lookup_dict, object_id) # type: ValueType
if schema is None or isinstance(schema, bool):
return schema
assert isinstance(schema, dict)
return schema.get(key)
return test_value
def test_all(policy: CategoryType, key: str) -> bool:
"""Test if a policy has an ALL access for a specific key."""
if not isinstance(policy, dict):
return bool(policy)
all_policy = policy.get(SUBCAT_ALL)
if not isinstance(all_policy, dict):
return bool(all_policy)
return all_policy.get(key, False)

View File

@@ -0,0 +1,164 @@
"""Auth provider that validates credentials via an external command."""
from typing import Any, Dict, Optional, cast
import asyncio.subprocess
import collections
import logging
import os
import voluptuous as vol
from homeassistant.exceptions import HomeAssistantError
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from ..models import Credentials, UserMeta
CONF_COMMAND = "command"
CONF_ARGS = "args"
CONF_META = "meta"
CONFIG_SCHEMA = AUTH_PROVIDER_SCHEMA.extend({
vol.Required(CONF_COMMAND): vol.All(
str,
os.path.normpath,
msg="must be an absolute path"
),
vol.Optional(CONF_ARGS, default=None): vol.Any(vol.DefaultTo(list), [str]),
vol.Optional(CONF_META, default=False): bool,
}, extra=vol.PREVENT_EXTRA)
_LOGGER = logging.getLogger(__name__)
class InvalidAuthError(HomeAssistantError):
"""Raised when authentication with given credentials fails."""
@AUTH_PROVIDERS.register("command_line")
class CommandLineAuthProvider(AuthProvider):
"""Auth provider validating credentials by calling a command."""
DEFAULT_TITLE = "Command Line Authentication"
# which keys to accept from a program's stdout
ALLOWED_META_KEYS = ("name",)
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Extend parent's __init__.
Adds self._user_meta dictionary to hold the user-specific
attributes provided by external programs.
"""
super().__init__(*args, **kwargs)
self._user_meta = {} # type: Dict[str, Dict[str, Any]]
async def async_login_flow(self, context: Optional[dict]) -> LoginFlow:
"""Return a flow to login."""
return CommandLineLoginFlow(self)
async def async_validate_login(self, username: str, password: str) -> None:
"""Validate a username and password."""
env = {
"username": username,
"password": password,
}
try:
# pylint: disable=no-member
process = await asyncio.subprocess.create_subprocess_exec(
self.config[CONF_COMMAND], *self.config[CONF_ARGS],
env=env,
stdout=asyncio.subprocess.PIPE
if self.config[CONF_META] else None,
)
stdout, _ = (await process.communicate())
except OSError as err:
# happens when command doesn't exist or permission is denied
_LOGGER.error("Error while authenticating %r: %s",
username, err)
raise InvalidAuthError
if process.returncode != 0:
_LOGGER.error("User %r failed to authenticate, command exited "
"with code %d.",
username, process.returncode)
raise InvalidAuthError
if self.config[CONF_META]:
meta = {} # type: Dict[str, str]
for _line in stdout.splitlines():
try:
line = _line.decode().lstrip()
if line.startswith("#"):
continue
key, value = line.split("=", 1)
except ValueError:
# malformed line
continue
key = key.strip()
value = value.strip()
if key in self.ALLOWED_META_KEYS:
meta[key] = value
self._user_meta[username] = meta
async def async_get_or_create_credentials(
self, flow_result: Dict[str, str]
) -> Credentials:
"""Get credentials based on the flow result."""
username = flow_result["username"]
for credential in await self.async_credentials():
if credential.data["username"] == username:
return credential
# Create new credentials.
return self.async_create_credentials({
"username": username,
})
async def async_user_meta_for_credentials(
self, credentials: Credentials
) -> UserMeta:
"""Return extra user metadata for credentials.
Currently, only name is supported.
"""
meta = self._user_meta.get(credentials.data["username"], {})
return UserMeta(
name=meta.get("name"),
is_active=True,
)
class CommandLineLoginFlow(LoginFlow):
"""Handler for the login flow."""
async def async_step_init(
self, user_input: Optional[Dict[str, str]] = None
) -> Dict[str, Any]:
"""Handle the step of the form."""
errors = {}
if user_input is not None:
user_input["username"] = user_input["username"].strip()
try:
await cast(CommandLineAuthProvider, self._auth_provider) \
.async_validate_login(
user_input["username"], user_input["password"]
)
except InvalidAuthError:
errors["base"] = "invalid_auth"
if not errors:
user_input.pop("password")
return await self.async_finish(user_input)
schema = collections.OrderedDict() # type: Dict[str, type]
schema["username"] = str
schema["password"] = str
return self.async_show_form(
step_id="init",
data_schema=vol.Schema(schema),
errors=errors,
)

View File

@@ -1,8 +1,10 @@
"""Home Assistant auth provider."""
import asyncio
import base64
from collections import OrderedDict
import logging
from typing import Any, Dict, List, Optional, cast
from typing import Any, Dict, List, Optional, Set, cast # noqa: F401
import bcrypt
import voluptuous as vol
@@ -52,6 +54,9 @@ class Data:
self._store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY,
private=True)
self._data = None # type: Optional[Dict[str, Any]]
# Legacy mode will allow usernames to start/end with whitespace
# and will compare usernames case-insensitive.
# Remove in 2020 or when we launch 1.0.
self.is_legacy = False
@callback
@@ -60,7 +65,7 @@ class Data:
if self.is_legacy:
return username
return username.strip()
return username.strip().casefold()
async def async_load(self) -> None:
"""Load stored data."""
@@ -71,9 +76,26 @@ class Data:
'users': []
}
seen = set() # type: Set[str]
for user in data['users']:
username = user['username']
# check if we have duplicates
folded = username.casefold()
if folded in seen:
self.is_legacy = True
logging.getLogger(__name__).warning(
"Home Assistant auth provider is running in legacy mode "
"because we detected usernames that are case-insensitive"
"equivalent. Please change the username: '%s'.", username)
break
seen.add(folded)
# check if we have unstripped usernames
if username != username.strip():
self.is_legacy = True
@@ -81,7 +103,7 @@ class Data:
logging.getLogger(__name__).warning(
"Home Assistant auth provider is running in legacy mode "
"because we detected usernames that start or end in a "
"space. Please change the username.")
"space. Please change the username: '%s'.", username)
break
@@ -103,7 +125,7 @@ class Data:
# Compare all users to avoid timing attacks.
for user in self.users:
if username == user['username']:
if self.normalize_username(user['username']) == username:
found = user
if found is None:
@@ -183,15 +205,21 @@ class HassAuthProvider(AuthProvider):
DEFAULT_TITLE = 'Home Assistant Local'
data = None
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Initialize an Home Assistant auth provider."""
super().__init__(*args, **kwargs)
self.data = None # type: Optional[Data]
self._init_lock = asyncio.Lock()
async def async_initialize(self) -> None:
"""Initialize the auth provider."""
if self.data is not None:
return
async with self._init_lock:
if self.data is not None:
return
self.data = Data(self.hass)
await self.data.async_load()
data = Data(self.hass)
await data.async_load()
self.data = data
async def async_login_flow(
self, context: Optional[Dict]) -> LoginFlow:

View File

@@ -4,27 +4,23 @@ Support Legacy API password auth provider.
It will be removed when auth system production ready
"""
import hmac
from typing import Any, Dict, Optional, cast, TYPE_CHECKING
from typing import Any, Dict, Optional, cast
import voluptuous as vol
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
import homeassistant.helpers.config_validation as cv
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from .. import AuthManager
from ..models import Credentials, UserMeta, User
if TYPE_CHECKING:
from homeassistant.components.http import HomeAssistantHTTP # noqa: F401
USER_SCHEMA = vol.Schema({
vol.Required('username'): str,
})
AUTH_PROVIDER_TYPE = 'legacy_api_password'
CONF_API_PASSWORD = 'api_password'
CONFIG_SCHEMA = AUTH_PROVIDER_SCHEMA.extend({
vol.Required(CONF_API_PASSWORD): cv.string,
}, extra=vol.PREVENT_EXTRA)
LEGACY_USER_NAME = 'Legacy API password user'
@@ -34,40 +30,45 @@ class InvalidAuthError(HomeAssistantError):
"""Raised when submitting invalid authentication."""
async def async_get_user(hass: HomeAssistant) -> User:
"""Return the legacy API password user."""
async def async_validate_password(hass: HomeAssistant, password: str)\
-> Optional[User]:
"""Return a user if password is valid. None if not."""
auth = cast(AuthManager, hass.auth) # type: ignore
found = None
for prv in auth.auth_providers:
if prv.type == 'legacy_api_password':
found = prv
break
if found is None:
providers = auth.get_auth_providers(AUTH_PROVIDER_TYPE)
if not providers:
raise ValueError('Legacy API password provider not found')
return await auth.async_get_or_create_user(
await found.async_get_or_create_credentials({})
)
try:
provider = cast(LegacyApiPasswordAuthProvider, providers[0])
provider.async_validate_login(password)
return await auth.async_get_or_create_user(
await provider.async_get_or_create_credentials({})
)
except InvalidAuthError:
return None
@AUTH_PROVIDERS.register('legacy_api_password')
@AUTH_PROVIDERS.register(AUTH_PROVIDER_TYPE)
class LegacyApiPasswordAuthProvider(AuthProvider):
"""Example auth provider based on hardcoded usernames and passwords."""
"""An auth provider support legacy api_password."""
DEFAULT_TITLE = 'Legacy API Password'
@property
def api_password(self) -> str:
"""Return api_password."""
return str(self.config[CONF_API_PASSWORD])
async def async_login_flow(self, context: Optional[Dict]) -> LoginFlow:
"""Return a flow to login."""
return LegacyLoginFlow(self)
@callback
def async_validate_login(self, password: str) -> None:
"""Validate a username and password."""
hass_http = getattr(self.hass, 'http', None) # type: HomeAssistantHTTP
"""Validate password."""
api_password = str(self.config[CONF_API_PASSWORD])
if not hmac.compare_digest(hass_http.api_password.encode('utf-8'),
if not hmac.compare_digest(api_password.encode('utf-8'),
password.encode('utf-8')):
raise InvalidAuthError
@@ -99,12 +100,6 @@ class LegacyLoginFlow(LoginFlow):
"""Handle the step of the form."""
errors = {}
hass_http = getattr(self.hass, 'http', None)
if hass_http is None or not hass_http.api_password:
return self.async_abort(
reason='no_api_password_set'
)
if user_input is not None:
try:
cast(LegacyApiPasswordAuthProvider, self._auth_provider)\

View File

@@ -3,18 +3,41 @@
It shows list of users if access from trusted network.
Abort login flow if not access from trusted network.
"""
from typing import Any, Dict, Optional, cast
from ipaddress import ip_network, IPv4Address, IPv6Address, IPv4Network,\
IPv6Network
from typing import Any, Dict, List, Optional, Union, cast
import voluptuous as vol
from homeassistant.components.http import HomeAssistantHTTP # noqa: F401
import homeassistant.helpers.config_validation as cv
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from ..models import Credentials, UserMeta
IPAddress = Union[IPv4Address, IPv6Address]
IPNetwork = Union[IPv4Network, IPv6Network]
CONF_TRUSTED_NETWORKS = 'trusted_networks'
CONF_TRUSTED_USERS = 'trusted_users'
CONF_GROUP = 'group'
CONF_ALLOW_BYPASS_LOGIN = 'allow_bypass_login'
CONFIG_SCHEMA = AUTH_PROVIDER_SCHEMA.extend({
vol.Required(CONF_TRUSTED_NETWORKS): vol.All(
cv.ensure_list, [ip_network]
),
vol.Optional(CONF_TRUSTED_USERS, default={}): vol.Schema(
# we only validate the format of user_id or group_id
{ip_network: vol.All(
cv.ensure_list,
[vol.Or(
cv.uuid4_hex,
vol.Schema({vol.Required(CONF_GROUP): cv.uuid4_hex}),
)],
)}
),
vol.Optional(CONF_ALLOW_BYPASS_LOGIN, default=False): cv.boolean,
}, extra=vol.PREVENT_EXTRA)
@@ -35,6 +58,16 @@ class TrustedNetworksAuthProvider(AuthProvider):
DEFAULT_TITLE = 'Trusted Networks'
@property
def trusted_networks(self) -> List[IPNetwork]:
"""Return trusted networks."""
return cast(List[IPNetwork], self.config[CONF_TRUSTED_NETWORKS])
@property
def trusted_users(self) -> Dict[IPNetwork, Any]:
"""Return trusted users per network."""
return cast(Dict[IPNetwork, Any], self.config[CONF_TRUSTED_USERS])
@property
def support_mfa(self) -> bool:
"""Trusted Networks auth provider does not support MFA."""
@@ -43,13 +76,34 @@ class TrustedNetworksAuthProvider(AuthProvider):
async def async_login_flow(self, context: Optional[Dict]) -> LoginFlow:
"""Return a flow to login."""
assert context is not None
ip_addr = cast(IPAddress, context.get('ip_address'))
users = await self.store.async_get_users()
available_users = {user.id: user.name
for user in users
if not user.system_generated and user.is_active}
available_users = [user for user in users
if not user.system_generated and user.is_active]
for ip_net, user_or_group_list in self.trusted_users.items():
if ip_addr in ip_net:
user_list = [user_id for user_id in user_or_group_list
if isinstance(user_id, str)]
group_list = [group[CONF_GROUP] for group in user_or_group_list
if isinstance(group, dict)]
flattened_group_list = [group for sublist in group_list
for group in sublist]
available_users = [
user for user in available_users
if (user.id in user_list or
any([group.id in flattened_group_list
for group in user.groups]))
]
break
return TrustedNetworksLoginFlow(
self, cast(str, context.get('ip_address')), available_users)
self,
ip_addr,
{
user.id: user.name for user in available_users
},
self.config[CONF_ALLOW_BYPASS_LOGIN],
)
async def async_get_or_create_credentials(
self, flow_result: Dict[str, str]) -> Credentials:
@@ -80,19 +134,17 @@ class TrustedNetworksAuthProvider(AuthProvider):
raise NotImplementedError
@callback
def async_validate_access(self, ip_address: str) -> None:
def async_validate_access(self, ip_addr: IPAddress) -> None:
"""Make sure the access from trusted networks.
Raise InvalidAuthError if not.
Raise InvalidAuthError if trusted_networks is not configured.
"""
hass_http = getattr(self.hass, 'http', None) # type: HomeAssistantHTTP
if not hass_http or not hass_http.trusted_networks:
if not self.trusted_networks:
raise InvalidAuthError('trusted_networks is not configured')
if not any(ip_address in trusted_network for trusted_network
in hass_http.trusted_networks):
if not any(ip_addr in trusted_network for trusted_network
in self.trusted_networks):
raise InvalidAuthError('Not in trusted_networks')
@@ -100,12 +152,14 @@ class TrustedNetworksLoginFlow(LoginFlow):
"""Handler for the login flow."""
def __init__(self, auth_provider: TrustedNetworksAuthProvider,
ip_address: str, available_users: Dict[str, Optional[str]]) \
-> None:
ip_addr: IPAddress,
available_users: Dict[str, Optional[str]],
allow_bypass_login: bool) -> None:
"""Initialize the login flow."""
super().__init__(auth_provider)
self._available_users = available_users
self._ip_address = ip_address
self._ip_address = ip_addr
self._allow_bypass_login = allow_bypass_login
async def async_step_init(
self, user_input: Optional[Dict[str, str]] = None) \
@@ -123,6 +177,11 @@ class TrustedNetworksLoginFlow(LoginFlow):
if user_input is not None:
return await self.async_finish(user_input)
if self._allow_bypass_login and len(self._available_users) == 1:
return await self.async_finish({
'user': next(iter(self._available_users.keys()))
})
return self.async_show_form(
step_id='init',
data_schema=vol.Schema({'user': vol.In(self._available_users)}),

View File

@@ -1,23 +1,23 @@
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
import logging
import logging.handlers
import os
import sys
from time import time
from collections import OrderedDict
from typing import Any, Optional, Dict
from typing import Any, Optional, Dict, Set
import voluptuous as vol
from homeassistant import (
core, config as conf_util, config_entries, components as core_components)
from homeassistant.components import persistent_notification
from homeassistant import core, config as conf_util, config_entries, loader
from homeassistant.const import EVENT_HOMEASSISTANT_CLOSE
from homeassistant.setup import async_setup_component
from homeassistant.util.logging import AsyncHandler
from homeassistant.util.package import async_get_user_site, is_virtual_env
from homeassistant.util.yaml import clear_secret_cache
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv
_LOGGER = logging.getLogger(__name__)
@@ -26,40 +26,15 @@ ERROR_LOG_FILENAME = 'home-assistant.log'
# hass.data key for logging information.
DATA_LOGGING = 'logging'
FIRST_INIT_COMPONENT = {'system_log', 'recorder', 'mqtt', 'mqtt_eventstream',
'logger', 'introduction', 'frontend', 'history'}
def from_config_dict(config: Dict[str, Any],
hass: Optional[core.HomeAssistant] = None,
config_dir: Optional[str] = None,
enable_log: bool = True,
verbose: bool = False,
skip_pip: bool = False,
log_rotate_days: Any = None,
log_file: Any = None,
log_no_color: bool = False) \
-> Optional[core.HomeAssistant]:
"""Try to configure Home Assistant from a configuration dictionary.
Dynamically loads required components and its dependencies.
"""
if hass is None:
hass = core.HomeAssistant()
if config_dir is not None:
config_dir = os.path.abspath(config_dir)
hass.config.config_dir = config_dir
if not is_virtual_env():
hass.loop.run_until_complete(
async_mount_local_lib_path(config_dir))
# run task
hass = hass.loop.run_until_complete(
async_from_config_dict(
config, hass, config_dir, enable_log, verbose, skip_pip,
log_rotate_days, log_file, log_no_color)
)
return hass
DEBUGGER_INTEGRATIONS = {'ptvsd', }
CORE_INTEGRATIONS = ('homeassistant', 'persistent_notification')
LOGGING_INTEGRATIONS = {'logger', 'system_log'}
STAGE_1_INTEGRATIONS = {
# To record data
'recorder',
# To make sure we forward data to other instances
'mqtt_eventstream',
}
async def async_from_config_dict(config: Dict[str, Any],
@@ -83,14 +58,18 @@ async def async_from_config_dict(config: Dict[str, Any],
async_enable_logging(hass, verbose, log_rotate_days, log_file,
log_no_color)
hass.config.skip_pip = skip_pip
if skip_pip:
_LOGGER.warning("Skipping pip installation of required modules. "
"This may cause issues")
core_config = config.get(core.DOMAIN, {})
has_api_password = bool((config.get('http') or {}).get('api_password'))
has_trusted_networks = bool((config.get('http') or {})
.get('trusted_networks'))
api_password = config.get('http', {}).get('api_password')
trusted_networks = config.get('http', {}).get('trusted_networks')
try:
await conf_util.async_process_ha_core_config(
hass, core_config, has_api_password, has_trusted_networks)
hass, core_config, api_password, trusted_networks)
except vol.Invalid as config_err:
conf_util.async_log_exception(
config_err, 'homeassistant', core_config, hass)
@@ -100,84 +79,65 @@ async def async_from_config_dict(config: Dict[str, Any],
"Further initialization aborted")
return None
await hass.async_add_executor_job(
conf_util.process_ha_config_upgrade, hass)
hass.config.skip_pip = skip_pip
if skip_pip:
_LOGGER.warning("Skipping pip installation of required modules. "
"This may cause issues")
# Make a copy because we are mutating it.
config = OrderedDict(config)
# Merge packages
conf_util.merge_packages_config(
await conf_util.merge_packages_config(
hass, config, core_config.get(conf_util.CONF_PACKAGES, {}))
hass.config_entries = config_entries.ConfigEntries(hass, config)
await hass.config_entries.async_load()
await hass.config_entries.async_initialize()
# Filter out the repeating and common config section [homeassistant]
components = set(key.split(' ')[0] for key in config.keys()
if key != core.DOMAIN)
components.update(hass.config_entries.async_domains())
# setup components
res = await core_components.async_setup(hass, config)
if not res:
_LOGGER.error("Home Assistant core failed to initialize. "
"Further initialization aborted")
return hass
await persistent_notification.async_setup(hass, config)
_LOGGER.info("Home Assistant core initialized")
# stage 1
for component in components:
if component not in FIRST_INIT_COMPONENT:
continue
hass.async_create_task(async_setup_component(hass, component, config))
await hass.async_block_till_done()
# stage 2
for component in components:
if component in FIRST_INIT_COMPONENT:
continue
hass.async_create_task(async_setup_component(hass, component, config))
await hass.async_block_till_done()
await _async_set_up_integrations(hass, config)
stop = time()
_LOGGER.info("Home Assistant initialized in %.2fs", stop-start)
return hass
# TEMP: warn users for invalid slugs
# Remove after 0.94 or 1.0
if cv.INVALID_SLUGS_FOUND or cv.INVALID_ENTITY_IDS_FOUND:
msg = []
if cv.INVALID_ENTITY_IDS_FOUND:
msg.append(
"Your configuration contains invalid entity ID references. "
"Please find and update the following. "
"This will become a breaking change."
)
msg.append('\n'.join('- {} -> {}'.format(*item)
for item
in cv.INVALID_ENTITY_IDS_FOUND.items()))
def from_config_file(config_path: str,
hass: Optional[core.HomeAssistant] = None,
verbose: bool = False,
skip_pip: bool = True,
log_rotate_days: Any = None,
log_file: Any = None,
log_no_color: bool = False)\
-> Optional[core.HomeAssistant]:
"""Read the configuration file and try to start all the functionality.
if cv.INVALID_SLUGS_FOUND:
msg.append(
"Your configuration contains invalid slugs. "
"Please find and update the following. "
"This will become a breaking change."
)
msg.append('\n'.join('- {} -> {}'.format(*item)
for item in cv.INVALID_SLUGS_FOUND.items()))
Will add functionality to 'hass' parameter if given,
instantiates a new Home Assistant object if 'hass' is not given.
"""
if hass is None:
hass = core.HomeAssistant()
hass.components.persistent_notification.async_create(
'\n\n'.join(msg), "Config Warning", "config_warning"
)
# run task
hass = hass.loop.run_until_complete(
async_from_config_file(
config_path, hass, verbose, skip_pip,
log_rotate_days, log_file, log_no_color)
)
# TEMP: warn users of invalid extra keys
# Remove after 0.92
if cv.INVALID_EXTRA_KEYS_FOUND:
msg = []
msg.append(
"Your configuration contains extra keys "
"that the platform does not support (but were silently "
"accepted before 0.88). Please find and remove the following."
"This will become a breaking change."
)
msg.append('\n'.join('- {}'.format(it)
for it in cv.INVALID_EXTRA_KEYS_FOUND))
hass.components.persistent_notification.async_create(
'\n\n'.join(msg), "Config Warning", "config_warning"
)
return hass
@@ -205,6 +165,9 @@ async def async_from_config_file(config_path: str,
async_enable_logging(hass, verbose, log_rotate_days, log_file,
log_no_color)
await hass.async_add_executor_job(
conf_util.process_ha_config_upgrade, hass)
try:
config_dict = await hass.async_add_executor_job(
conf_util.load_yaml_config_file, config_path)
@@ -320,3 +283,139 @@ async def async_mount_local_lib_path(config_dir: str) -> str:
if lib_dir not in sys.path:
sys.path.insert(0, lib_dir)
return deps_dir
@core.callback
def _get_domains(hass: core.HomeAssistant, config: Dict[str, Any]) -> Set[str]:
"""Get domains of components to set up."""
# Filter out the repeating and common config section [homeassistant]
domains = set(key.split(' ')[0] for key in config.keys()
if key != core.DOMAIN)
# Add config entry domains
domains.update(hass.config_entries.async_domains()) # type: ignore
# Make sure the Hass.io component is loaded
if 'HASSIO' in os.environ:
domains.add('hassio')
return domains
async def _async_set_up_integrations(
hass: core.HomeAssistant, config: Dict[str, Any]) -> None:
"""Set up all the integrations."""
domains = _get_domains(hass, config)
# Start up debuggers. Start these first in case they want to wait.
debuggers = domains & DEBUGGER_INTEGRATIONS
if debuggers:
_LOGGER.debug("Starting up debuggers %s", debuggers)
await asyncio.gather(*[
async_setup_component(hass, domain, config)
for domain in debuggers])
domains -= DEBUGGER_INTEGRATIONS
# Resolve all dependencies of all components so we can find the logging
# and integrations that need faster initialization.
resolved_domains_task = asyncio.gather(*[
loader.async_component_dependencies(hass, domain)
for domain in domains
], return_exceptions=True)
# Set up core.
_LOGGER.debug("Setting up %s", CORE_INTEGRATIONS)
if not all(await asyncio.gather(*[
async_setup_component(hass, domain, config)
for domain in CORE_INTEGRATIONS
])):
_LOGGER.error("Home Assistant core failed to initialize. "
"Further initialization aborted")
return
_LOGGER.debug("Home Assistant core initialized")
# Finish resolving domains
for dep_domains in await resolved_domains_task:
# Result is either a set or an exception. We ignore exceptions
# It will be properly handled during setup of the domain.
if isinstance(dep_domains, set):
domains.update(dep_domains)
# setup components
logging_domains = domains & LOGGING_INTEGRATIONS
stage_1_domains = domains & STAGE_1_INTEGRATIONS
stage_2_domains = domains - logging_domains - stage_1_domains
if logging_domains:
_LOGGER.info("Setting up %s", logging_domains)
await asyncio.gather(*[
async_setup_component(hass, domain, config)
for domain in logging_domains
])
# Kick off loading the registries. They don't need to be awaited.
asyncio.gather(
hass.helpers.device_registry.async_get_registry(),
hass.helpers.entity_registry.async_get_registry(),
hass.helpers.area_registry.async_get_registry())
if stage_1_domains:
await asyncio.gather(*[
async_setup_component(hass, domain, config)
for domain in stage_1_domains
])
# Load all integrations
after_dependencies = {} # type: Dict[str, Set[str]]
for int_or_exc in await asyncio.gather(*[
loader.async_get_integration(hass, domain)
for domain in stage_2_domains
], return_exceptions=True):
# Exceptions are handled in async_setup_component.
if (isinstance(int_or_exc, loader.Integration) and
int_or_exc.after_dependencies):
after_dependencies[int_or_exc.domain] = set(
int_or_exc.after_dependencies
)
last_load = None
while stage_2_domains:
domains_to_load = set()
for domain in stage_2_domains:
after_deps = after_dependencies.get(domain)
# Load if integration has no after_dependencies or they are
# all loaded
if (not after_deps or
not after_deps-hass.config.components):
domains_to_load.add(domain)
if not domains_to_load or domains_to_load == last_load:
break
_LOGGER.debug("Setting up %s", domains_to_load)
await asyncio.gather(*[
async_setup_component(hass, domain, config)
for domain in domains_to_load
])
last_load = domains_to_load
stage_2_domains -= domains_to_load
# These are stage 2 domains that never have their after_dependencies
# satisfied.
if stage_2_domains:
_LOGGER.debug("Final set up: %s", stage_2_domains)
await asyncio.gather(*[
async_setup_component(hass, domain, config)
for domain in stage_2_domains
])
# Wrap up startup
await hass.async_block_till_done()

View File

@@ -7,33 +7,12 @@ Component design guidelines:
format "<DOMAIN>.<OBJECT_ID>".
- Each component should publish services only under its own domain.
"""
import asyncio
import itertools as it
import logging
from typing import Awaitable
import voluptuous as vol
import homeassistant.core as ha
import homeassistant.config as conf_util
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.service import extract_entity_ids
from homeassistant.helpers import intent
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE,
SERVICE_HOMEASSISTANT_STOP, SERVICE_HOMEASSISTANT_RESTART,
RESTART_EXIT_CODE)
from homeassistant.helpers import config_validation as cv
from homeassistant.core import split_entity_id
_LOGGER = logging.getLogger(__name__)
SERVICE_RELOAD_CORE_CONFIG = 'reload_core_config'
SERVICE_CHECK_CONFIG = 'check_config'
SERVICE_UPDATE_ENTITY = 'update_entity'
SCHEMA_UPDATE_ENTITY = vol.Schema({
ATTR_ENTITY_ID: cv.entity_ids
})
def is_on(hass, entity_id=None):
"""Load up the module to call the is_on method.
@@ -46,7 +25,7 @@ def is_on(hass, entity_id=None):
entity_ids = hass.states.entity_ids()
for ent_id in entity_ids:
domain = ha.split_entity_id(ent_id)[0]
domain = split_entity_id(ent_id)[0]
try:
component = getattr(hass.components, domain)
@@ -64,112 +43,3 @@ def is_on(hass, entity_id=None):
return True
return False
async def async_setup(hass: ha.HomeAssistant, config: dict) -> Awaitable[bool]:
"""Set up general services related to Home Assistant."""
async def async_handle_turn_service(service):
"""Handle calls to homeassistant.turn_on/off."""
entity_ids = extract_entity_ids(hass, service)
# Generic turn on/off method requires entity id
if not entity_ids:
_LOGGER.error(
"homeassistant/%s cannot be called without entity_id",
service.service)
return
# Group entity_ids by domain. groupby requires sorted data.
by_domain = it.groupby(sorted(entity_ids),
lambda item: ha.split_entity_id(item)[0])
tasks = []
for domain, ent_ids in by_domain:
# We want to block for all calls and only return when all calls
# have been processed. If a service does not exist it causes a 10
# second delay while we're blocking waiting for a response.
# But services can be registered on other HA instances that are
# listening to the bus too. So as an in between solution, we'll
# block only if the service is defined in the current HA instance.
blocking = hass.services.has_service(domain, service.service)
# Create a new dict for this call
data = dict(service.data)
# ent_ids is a generator, convert it to a list.
data[ATTR_ENTITY_ID] = list(ent_ids)
tasks.append(hass.services.async_call(
domain, service.service, data, blocking))
await asyncio.wait(tasks, loop=hass.loop)
hass.services.async_register(
ha.DOMAIN, SERVICE_TURN_OFF, async_handle_turn_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_TURN_ON, async_handle_turn_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_TOGGLE, async_handle_turn_service)
hass.helpers.intent.async_register(intent.ServiceIntentHandler(
intent.INTENT_TURN_ON, ha.DOMAIN, SERVICE_TURN_ON, "Turned {} on"))
hass.helpers.intent.async_register(intent.ServiceIntentHandler(
intent.INTENT_TURN_OFF, ha.DOMAIN, SERVICE_TURN_OFF,
"Turned {} off"))
hass.helpers.intent.async_register(intent.ServiceIntentHandler(
intent.INTENT_TOGGLE, ha.DOMAIN, SERVICE_TOGGLE, "Toggled {}"))
async def async_handle_core_service(call):
"""Service handler for handling core services."""
if call.service == SERVICE_HOMEASSISTANT_STOP:
hass.async_create_task(hass.async_stop())
return
try:
errors = await conf_util.async_check_ha_config_file(hass)
except HomeAssistantError:
return
if errors:
_LOGGER.error(errors)
hass.components.persistent_notification.async_create(
"Config error. See dev-info panel for details.",
"Config validating", "{0}.check_config".format(ha.DOMAIN))
return
if call.service == SERVICE_HOMEASSISTANT_RESTART:
hass.async_create_task(hass.async_stop(RESTART_EXIT_CODE))
async def async_handle_update_service(call):
"""Service handler for updating an entity."""
tasks = [hass.helpers.entity_component.async_update_entity(entity)
for entity in call.data[ATTR_ENTITY_ID]]
if tasks:
await asyncio.wait(tasks)
hass.services.async_register(
ha.DOMAIN, SERVICE_HOMEASSISTANT_STOP, async_handle_core_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_HOMEASSISTANT_RESTART, async_handle_core_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_CHECK_CONFIG, async_handle_core_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_UPDATE_ENTITY, async_handle_update_service,
schema=SCHEMA_UPDATE_ENTITY)
async def async_handle_reload_config(call):
"""Service handler for reloading core config."""
try:
conf = await conf_util.async_hass_config_yaml(hass)
except HomeAssistantError as err:
_LOGGER.error(err)
return
await conf_util.async_process_ha_core_config(
hass, conf.get(ha.DOMAIN) or {})
hass.services.async_register(
ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG, async_handle_reload_config)
return True

View File

@@ -1,344 +0,0 @@
"""
This component provides basic support for Abode Home Security system.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/abode/
"""
import logging
from functools import partial
from requests.exceptions import HTTPError, ConnectTimeout
import voluptuous as vol
from homeassistant.const import (
ATTR_ATTRIBUTION, ATTR_DATE, ATTR_TIME, ATTR_ENTITY_ID, CONF_USERNAME,
CONF_PASSWORD, CONF_EXCLUDE, CONF_NAME, CONF_LIGHTS,
EVENT_HOMEASSISTANT_STOP, EVENT_HOMEASSISTANT_START)
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import discovery
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['abodepy==0.15.0']
_LOGGER = logging.getLogger(__name__)
CONF_ATTRIBUTION = "Data provided by goabode.com"
CONF_POLLING = 'polling'
DOMAIN = 'abode'
DEFAULT_CACHEDB = './abodepy_cache.pickle'
NOTIFICATION_ID = 'abode_notification'
NOTIFICATION_TITLE = 'Abode Security Setup'
EVENT_ABODE_ALARM = 'abode_alarm'
EVENT_ABODE_ALARM_END = 'abode_alarm_end'
EVENT_ABODE_AUTOMATION = 'abode_automation'
EVENT_ABODE_FAULT = 'abode_panel_fault'
EVENT_ABODE_RESTORE = 'abode_panel_restore'
SERVICE_SETTINGS = 'change_setting'
SERVICE_CAPTURE_IMAGE = 'capture_image'
SERVICE_TRIGGER = 'trigger_quick_action'
ATTR_DEVICE_ID = 'device_id'
ATTR_DEVICE_NAME = 'device_name'
ATTR_DEVICE_TYPE = 'device_type'
ATTR_EVENT_CODE = 'event_code'
ATTR_EVENT_NAME = 'event_name'
ATTR_EVENT_TYPE = 'event_type'
ATTR_EVENT_UTC = 'event_utc'
ATTR_SETTING = 'setting'
ATTR_USER_NAME = 'user_name'
ATTR_VALUE = 'value'
ABODE_DEVICE_ID_LIST_SCHEMA = vol.Schema([str])
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_NAME): cv.string,
vol.Optional(CONF_POLLING, default=False): cv.boolean,
vol.Optional(CONF_EXCLUDE, default=[]): ABODE_DEVICE_ID_LIST_SCHEMA,
vol.Optional(CONF_LIGHTS, default=[]): ABODE_DEVICE_ID_LIST_SCHEMA
}),
}, extra=vol.ALLOW_EXTRA)
CHANGE_SETTING_SCHEMA = vol.Schema({
vol.Required(ATTR_SETTING): cv.string,
vol.Required(ATTR_VALUE): cv.string
})
CAPTURE_IMAGE_SCHEMA = vol.Schema({
ATTR_ENTITY_ID: cv.entity_ids,
})
TRIGGER_SCHEMA = vol.Schema({
ATTR_ENTITY_ID: cv.entity_ids,
})
ABODE_PLATFORMS = [
'alarm_control_panel', 'binary_sensor', 'lock', 'switch', 'cover',
'camera', 'light', 'sensor'
]
class AbodeSystem:
"""Abode System class."""
def __init__(self, username, password, cache,
name, polling, exclude, lights):
"""Initialize the system."""
import abodepy
self.abode = abodepy.Abode(
username, password, auto_login=True, get_devices=True,
get_automations=True, cache_path=cache)
self.name = name
self.polling = polling
self.exclude = exclude
self.lights = lights
self.devices = []
def is_excluded(self, device):
"""Check if a device is configured to be excluded."""
return device.device_id in self.exclude
def is_automation_excluded(self, automation):
"""Check if an automation is configured to be excluded."""
return automation.automation_id in self.exclude
def is_light(self, device):
"""Check if a switch device is configured as a light."""
import abodepy.helpers.constants as CONST
return (device.generic_type == CONST.TYPE_LIGHT or
(device.generic_type == CONST.TYPE_SWITCH and
device.device_id in self.lights))
def setup(hass, config):
"""Set up Abode component."""
from abodepy.exceptions import AbodeException
conf = config[DOMAIN]
username = conf.get(CONF_USERNAME)
password = conf.get(CONF_PASSWORD)
name = conf.get(CONF_NAME)
polling = conf.get(CONF_POLLING)
exclude = conf.get(CONF_EXCLUDE)
lights = conf.get(CONF_LIGHTS)
try:
cache = hass.config.path(DEFAULT_CACHEDB)
hass.data[DOMAIN] = AbodeSystem(
username, password, cache, name, polling, exclude, lights)
except (AbodeException, ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Abode: %s", str(ex))
hass.components.persistent_notification.create(
'Error: {}<br />'
'You will need to restart hass after fixing.'
''.format(ex),
title=NOTIFICATION_TITLE,
notification_id=NOTIFICATION_ID)
return False
setup_hass_services(hass)
setup_hass_events(hass)
setup_abode_events(hass)
for platform in ABODE_PLATFORMS:
discovery.load_platform(hass, platform, DOMAIN, {}, config)
return True
def setup_hass_services(hass):
"""Home assistant services."""
from abodepy.exceptions import AbodeException
def change_setting(call):
"""Change an Abode system setting."""
setting = call.data.get(ATTR_SETTING)
value = call.data.get(ATTR_VALUE)
try:
hass.data[DOMAIN].abode.set_setting(setting, value)
except AbodeException as ex:
_LOGGER.warning(ex)
def capture_image(call):
"""Capture a new image."""
entity_ids = call.data.get(ATTR_ENTITY_ID)
target_devices = [device for device in hass.data[DOMAIN].devices
if device.entity_id in entity_ids]
for device in target_devices:
device.capture()
def trigger_quick_action(call):
"""Trigger a quick action."""
entity_ids = call.data.get(ATTR_ENTITY_ID, None)
target_devices = [device for device in hass.data[DOMAIN].devices
if device.entity_id in entity_ids]
for device in target_devices:
device.trigger()
hass.services.register(
DOMAIN, SERVICE_SETTINGS, change_setting,
schema=CHANGE_SETTING_SCHEMA)
hass.services.register(
DOMAIN, SERVICE_CAPTURE_IMAGE, capture_image,
schema=CAPTURE_IMAGE_SCHEMA)
hass.services.register(
DOMAIN, SERVICE_TRIGGER, trigger_quick_action,
schema=TRIGGER_SCHEMA)
def setup_hass_events(hass):
"""Home Assistant start and stop callbacks."""
def startup(event):
"""Listen for push events."""
hass.data[DOMAIN].abode.events.start()
def logout(event):
"""Logout of Abode."""
if not hass.data[DOMAIN].polling:
hass.data[DOMAIN].abode.events.stop()
hass.data[DOMAIN].abode.logout()
_LOGGER.info("Logged out of Abode")
if not hass.data[DOMAIN].polling:
hass.bus.listen_once(EVENT_HOMEASSISTANT_START, startup)
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, logout)
def setup_abode_events(hass):
"""Event callbacks."""
import abodepy.helpers.timeline as TIMELINE
def event_callback(event, event_json):
"""Handle an event callback from Abode."""
data = {
ATTR_DEVICE_ID: event_json.get(ATTR_DEVICE_ID, ''),
ATTR_DEVICE_NAME: event_json.get(ATTR_DEVICE_NAME, ''),
ATTR_DEVICE_TYPE: event_json.get(ATTR_DEVICE_TYPE, ''),
ATTR_EVENT_CODE: event_json.get(ATTR_EVENT_CODE, ''),
ATTR_EVENT_NAME: event_json.get(ATTR_EVENT_NAME, ''),
ATTR_EVENT_TYPE: event_json.get(ATTR_EVENT_TYPE, ''),
ATTR_EVENT_UTC: event_json.get(ATTR_EVENT_UTC, ''),
ATTR_USER_NAME: event_json.get(ATTR_USER_NAME, ''),
ATTR_DATE: event_json.get(ATTR_DATE, ''),
ATTR_TIME: event_json.get(ATTR_TIME, ''),
}
hass.bus.fire(event, data)
events = [TIMELINE.ALARM_GROUP, TIMELINE.ALARM_END_GROUP,
TIMELINE.PANEL_FAULT_GROUP, TIMELINE.PANEL_RESTORE_GROUP,
TIMELINE.AUTOMATION_GROUP]
for event in events:
hass.data[DOMAIN].abode.events.add_event_callback(
event,
partial(event_callback, event))
class AbodeDevice(Entity):
"""Representation of an Abode device."""
def __init__(self, data, device):
"""Initialize a sensor for Abode device."""
self._data = data
self._device = device
async def async_added_to_hass(self):
"""Subscribe Abode events."""
self.hass.async_add_job(
self._data.abode.events.add_device_callback,
self._device.device_id, self._update_callback
)
@property
def should_poll(self):
"""Return the polling state."""
return self._data.polling
def update(self):
"""Update automation state."""
self._device.refresh()
@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,
'device_type': self._device.type
}
def _update_callback(self, device):
"""Update the device state."""
self.schedule_update_ha_state()
class AbodeAutomation(Entity):
"""Representation of an Abode automation."""
def __init__(self, data, automation, event=None):
"""Initialize for Abode automation."""
self._data = data
self._automation = automation
self._event = event
async def async_added_to_hass(self):
"""Subscribe Abode events."""
if self._event:
self.hass.async_add_job(
self._data.abode.events.add_event_callback,
self._event, self._update_callback
)
@property
def should_poll(self):
"""Return the polling state."""
return self._data.polling
def update(self):
"""Update automation state."""
self._automation.refresh()
@property
def name(self):
"""Return the name of the sensor."""
return self._automation.name
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
'automation_id': self._automation.automation_id,
'type': self._automation.type,
'sub_type': self._automation.sub_type
}
def _update_callback(self, device):
"""Update the device state."""
self._automation.refresh()
self.schedule_update_ha_state()

View File

@@ -0,0 +1,338 @@
"""Support for Abode Home Security system."""
import logging
from functools import partial
from requests.exceptions import HTTPError, ConnectTimeout
import voluptuous as vol
from homeassistant.const import (
ATTR_ATTRIBUTION, ATTR_DATE, ATTR_TIME, ATTR_ENTITY_ID, CONF_USERNAME,
CONF_PASSWORD, CONF_EXCLUDE, CONF_NAME, CONF_LIGHTS,
EVENT_HOMEASSISTANT_STOP, EVENT_HOMEASSISTANT_START)
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import discovery
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
ATTRIBUTION = "Data provided by goabode.com"
CONF_POLLING = 'polling'
DOMAIN = 'abode'
DEFAULT_CACHEDB = './abodepy_cache.pickle'
NOTIFICATION_ID = 'abode_notification'
NOTIFICATION_TITLE = 'Abode Security Setup'
EVENT_ABODE_ALARM = 'abode_alarm'
EVENT_ABODE_ALARM_END = 'abode_alarm_end'
EVENT_ABODE_AUTOMATION = 'abode_automation'
EVENT_ABODE_FAULT = 'abode_panel_fault'
EVENT_ABODE_RESTORE = 'abode_panel_restore'
SERVICE_SETTINGS = 'change_setting'
SERVICE_CAPTURE_IMAGE = 'capture_image'
SERVICE_TRIGGER = 'trigger_quick_action'
ATTR_DEVICE_ID = 'device_id'
ATTR_DEVICE_NAME = 'device_name'
ATTR_DEVICE_TYPE = 'device_type'
ATTR_EVENT_CODE = 'event_code'
ATTR_EVENT_NAME = 'event_name'
ATTR_EVENT_TYPE = 'event_type'
ATTR_EVENT_UTC = 'event_utc'
ATTR_SETTING = 'setting'
ATTR_USER_NAME = 'user_name'
ATTR_VALUE = 'value'
ABODE_DEVICE_ID_LIST_SCHEMA = vol.Schema([str])
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_NAME): cv.string,
vol.Optional(CONF_POLLING, default=False): cv.boolean,
vol.Optional(CONF_EXCLUDE, default=[]): ABODE_DEVICE_ID_LIST_SCHEMA,
vol.Optional(CONF_LIGHTS, default=[]): ABODE_DEVICE_ID_LIST_SCHEMA
}),
}, extra=vol.ALLOW_EXTRA)
CHANGE_SETTING_SCHEMA = vol.Schema({
vol.Required(ATTR_SETTING): cv.string,
vol.Required(ATTR_VALUE): cv.string
})
CAPTURE_IMAGE_SCHEMA = vol.Schema({
ATTR_ENTITY_ID: cv.entity_ids,
})
TRIGGER_SCHEMA = vol.Schema({
ATTR_ENTITY_ID: cv.entity_ids,
})
ABODE_PLATFORMS = [
'alarm_control_panel', 'binary_sensor', 'lock', 'switch', 'cover',
'camera', 'light', 'sensor'
]
class AbodeSystem:
"""Abode System class."""
def __init__(self, username, password, cache,
name, polling, exclude, lights):
"""Initialize the system."""
import abodepy
self.abode = abodepy.Abode(
username, password, auto_login=True, get_devices=True,
get_automations=True, cache_path=cache)
self.name = name
self.polling = polling
self.exclude = exclude
self.lights = lights
self.devices = []
def is_excluded(self, device):
"""Check if a device is configured to be excluded."""
return device.device_id in self.exclude
def is_automation_excluded(self, automation):
"""Check if an automation is configured to be excluded."""
return automation.automation_id in self.exclude
def is_light(self, device):
"""Check if a switch device is configured as a light."""
import abodepy.helpers.constants as CONST
return (device.generic_type == CONST.TYPE_LIGHT or
(device.generic_type == CONST.TYPE_SWITCH and
device.device_id in self.lights))
def setup(hass, config):
"""Set up Abode component."""
from abodepy.exceptions import AbodeException
conf = config[DOMAIN]
username = conf.get(CONF_USERNAME)
password = conf.get(CONF_PASSWORD)
name = conf.get(CONF_NAME)
polling = conf.get(CONF_POLLING)
exclude = conf.get(CONF_EXCLUDE)
lights = conf.get(CONF_LIGHTS)
try:
cache = hass.config.path(DEFAULT_CACHEDB)
hass.data[DOMAIN] = AbodeSystem(
username, password, cache, name, polling, exclude, lights)
except (AbodeException, ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Abode: %s", str(ex))
hass.components.persistent_notification.create(
'Error: {}<br />'
'You will need to restart hass after fixing.'
''.format(ex),
title=NOTIFICATION_TITLE,
notification_id=NOTIFICATION_ID)
return False
setup_hass_services(hass)
setup_hass_events(hass)
setup_abode_events(hass)
for platform in ABODE_PLATFORMS:
discovery.load_platform(hass, platform, DOMAIN, {}, config)
return True
def setup_hass_services(hass):
"""Home assistant services."""
from abodepy.exceptions import AbodeException
def change_setting(call):
"""Change an Abode system setting."""
setting = call.data.get(ATTR_SETTING)
value = call.data.get(ATTR_VALUE)
try:
hass.data[DOMAIN].abode.set_setting(setting, value)
except AbodeException as ex:
_LOGGER.warning(ex)
def capture_image(call):
"""Capture a new image."""
entity_ids = call.data.get(ATTR_ENTITY_ID)
target_devices = [device for device in hass.data[DOMAIN].devices
if device.entity_id in entity_ids]
for device in target_devices:
device.capture()
def trigger_quick_action(call):
"""Trigger a quick action."""
entity_ids = call.data.get(ATTR_ENTITY_ID, None)
target_devices = [device for device in hass.data[DOMAIN].devices
if device.entity_id in entity_ids]
for device in target_devices:
device.trigger()
hass.services.register(
DOMAIN, SERVICE_SETTINGS, change_setting,
schema=CHANGE_SETTING_SCHEMA)
hass.services.register(
DOMAIN, SERVICE_CAPTURE_IMAGE, capture_image,
schema=CAPTURE_IMAGE_SCHEMA)
hass.services.register(
DOMAIN, SERVICE_TRIGGER, trigger_quick_action,
schema=TRIGGER_SCHEMA)
def setup_hass_events(hass):
"""Home Assistant start and stop callbacks."""
def startup(event):
"""Listen for push events."""
hass.data[DOMAIN].abode.events.start()
def logout(event):
"""Logout of Abode."""
if not hass.data[DOMAIN].polling:
hass.data[DOMAIN].abode.events.stop()
hass.data[DOMAIN].abode.logout()
_LOGGER.info("Logged out of Abode")
if not hass.data[DOMAIN].polling:
hass.bus.listen_once(EVENT_HOMEASSISTANT_START, startup)
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, logout)
def setup_abode_events(hass):
"""Event callbacks."""
import abodepy.helpers.timeline as TIMELINE
def event_callback(event, event_json):
"""Handle an event callback from Abode."""
data = {
ATTR_DEVICE_ID: event_json.get(ATTR_DEVICE_ID, ''),
ATTR_DEVICE_NAME: event_json.get(ATTR_DEVICE_NAME, ''),
ATTR_DEVICE_TYPE: event_json.get(ATTR_DEVICE_TYPE, ''),
ATTR_EVENT_CODE: event_json.get(ATTR_EVENT_CODE, ''),
ATTR_EVENT_NAME: event_json.get(ATTR_EVENT_NAME, ''),
ATTR_EVENT_TYPE: event_json.get(ATTR_EVENT_TYPE, ''),
ATTR_EVENT_UTC: event_json.get(ATTR_EVENT_UTC, ''),
ATTR_USER_NAME: event_json.get(ATTR_USER_NAME, ''),
ATTR_DATE: event_json.get(ATTR_DATE, ''),
ATTR_TIME: event_json.get(ATTR_TIME, ''),
}
hass.bus.fire(event, data)
events = [TIMELINE.ALARM_GROUP, TIMELINE.ALARM_END_GROUP,
TIMELINE.PANEL_FAULT_GROUP, TIMELINE.PANEL_RESTORE_GROUP,
TIMELINE.AUTOMATION_GROUP]
for event in events:
hass.data[DOMAIN].abode.events.add_event_callback(
event,
partial(event_callback, event))
class AbodeDevice(Entity):
"""Representation of an Abode device."""
def __init__(self, data, device):
"""Initialize a sensor for Abode device."""
self._data = data
self._device = device
async def async_added_to_hass(self):
"""Subscribe Abode events."""
self.hass.async_add_job(
self._data.abode.events.add_device_callback,
self._device.device_id, self._update_callback
)
@property
def should_poll(self):
"""Return the polling state."""
return self._data.polling
def update(self):
"""Update automation state."""
self._device.refresh()
@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: ATTRIBUTION,
'device_id': self._device.device_id,
'battery_low': self._device.battery_low,
'no_response': self._device.no_response,
'device_type': self._device.type
}
def _update_callback(self, device):
"""Update the device state."""
self.schedule_update_ha_state()
class AbodeAutomation(Entity):
"""Representation of an Abode automation."""
def __init__(self, data, automation, event=None):
"""Initialize for Abode automation."""
self._data = data
self._automation = automation
self._event = event
async def async_added_to_hass(self):
"""Subscribe Abode events."""
if self._event:
self.hass.async_add_job(
self._data.abode.events.add_event_callback,
self._event, self._update_callback
)
@property
def should_poll(self):
"""Return the polling state."""
return self._data.polling
def update(self):
"""Update automation state."""
self._automation.refresh()
@property
def name(self):
"""Return the name of the sensor."""
return self._automation.name
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: ATTRIBUTION,
'automation_id': self._automation.automation_id,
'type': self._automation.type,
'sub_type': self._automation.sub_type
}
def _update_callback(self, device):
"""Update the device state."""
self._automation.refresh()
self.schedule_update_ha_state()

View File

@@ -0,0 +1,78 @@
"""Support for Abode Security System alarm control panels."""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
ATTR_ATTRIBUTION, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED)
from . import ATTRIBUTION, DOMAIN as ABODE_DOMAIN, AbodeDevice
_LOGGER = logging.getLogger(__name__)
ICON = 'mdi:security'
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up an alarm control panel for an Abode device."""
data = hass.data[ABODE_DOMAIN]
alarm_devices = [AbodeAlarm(data, data.abode.get_alarm(), data.name)]
data.devices.extend(alarm_devices)
add_entities(alarm_devices)
class AbodeAlarm(AbodeDevice, alarm.AlarmControlPanel):
"""An alarm_control_panel implementation for Abode."""
def __init__(self, data, device, name):
"""Initialize the alarm control panel."""
super().__init__(data, device)
self._name = name
@property
def icon(self):
"""Return the icon."""
return ICON
@property
def state(self):
"""Return the state of the device."""
if self._device.is_standby:
state = STATE_ALARM_DISARMED
elif self._device.is_away:
state = STATE_ALARM_ARMED_AWAY
elif self._device.is_home:
state = STATE_ALARM_ARMED_HOME
else:
state = None
return state
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._device.set_standby()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._device.set_home()
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._device.set_away()
@property
def name(self):
"""Return the name of the alarm."""
return self._name or super().name
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: ATTRIBUTION,
'device_id': self._device.device_id,
'battery_backup': self._device.battery,
'cellular_backup': self._device.is_cellular,
}

View File

@@ -0,0 +1,66 @@
"""Support for Abode Security System binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeAutomation, AbodeDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up a sensor for an Abode device."""
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
data = hass.data[ABODE_DOMAIN]
device_types = [CONST.TYPE_CONNECTIVITY, CONST.TYPE_MOISTURE,
CONST.TYPE_MOTION, CONST.TYPE_OCCUPANCY,
CONST.TYPE_OPENING]
devices = []
for device in data.abode.get_devices(generic_type=device_types):
if data.is_excluded(device):
continue
devices.append(AbodeBinarySensor(data, device))
for automation in data.abode.get_automations(
generic_type=CONST.TYPE_QUICK_ACTION):
if data.is_automation_excluded(automation):
continue
devices.append(AbodeQuickActionBinarySensor(
data, automation, TIMELINE.AUTOMATION_EDIT_GROUP))
data.devices.extend(devices)
add_entities(devices)
class AbodeBinarySensor(AbodeDevice, BinarySensorDevice):
"""A binary sensor implementation for Abode device."""
@property
def is_on(self):
"""Return True if the binary sensor is on."""
return self._device.is_on
@property
def device_class(self):
"""Return the class of the binary sensor."""
return self._device.generic_type
class AbodeQuickActionBinarySensor(AbodeAutomation, BinarySensorDevice):
"""A binary sensor implementation for Abode quick action automations."""
def trigger(self):
"""Trigger a quick automation."""
self._automation.trigger()
@property
def is_on(self):
"""Return True if the binary sensor is on."""
return self._automation.is_active

View File

@@ -0,0 +1,92 @@
"""Support for Abode Security System cameras."""
from datetime import timedelta
import logging
import requests
from homeassistant.components.camera import Camera
from homeassistant.util import Throttle
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=90)
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode camera devices."""
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
data = hass.data[ABODE_DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_CAMERA):
if data.is_excluded(device):
continue
devices.append(AbodeCamera(data, device, TIMELINE.CAPTURE_IMAGE))
data.devices.extend(devices)
add_entities(devices)
class AbodeCamera(AbodeDevice, Camera):
"""Representation of an Abode camera."""
def __init__(self, data, device, event):
"""Initialize the Abode device."""
AbodeDevice.__init__(self, data, device)
Camera.__init__(self)
self._event = event
self._response = None
async def async_added_to_hass(self):
"""Subscribe Abode events."""
await super().async_added_to_hass()
self.hass.async_add_job(
self._data.abode.events.add_timeline_callback,
self._event, self._capture_callback
)
def capture(self):
"""Request a new image capture."""
return self._device.capture()
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def refresh_image(self):
"""Find a new image on the timeline."""
if self._device.refresh_image():
self.get_image()
def get_image(self):
"""Attempt to download the most recent capture."""
if self._device.image_url:
try:
self._response = requests.get(
self._device.image_url, stream=True)
self._response.raise_for_status()
except requests.HTTPError as err:
_LOGGER.warning("Failed to get camera image: %s", err)
self._response = None
else:
self._response = None
def camera_image(self):
"""Get a camera image."""
self.refresh_image()
if self._response:
return self._response.content
return None
def _capture_callback(self, capture):
"""Update the image with the device then refresh device."""
self._device.update_image_location(capture)
self.get_image()
self.schedule_update_ha_state()

View File

@@ -0,0 +1,43 @@
"""Support for Abode Security System covers."""
import logging
from homeassistant.components.cover import CoverDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode cover devices."""
import abodepy.helpers.constants as CONST
data = hass.data[ABODE_DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_COVER):
if data.is_excluded(device):
continue
devices.append(AbodeCover(data, device))
data.devices.extend(devices)
add_entities(devices)
class AbodeCover(AbodeDevice, CoverDevice):
"""Representation of an Abode cover."""
@property
def is_closed(self):
"""Return true if cover is closed, else False."""
return not self._device.is_open
def close_cover(self, **kwargs):
"""Issue close command to cover."""
self._device.close_cover()
def open_cover(self, **kwargs):
"""Issue open command to cover."""
self._device.open_cover()

View File

@@ -0,0 +1,97 @@
"""Support for Abode Security System lights."""
import logging
from math import ceil
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR, SUPPORT_COLOR_TEMP, Light)
from homeassistant.util.color import (
color_temperature_kelvin_to_mired, color_temperature_mired_to_kelvin)
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode light devices."""
import abodepy.helpers.constants as CONST
data = hass.data[ABODE_DOMAIN]
device_types = [CONST.TYPE_LIGHT, CONST.TYPE_SWITCH]
devices = []
# Get all regular lights that are not excluded or switches marked as lights
for device in data.abode.get_devices(generic_type=device_types):
if data.is_excluded(device) or not data.is_light(device):
continue
devices.append(AbodeLight(data, device))
data.devices.extend(devices)
add_entities(devices)
class AbodeLight(AbodeDevice, Light):
"""Representation of an Abode light."""
def turn_on(self, **kwargs):
"""Turn on the light."""
if ATTR_COLOR_TEMP in kwargs and self._device.is_color_capable:
self._device.set_color_temp(
int(color_temperature_mired_to_kelvin(
kwargs[ATTR_COLOR_TEMP])))
if ATTR_HS_COLOR in kwargs and self._device.is_color_capable:
self._device.set_color(kwargs[ATTR_HS_COLOR])
if ATTR_BRIGHTNESS in kwargs and self._device.is_dimmable:
# Convert HASS brightness (0-255) to Abode brightness (0-99)
# If 100 is sent to Abode, response is 99 causing an error
self._device.set_level(ceil(kwargs[ATTR_BRIGHTNESS] * 99 / 255.0))
else:
self._device.switch_on()
def turn_off(self, **kwargs):
"""Turn off the light."""
self._device.switch_off()
@property
def is_on(self):
"""Return true if device is on."""
return self._device.is_on
@property
def brightness(self):
"""Return the brightness of the light."""
if self._device.is_dimmable and self._device.has_brightness:
brightness = int(self._device.brightness)
# Abode returns 100 during device initialization and device refresh
if brightness == 100:
return 255
# Convert Abode brightness (0-99) to HASS brightness (0-255)
return ceil(brightness * 255 / 99.0)
@property
def color_temp(self):
"""Return the color temp of the light."""
if self._device.has_color:
return color_temperature_kelvin_to_mired(self._device.color_temp)
@property
def hs_color(self):
"""Return the color of the light."""
if self._device.has_color:
return self._device.color
@property
def supported_features(self):
"""Flag supported features."""
if self._device.is_dimmable and self._device.is_color_capable:
return SUPPORT_BRIGHTNESS | SUPPORT_COLOR | SUPPORT_COLOR_TEMP
if self._device.is_dimmable:
return SUPPORT_BRIGHTNESS
return 0

View File

@@ -0,0 +1,43 @@
"""Support for Abode Security System locks."""
import logging
from homeassistant.components.lock import LockDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode lock devices."""
import abodepy.helpers.constants as CONST
data = hass.data[ABODE_DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_LOCK):
if data.is_excluded(device):
continue
devices.append(AbodeLock(data, device))
data.devices.extend(devices)
add_entities(devices)
class AbodeLock(AbodeDevice, LockDevice):
"""Representation of an Abode lock."""
def lock(self, **kwargs):
"""Lock the device."""
self._device.lock()
def unlock(self, **kwargs):
"""Unlock the device."""
self._device.unlock()
@property
def is_locked(self):
"""Return true if device is on."""
return self._device.is_locked

View File

@@ -0,0 +1,10 @@
{
"domain": "abode",
"name": "Abode",
"documentation": "https://www.home-assistant.io/components/abode",
"requirements": [
"abodepy==0.15.0"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,77 @@
"""Support for Abode Security System sensors."""
import logging
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_ILLUMINANCE, DEVICE_CLASS_TEMPERATURE)
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
_LOGGER = logging.getLogger(__name__)
# Sensor types: Name, icon
SENSOR_TYPES = {
'temp': ['Temperature', DEVICE_CLASS_TEMPERATURE],
'humidity': ['Humidity', DEVICE_CLASS_HUMIDITY],
'lux': ['Lux', DEVICE_CLASS_ILLUMINANCE],
}
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up a sensor for an Abode device."""
import abodepy.helpers.constants as CONST
data = hass.data[ABODE_DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_SENSOR):
if data.is_excluded(device):
continue
for sensor_type in SENSOR_TYPES:
devices.append(AbodeSensor(data, device, sensor_type))
data.devices.extend(devices)
add_entities(devices)
class AbodeSensor(AbodeDevice):
"""A sensor implementation for Abode devices."""
def __init__(self, data, device, sensor_type):
"""Initialize a sensor for an Abode device."""
super().__init__(data, device)
self._sensor_type = sensor_type
self._name = '{0} {1}'.format(
self._device.name, SENSOR_TYPES[self._sensor_type][0])
self._device_class = SENSOR_TYPES[self._sensor_type][1]
@property
def name(self):
"""Return the name of the sensor."""
return self._name
@property
def device_class(self):
"""Return the device class."""
return self._device_class
@property
def state(self):
"""Return the state of the sensor."""
if self._sensor_type == 'temp':
return self._device.temp
if self._sensor_type == 'humidity':
return self._device.humidity
if self._sensor_type == 'lux':
return self._device.lux
@property
def unit_of_measurement(self):
"""Return the units of measurement."""
if self._sensor_type == 'temp':
return self._device.temp_unit
if self._sensor_type == 'humidity':
return self._device.humidity_unit
if self._sensor_type == 'lux':
return self._device.lux_unit

View File

@@ -0,0 +1,13 @@
capture_image:
description: Request a new image capture from a camera device.
fields:
entity_id: {description: Entity id of the camera to request an image., example: camera.downstairs_motion_camera}
change_setting:
description: Change an Abode system setting.
fields:
setting: {description: Setting to change., example: beeper_mute}
value: {description: Value of the setting., example: '1'}
trigger_quick_action:
description: Trigger an Abode quick action.
fields:
entity_id: {description: Entity id of the quick action to trigger., example: binary_sensor.home_quick_action}

View File

@@ -0,0 +1,72 @@
"""Support for Abode Security System switches."""
import logging
from homeassistant.components.switch import SwitchDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeAutomation, AbodeDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode switch devices."""
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
data = hass.data[ABODE_DOMAIN]
devices = []
# Get all regular switches that are not excluded or marked as lights
for device in data.abode.get_devices(generic_type=CONST.TYPE_SWITCH):
if data.is_excluded(device) or data.is_light(device):
continue
devices.append(AbodeSwitch(data, device))
# Get all Abode automations that can be enabled/disabled
for automation in data.abode.get_automations(
generic_type=CONST.TYPE_AUTOMATION):
if data.is_automation_excluded(automation):
continue
devices.append(AbodeAutomationSwitch(
data, automation, TIMELINE.AUTOMATION_EDIT_GROUP))
data.devices.extend(devices)
add_entities(devices)
class AbodeSwitch(AbodeDevice, SwitchDevice):
"""Representation of an Abode switch."""
def turn_on(self, **kwargs):
"""Turn on the device."""
self._device.switch_on()
def turn_off(self, **kwargs):
"""Turn off the device."""
self._device.switch_off()
@property
def is_on(self):
"""Return true if device is on."""
return self._device.is_on
class AbodeAutomationSwitch(AbodeAutomation, SwitchDevice):
"""A switch implementation for Abode automations."""
def turn_on(self, **kwargs):
"""Turn on the device."""
self._automation.set_active(True)
def turn_off(self, **kwargs):
"""Turn off the device."""
self._automation.set_active(False)
@property
def is_on(self):
"""Return True if the binary sensor is on."""
return self._automation.is_active

View File

@@ -0,0 +1 @@
"""The acer_projector component."""

View File

@@ -0,0 +1,10 @@
{
"domain": "acer_projector",
"name": "Acer projector",
"documentation": "https://www.home-assistant.io/components/acer_projector",
"requirements": [
"pyserial==3.1.1"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,161 @@
"""Use serial protocol of Acer projector to obtain state of the projector."""
import logging
import re
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (
STATE_ON, STATE_OFF, STATE_UNKNOWN, CONF_NAME, CONF_FILENAME)
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
CONF_TIMEOUT = 'timeout'
CONF_WRITE_TIMEOUT = 'write_timeout'
DEFAULT_NAME = 'Acer Projector'
DEFAULT_TIMEOUT = 1
DEFAULT_WRITE_TIMEOUT = 1
ECO_MODE = 'ECO Mode'
ICON = 'mdi:projector'
INPUT_SOURCE = 'Input Source'
LAMP = 'Lamp'
LAMP_HOURS = 'Lamp Hours'
MODEL = 'Model'
# Commands known to the projector
CMD_DICT = {
LAMP: '* 0 Lamp ?\r',
LAMP_HOURS: '* 0 Lamp\r',
INPUT_SOURCE: '* 0 Src ?\r',
ECO_MODE: '* 0 IR 052\r',
MODEL: '* 0 IR 035\r',
STATE_ON: '* 0 IR 001\r',
STATE_OFF: '* 0 IR 002\r',
}
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_FILENAME): cv.isdevice,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
vol.Optional(CONF_WRITE_TIMEOUT, default=DEFAULT_WRITE_TIMEOUT):
cv.positive_int,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Connect with serial port and return Acer Projector."""
serial_port = config.get(CONF_FILENAME)
name = config.get(CONF_NAME)
timeout = config.get(CONF_TIMEOUT)
write_timeout = config.get(CONF_WRITE_TIMEOUT)
add_entities([AcerSwitch(serial_port, name, timeout, write_timeout)], True)
class AcerSwitch(SwitchDevice):
"""Represents an Acer Projector as a switch."""
def __init__(self, serial_port, name, timeout, write_timeout, **kwargs):
"""Init of the Acer projector."""
import serial
self.ser = serial.Serial(
port=serial_port, timeout=timeout, write_timeout=write_timeout,
**kwargs)
self._serial_port = serial_port
self._name = name
self._state = False
self._available = False
self._attributes = {
LAMP_HOURS: STATE_UNKNOWN,
INPUT_SOURCE: STATE_UNKNOWN,
ECO_MODE: STATE_UNKNOWN,
}
def _write_read(self, msg):
"""Write to the projector and read the return."""
import serial
ret = ""
# Sometimes the projector won't answer for no reason or the projector
# was disconnected during runtime.
# This way the projector can be reconnected and will still work
try:
if not self.ser.is_open:
self.ser.open()
msg = msg.encode('utf-8')
self.ser.write(msg)
# Size is an experience value there is no real limit.
# AFAIK there is no limit and no end character so we will usually
# need to wait for timeout
ret = self.ser.read_until(size=20).decode('utf-8')
except serial.SerialException:
_LOGGER.error('Problem communicating with %s', self._serial_port)
self.ser.close()
return ret
def _write_read_format(self, msg):
"""Write msg, obtain answer and format output."""
# answers are formatted as ***\answer\r***
awns = self._write_read(msg)
match = re.search(r'\r(.+)\r', awns)
if match:
return match.group(1)
return STATE_UNKNOWN
@property
def available(self):
"""Return if projector is available."""
return self._available
@property
def name(self):
"""Return name of the projector."""
return self._name
@property
def is_on(self):
"""Return if the projector is turned on."""
return self._state
@property
def state_attributes(self):
"""Return state attributes."""
return self._attributes
def update(self):
"""Get the latest state from the projector."""
msg = CMD_DICT[LAMP]
awns = self._write_read_format(msg)
if awns == 'Lamp 1':
self._state = True
self._available = True
elif awns == 'Lamp 0':
self._state = False
self._available = True
else:
self._available = False
for key in self._attributes:
msg = CMD_DICT.get(key, None)
if msg:
awns = self._write_read_format(msg)
self._attributes[key] = awns
def turn_on(self, **kwargs):
"""Turn the projector on."""
msg = CMD_DICT[STATE_ON]
self._write_read(msg)
self._state = STATE_ON
def turn_off(self, **kwargs):
"""Turn the projector off."""
msg = CMD_DICT[STATE_OFF]
self._write_read(msg)
self._state = STATE_OFF

View File

@@ -0,0 +1 @@
"""The actiontec component."""

View File

@@ -0,0 +1,115 @@
"""Support for Actiontec MI424WR (Verizon FIOS) routers."""
import logging
import re
import telnetlib
from collections import namedtuple
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
_LOGGER = logging.getLogger(__name__)
_LEASES_REGEX = re.compile(
r'(?P<ip>([0-9]{1,3}[\.]){3}[0-9]{1,3})' +
r'\smac:\s(?P<mac>([0-9a-f]{2}[:-]){5}([0-9a-f]{2}))' +
r'\svalid\sfor:\s(?P<timevalid>(-?\d+))' +
r'\ssec')
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_USERNAME): cv.string
})
def get_scanner(hass, config):
"""Validate the configuration and return an Actiontec scanner."""
scanner = ActiontecDeviceScanner(config[DOMAIN])
return scanner if scanner.success_init else None
Device = namedtuple('Device', ['mac', 'ip', 'last_update'])
class ActiontecDeviceScanner(DeviceScanner):
"""This class queries an actiontec router for connected devices."""
def __init__(self, config):
"""Initialize the scanner."""
self.host = config[CONF_HOST]
self.username = config[CONF_USERNAME]
self.password = config[CONF_PASSWORD]
self.last_results = []
data = self.get_actiontec_data()
self.success_init = data is not None
_LOGGER.info("canner initialized")
def scan_devices(self):
"""Scan for new devices and return a list with found device IDs."""
self._update_info()
return [client.mac for client in self.last_results]
def get_device_name(self, device):
"""Return the name of the given device or None if we don't know."""
if not self.last_results:
return None
for client in self.last_results:
if client.mac == device:
return client.ip
return None
def _update_info(self):
"""Ensure the information from the router is up to date.
Return boolean if scanning successful.
"""
_LOGGER.info("Scanning")
if not self.success_init:
return False
now = dt_util.now()
actiontec_data = self.get_actiontec_data()
if not actiontec_data:
return False
self.last_results = [Device(data['mac'], name, now)
for name, data in actiontec_data.items()
if data['timevalid'] > -60]
_LOGGER.info("Scan successful")
return True
def get_actiontec_data(self):
"""Retrieve data from Actiontec MI424WR and return parsed result."""
try:
telnet = telnetlib.Telnet(self.host)
telnet.read_until(b'Username: ')
telnet.write((self.username + '\n').encode('ascii'))
telnet.read_until(b'Password: ')
telnet.write((self.password + '\n').encode('ascii'))
prompt = telnet.read_until(
b'Wireless Broadband Router> ').split(b'\n')[-1]
telnet.write('firewall mac_cache_dump\n'.encode('ascii'))
telnet.write('\n'.encode('ascii'))
telnet.read_until(prompt)
leases_result = telnet.read_until(prompt).split(b'\n')[1:-1]
telnet.write('exit\n'.encode('ascii'))
except EOFError:
_LOGGER.exception("Unexpected response from router")
return
except ConnectionRefusedError:
_LOGGER.exception("Connection refused by router. Telnet enabled?")
return None
devices = {}
for lease in leases_result:
match = _LEASES_REGEX.search(lease.decode('utf-8'))
if match is not None:
devices[match.group('ip')] = {
'ip': match.group('ip'),
'mac': match.group('mac').upper(),
'timevalid': int(match.group('timevalid'))
}
return devices

View File

@@ -0,0 +1,8 @@
{
"domain": "actiontec",
"name": "Actiontec",
"documentation": "https://www.home-assistant.io/components/actiontec",
"requirements": [],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,38 +1,43 @@
"""
Support for Automation Device Specification (ADS).
For more details about this component, please refer to the documentation.
https://home-assistant.io/components/ads/
"""
"""Support for Automation Device Specification (ADS)."""
import threading
import struct
import logging
import ctypes
from collections import namedtuple
import voluptuous as vol
from homeassistant.const import CONF_DEVICE, CONF_PORT, CONF_IP_ADDRESS, \
EVENT_HOMEASSISTANT_STOP
import homeassistant.helpers.config_validation as cv
import asyncio
import async_timeout
REQUIREMENTS = ['pyads==2.2.6']
import voluptuous as vol
from homeassistant.const import (
CONF_DEVICE, CONF_IP_ADDRESS, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
DATA_ADS = 'data_ads'
# Supported Types
ADSTYPE_INT = 'int'
ADSTYPE_UINT = 'uint'
ADSTYPE_BYTE = 'byte'
ADSTYPE_BOOL = 'bool'
ADSTYPE_BYTE = 'byte'
ADSTYPE_DINT = 'dint'
ADSTYPE_INT = 'int'
ADSTYPE_UDINT = 'udint'
ADSTYPE_UINT = 'uint'
DOMAIN = 'ads'
CONF_ADS_FACTOR = 'factor'
CONF_ADS_TYPE = 'adstype'
CONF_ADS_VALUE = 'value'
CONF_ADS_VAR = 'adsvar'
CONF_ADS_VAR_BRIGHTNESS = 'adsvar_brightness'
CONF_ADS_TYPE = 'adstype'
CONF_ADS_FACTOR = 'factor'
CONF_ADS_VALUE = 'value'
CONF_ADS_VAR_POSITION = 'adsvar_position'
STATE_KEY_STATE = 'state'
STATE_KEY_BRIGHTNESS = 'brightness'
STATE_KEY_POSITION = 'position'
DOMAIN = 'ads'
SERVICE_WRITE_DATA_BY_NAME = 'write_data_by_name'
@@ -46,7 +51,8 @@ CONFIG_SCHEMA = vol.Schema({
SCHEMA_SERVICE_WRITE_DATA_BY_NAME = vol.Schema({
vol.Required(CONF_ADS_TYPE):
vol.In([ADSTYPE_INT, ADSTYPE_UINT, ADSTYPE_BYTE, ADSTYPE_BOOL]),
vol.In([ADSTYPE_INT, ADSTYPE_UINT, ADSTYPE_BYTE, ADSTYPE_BOOL,
ADSTYPE_DINT, ADSTYPE_UDINT]),
vol.Required(CONF_ADS_VALUE): vol.Coerce(int),
vol.Required(CONF_ADS_VAR): cv.string,
})
@@ -66,21 +72,26 @@ def setup(hass, config):
AdsHub.ADS_TYPEMAP = {
ADSTYPE_BOOL: pyads.PLCTYPE_BOOL,
ADSTYPE_BYTE: pyads.PLCTYPE_BYTE,
ADSTYPE_DINT: pyads.PLCTYPE_DINT,
ADSTYPE_INT: pyads.PLCTYPE_INT,
ADSTYPE_UDINT: pyads.PLCTYPE_UDINT,
ADSTYPE_UINT: pyads.PLCTYPE_UINT,
}
AdsHub.ADSError = pyads.ADSError
AdsHub.PLCTYPE_BOOL = pyads.PLCTYPE_BOOL
AdsHub.PLCTYPE_BYTE = pyads.PLCTYPE_BYTE
AdsHub.PLCTYPE_DINT = pyads.PLCTYPE_DINT
AdsHub.PLCTYPE_INT = pyads.PLCTYPE_INT
AdsHub.PLCTYPE_UDINT = pyads.PLCTYPE_UDINT
AdsHub.PLCTYPE_UINT = pyads.PLCTYPE_UINT
AdsHub.ADSError = pyads.ADSError
try:
ads = AdsHub(client)
except pyads.pyads.ADSError:
except pyads.ADSError:
_LOGGER.error(
"Could not connect to ADS host (netid=%s, port=%s)", net_id, port)
"Could not connect to ADS host (netid=%s, ip=%s, port=%s)",
net_id, ip_address, port)
return False
hass.data[DATA_ADS] = ads
@@ -149,31 +160,43 @@ class AdsHub:
def write_by_name(self, name, value, plc_datatype):
"""Write a value to the device."""
import pyads
with self._lock:
return self._client.write_by_name(name, value, plc_datatype)
try:
return self._client.write_by_name(name, value, plc_datatype)
except pyads.ADSError as err:
_LOGGER.error("Error writing %s: %s", name, err)
def read_by_name(self, name, plc_datatype):
"""Read a value from the device."""
import pyads
with self._lock:
return self._client.read_by_name(name, plc_datatype)
try:
return self._client.read_by_name(name, plc_datatype)
except pyads.ADSError as err:
_LOGGER.error("Error reading %s: %s", name, err)
def add_device_notification(self, name, plc_datatype, callback):
"""Add a notification to the ADS devices."""
from pyads import NotificationAttrib
attr = NotificationAttrib(ctypes.sizeof(plc_datatype))
import pyads
attr = pyads.NotificationAttrib(ctypes.sizeof(plc_datatype))
with self._lock:
hnotify, huser = self._client.add_device_notification(
name, attr, self._device_notification_callback)
hnotify = int(hnotify)
try:
hnotify, huser = self._client.add_device_notification(
name, attr, self._device_notification_callback)
except pyads.ADSError as err:
_LOGGER.error("Error subscribing to %s: %s", name, err)
else:
hnotify = int(hnotify)
self._notification_items[hnotify] = NotificationItem(
hnotify, huser, name, plc_datatype, callback)
_LOGGER.debug(
"Added device notification %d for variable %s", hnotify, name)
_LOGGER.debug(
"Added device notification %d for variable %s",
hnotify, name)
self._notification_items[hnotify] = NotificationItem(
hnotify, huser, name, plc_datatype, callback)
def _device_notification_callback(self, addr, notification, huser):
def _device_notification_callback(self, notification, name):
"""Handle device notifications."""
contents = notification.contents
@@ -182,9 +205,10 @@ class AdsHub:
data = contents.data
try:
notification_item = self._notification_items[hnotify]
with self._lock:
notification_item = self._notification_items[hnotify]
except KeyError:
_LOGGER.debug("Unknown device notification handle: %d", hnotify)
_LOGGER.error("Unknown device notification handle: %d", hnotify)
return
# Parse data to desired datatype
@@ -196,8 +220,77 @@ class AdsHub:
value = struct.unpack('<B', bytearray(data)[:1])[0]
elif notification_item.plc_datatype == self.PLCTYPE_UINT:
value = struct.unpack('<H', bytearray(data)[:2])[0]
elif notification_item.plc_datatype == self.PLCTYPE_DINT:
value = struct.unpack('<i', bytearray(data)[:4])[0]
elif notification_item.plc_datatype == self.PLCTYPE_UDINT:
value = struct.unpack('<I', bytearray(data)[:4])[0]
else:
value = bytearray(data)
_LOGGER.warning("No callback available for this datatype")
notification_item.callback(notification_item.name, value)
class AdsEntity(Entity):
"""Representation of ADS entity."""
def __init__(self, ads_hub, name, ads_var):
"""Initialize ADS binary sensor."""
self._name = name
self._unique_id = ads_var
self._state_dict = {}
self._state_dict[STATE_KEY_STATE] = None
self._ads_hub = ads_hub
self._ads_var = ads_var
self._event = None
async def async_initialize_device(
self, ads_var, plctype, state_key=STATE_KEY_STATE, factor=None):
"""Register device notification."""
def update(name, value):
"""Handle device notifications."""
_LOGGER.debug('Variable %s changed its value to %d', name, value)
if factor is None:
self._state_dict[state_key] = value
else:
self._state_dict[state_key] = value / factor
asyncio.run_coroutine_threadsafe(async_event_set(), self.hass.loop)
self.schedule_update_ha_state()
async def async_event_set():
"""Set event in async context."""
self._event.set()
self._event = asyncio.Event()
await self.hass.async_add_executor_job(
self._ads_hub.add_device_notification,
ads_var, plctype, update)
try:
with async_timeout.timeout(10):
await self._event.wait()
except asyncio.TimeoutError:
_LOGGER.debug('Variable %s: Timeout during first update',
ads_var)
@property
def name(self):
"""Return the default name of the binary sensor."""
return self._name
@property
def unique_id(self):
"""Return an unique identifier for this entity."""
return self._unique_id
@property
def should_poll(self):
"""Return False because entity pushes its state to HA."""
return False
@property
def available(self):
"""Return False if state has not been updated yet."""
return self._state_dict[STATE_KEY_STATE] is not None

View File

@@ -0,0 +1,56 @@
"""Support for ADS binary sensors."""
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA, PLATFORM_SCHEMA, BinarySensorDevice)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, DATA_ADS, AdsEntity, STATE_KEY_STATE
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'ADS binary sensor'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_ADS_VAR): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Binary Sensor platform for ADS."""
ads_hub = hass.data.get(DATA_ADS)
ads_var = config.get(CONF_ADS_VAR)
name = config.get(CONF_NAME)
device_class = config.get(CONF_DEVICE_CLASS)
ads_sensor = AdsBinarySensor(ads_hub, name, ads_var, device_class)
add_entities([ads_sensor])
class AdsBinarySensor(AdsEntity, BinarySensorDevice):
"""Representation of ADS binary sensors."""
def __init__(self, ads_hub, name, ads_var, device_class):
"""Initialize ADS binary sensor."""
super().__init__(ads_hub, name, ads_var)
self._device_class = device_class or 'moving'
async def async_added_to_hass(self):
"""Register device notification."""
await self.async_initialize_device(self._ads_var,
self._ads_hub.PLCTYPE_BOOL)
@property
def is_on(self):
"""Return True if the entity is on."""
return self._state_dict[STATE_KEY_STATE]
@property
def device_class(self):
"""Return the device class."""
return self._device_class

View File

@@ -0,0 +1,165 @@
"""Support for ADS covers."""
import logging
import voluptuous as vol
from homeassistant.components.cover import (
PLATFORM_SCHEMA, SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_STOP,
SUPPORT_SET_POSITION, ATTR_POSITION, DEVICE_CLASSES_SCHEMA,
CoverDevice)
from homeassistant.const import (
CONF_NAME, CONF_DEVICE_CLASS)
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, CONF_ADS_VAR_POSITION, DATA_ADS, \
AdsEntity, STATE_KEY_STATE, STATE_KEY_POSITION
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'ADS Cover'
CONF_ADS_VAR_SET_POS = 'adsvar_set_position'
CONF_ADS_VAR_OPEN = 'adsvar_open'
CONF_ADS_VAR_CLOSE = 'adsvar_close'
CONF_ADS_VAR_STOP = 'adsvar_stop'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_ADS_VAR): cv.string,
vol.Optional(CONF_ADS_VAR_POSITION): cv.string,
vol.Optional(CONF_ADS_VAR_SET_POS): cv.string,
vol.Optional(CONF_ADS_VAR_CLOSE): cv.string,
vol.Optional(CONF_ADS_VAR_OPEN): cv.string,
vol.Optional(CONF_ADS_VAR_STOP): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_DEVICE_CLASS): DEVICE_CLASSES_SCHEMA
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the cover platform for ADS."""
ads_hub = hass.data[DATA_ADS]
ads_var_is_closed = config.get(CONF_ADS_VAR)
ads_var_position = config.get(CONF_ADS_VAR_POSITION)
ads_var_pos_set = config.get(CONF_ADS_VAR_SET_POS)
ads_var_open = config.get(CONF_ADS_VAR_OPEN)
ads_var_close = config.get(CONF_ADS_VAR_CLOSE)
ads_var_stop = config.get(CONF_ADS_VAR_STOP)
name = config[CONF_NAME]
device_class = config.get(CONF_DEVICE_CLASS)
add_entities([AdsCover(ads_hub,
ads_var_is_closed,
ads_var_position,
ads_var_pos_set,
ads_var_open,
ads_var_close,
ads_var_stop,
name,
device_class)])
class AdsCover(AdsEntity, CoverDevice):
"""Representation of ADS cover."""
def __init__(self, ads_hub,
ads_var_is_closed, ads_var_position,
ads_var_pos_set, ads_var_open,
ads_var_close, ads_var_stop, name, device_class):
"""Initialize AdsCover entity."""
super().__init__(ads_hub, name, ads_var_is_closed)
if self._ads_var is None:
if ads_var_position is not None:
self._unique_id = ads_var_position
elif ads_var_pos_set is not None:
self._unique_id = ads_var_pos_set
elif ads_var_open is not None:
self._unique_id = ads_var_open
self._state_dict[STATE_KEY_POSITION] = None
self._ads_var_position = ads_var_position
self._ads_var_pos_set = ads_var_pos_set
self._ads_var_open = ads_var_open
self._ads_var_close = ads_var_close
self._ads_var_stop = ads_var_stop
self._device_class = device_class
async def async_added_to_hass(self):
"""Register device notification."""
if self._ads_var is not None:
await self.async_initialize_device(self._ads_var,
self._ads_hub.PLCTYPE_BOOL)
if self._ads_var_position is not None:
await self.async_initialize_device(self._ads_var_position,
self._ads_hub.PLCTYPE_BYTE,
STATE_KEY_POSITION)
@property
def device_class(self):
"""Return the class of this cover."""
return self._device_class
@property
def is_closed(self):
"""Return if the cover is closed."""
if self._ads_var is not None:
return self._state_dict[STATE_KEY_STATE]
if self._ads_var_position is not None:
return self._state_dict[STATE_KEY_POSITION] == 0
return None
@property
def current_cover_position(self):
"""Return current position of cover."""
return self._state_dict[STATE_KEY_POSITION]
@property
def supported_features(self):
"""Flag supported features."""
supported_features = SUPPORT_OPEN | SUPPORT_CLOSE
if self._ads_var_stop is not None:
supported_features |= SUPPORT_STOP
if self._ads_var_pos_set is not None:
supported_features |= SUPPORT_SET_POSITION
return supported_features
def stop_cover(self, **kwargs):
"""Fire the stop action."""
if self._ads_var_stop:
self._ads_hub.write_by_name(self._ads_var_stop, True,
self._ads_hub.PLCTYPE_BOOL)
def set_cover_position(self, **kwargs):
"""Set cover position."""
position = kwargs[ATTR_POSITION]
if self._ads_var_pos_set is not None:
self._ads_hub.write_by_name(self._ads_var_pos_set, position,
self._ads_hub.PLCTYPE_BYTE)
def open_cover(self, **kwargs):
"""Move the cover up."""
if self._ads_var_open is not None:
self._ads_hub.write_by_name(self._ads_var_open, True,
self._ads_hub.PLCTYPE_BOOL)
elif self._ads_var_pos_set is not None:
self.set_cover_position(position=100)
def close_cover(self, **kwargs):
"""Move the cover down."""
if self._ads_var_close is not None:
self._ads_hub.write_by_name(self._ads_var_close, True,
self._ads_hub.PLCTYPE_BOOL)
elif self._ads_var_pos_set is not None:
self.set_cover_position(position=0)
@property
def available(self):
"""Return False if state has not been updated yet."""
if self._ads_var is not None or self._ads_var_position is not None:
return self._state_dict[STATE_KEY_STATE] is not None or \
self._state_dict[STATE_KEY_POSITION] is not None
return True

View File

@@ -0,0 +1,85 @@
"""Support for ADS light sources."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, Light)
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, CONF_ADS_VAR_BRIGHTNESS, DATA_ADS, \
AdsEntity, STATE_KEY_BRIGHTNESS, STATE_KEY_STATE
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'ADS Light'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_ADS_VAR): cv.string,
vol.Optional(CONF_ADS_VAR_BRIGHTNESS): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the light platform for ADS."""
ads_hub = hass.data.get(DATA_ADS)
ads_var_enable = config.get(CONF_ADS_VAR)
ads_var_brightness = config.get(CONF_ADS_VAR_BRIGHTNESS)
name = config.get(CONF_NAME)
add_entities([AdsLight(ads_hub, ads_var_enable, ads_var_brightness,
name)])
class AdsLight(AdsEntity, Light):
"""Representation of ADS light."""
def __init__(self, ads_hub, ads_var_enable, ads_var_brightness, name):
"""Initialize AdsLight entity."""
super().__init__(ads_hub, name, ads_var_enable)
self._state_dict[STATE_KEY_BRIGHTNESS] = None
self._ads_var_brightness = ads_var_brightness
async def async_added_to_hass(self):
"""Register device notification."""
await self.async_initialize_device(self._ads_var,
self._ads_hub.PLCTYPE_BOOL)
if self._ads_var_brightness is not None:
await self.async_initialize_device(self._ads_var_brightness,
self._ads_hub.PLCTYPE_UINT,
STATE_KEY_BRIGHTNESS)
@property
def brightness(self):
"""Return the brightness of the light (0..255)."""
return self._state_dict[STATE_KEY_BRIGHTNESS]
@property
def supported_features(self):
"""Flag supported features."""
support = 0
if self._ads_var_brightness is not None:
support = SUPPORT_BRIGHTNESS
return support
@property
def is_on(self):
"""Return True if the entity is on."""
return self._state_dict[STATE_KEY_STATE]
def turn_on(self, **kwargs):
"""Turn the light on or set a specific dimmer value."""
brightness = kwargs.get(ATTR_BRIGHTNESS)
self._ads_hub.write_by_name(self._ads_var, True,
self._ads_hub.PLCTYPE_BOOL)
if self._ads_var_brightness is not None and brightness is not None:
self._ads_hub.write_by_name(self._ads_var_brightness, brightness,
self._ads_hub.PLCTYPE_UINT)
def turn_off(self, **kwargs):
"""Turn the light off."""
self._ads_hub.write_by_name(self._ads_var, False,
self._ads_hub.PLCTYPE_BOOL)

View File

@@ -0,0 +1,10 @@
{
"domain": "ads",
"name": "Ads",
"documentation": "https://www.home-assistant.io/components/ads",
"requirements": [
"pyads==3.0.7"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,71 @@
"""Support for ADS sensors."""
import logging
import voluptuous as vol
from homeassistant.components import ads
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_FACTOR, CONF_ADS_TYPE, CONF_ADS_VAR, \
AdsEntity, STATE_KEY_STATE
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "ADS sensor"
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_ADS_VAR): cv.string,
vol.Optional(CONF_ADS_FACTOR): cv.positive_int,
vol.Optional(CONF_ADS_TYPE, default=ads.ADSTYPE_INT):
vol.In([ads.ADSTYPE_INT, ads.ADSTYPE_UINT, ads.ADSTYPE_BYTE,
ads.ADSTYPE_DINT, ads.ADSTYPE_UDINT]),
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_UNIT_OF_MEASUREMENT, default=''): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up an ADS sensor device."""
ads_hub = hass.data.get(ads.DATA_ADS)
ads_var = config.get(CONF_ADS_VAR)
ads_type = config.get(CONF_ADS_TYPE)
name = config.get(CONF_NAME)
unit_of_measurement = config.get(CONF_UNIT_OF_MEASUREMENT)
factor = config.get(CONF_ADS_FACTOR)
entity = AdsSensor(
ads_hub, ads_var, ads_type, name, unit_of_measurement, factor)
add_entities([entity])
class AdsSensor(AdsEntity):
"""Representation of an ADS sensor entity."""
def __init__(self, ads_hub, ads_var, ads_type, name, unit_of_measurement,
factor):
"""Initialize AdsSensor entity."""
super().__init__(ads_hub, name, ads_var)
self._unit_of_measurement = unit_of_measurement
self._ads_type = ads_type
self._factor = factor
async def async_added_to_hass(self):
"""Register device notification."""
await self.async_initialize_device(
self._ads_var,
self._ads_hub.ADS_TYPEMAP[self._ads_type],
STATE_KEY_STATE,
self._factor)
@property
def state(self):
"""Return the state of the device."""
return self._state_dict[STATE_KEY_STATE]
@property
def unit_of_measurement(self):
"""Return the unit of measurement."""
return self._unit_of_measurement

View File

@@ -0,0 +1,53 @@
"""Support for ADS switch platform."""
import logging
import voluptuous as vol
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, DATA_ADS, AdsEntity, STATE_KEY_STATE
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'ADS Switch'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_ADS_VAR): cv.string,
vol.Optional(CONF_NAME): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up switch platform for ADS."""
ads_hub = hass.data.get(DATA_ADS)
name = config.get(CONF_NAME)
ads_var = config.get(CONF_ADS_VAR)
add_entities([AdsSwitch(ads_hub, name, ads_var)])
class AdsSwitch(AdsEntity, SwitchDevice):
"""Representation of an ADS switch device."""
async def async_added_to_hass(self):
"""Register device notification."""
await self.async_initialize_device(self._ads_var,
self._ads_hub.PLCTYPE_BOOL)
@property
def is_on(self):
"""Return True if the entity is on."""
return self._state_dict[STATE_KEY_STATE]
def turn_on(self, **kwargs):
"""Turn the switch on."""
self._ads_hub.write_by_name(
self._ads_var, True, self._ads_hub.PLCTYPE_BOOL)
def turn_off(self, **kwargs):
"""Turn the switch off."""
self._ads_hub.write_by_name(
self._ads_var, False, self._ads_hub.PLCTYPE_BOOL)

View File

@@ -0,0 +1 @@
"""The aftership component."""

View File

@@ -0,0 +1,2 @@
"""Constants for the Aftership integration."""
DOMAIN = 'aftership'

View File

@@ -0,0 +1,10 @@
{
"domain": "aftership",
"name": "Aftership",
"documentation": "https://www.home-assistant.io/components/aftership",
"requirements": [
"pyaftership==0.1.2"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,204 @@
"""Support for non-delivered packages recorded in AfterShip."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
ATTRIBUTION = 'Information provided by AfterShip'
ATTR_TRACKINGS = 'trackings'
BASE = 'https://track.aftership.com/'
CONF_SLUG = 'slug'
CONF_TITLE = 'title'
CONF_TRACKING_NUMBER = 'tracking_number'
DEFAULT_NAME = 'aftership'
UPDATE_TOPIC = DOMAIN + '_update'
ICON = 'mdi:package-variant-closed'
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=5)
SERVICE_ADD_TRACKING = 'add_tracking'
SERVICE_REMOVE_TRACKING = 'remove_tracking'
ADD_TRACKING_SERVICE_SCHEMA = vol.Schema(
{
vol.Required(CONF_TRACKING_NUMBER): cv.string,
vol.Optional(CONF_TITLE): cv.string,
vol.Optional(CONF_SLUG): cv.string,
}
)
REMOVE_TRACKING_SERVICE_SCHEMA = vol.Schema(
{vol.Required(CONF_SLUG): cv.string,
vol.Required(CONF_TRACKING_NUMBER): cv.string}
)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_API_KEY): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
"""Set up the AfterShip sensor platform."""
from pyaftership.tracker import Tracking
apikey = config[CONF_API_KEY]
name = config[CONF_NAME]
session = async_get_clientsession(hass)
aftership = Tracking(hass.loop, session, apikey)
await aftership.get_trackings()
if not aftership.meta or aftership.meta['code'] != 200:
_LOGGER.error("No tracking data found. Check API key is correct: %s",
aftership.meta)
return
instance = AfterShipSensor(aftership, name)
async_add_entities([instance], True)
async def handle_add_tracking(call):
"""Call when a user adds a new Aftership tracking from HASS."""
title = call.data.get(CONF_TITLE)
slug = call.data.get(CONF_SLUG)
tracking_number = call.data[CONF_TRACKING_NUMBER]
await aftership.add_package_tracking(tracking_number, title, slug)
async_dispatcher_send(hass, UPDATE_TOPIC)
hass.services.async_register(
DOMAIN,
SERVICE_ADD_TRACKING,
handle_add_tracking,
schema=ADD_TRACKING_SERVICE_SCHEMA,
)
async def handle_remove_tracking(call):
"""Call when a user removes an Aftership tracking from HASS."""
slug = call.data[CONF_SLUG]
tracking_number = call.data[CONF_TRACKING_NUMBER]
await aftership.remove_package_tracking(slug, tracking_number)
async_dispatcher_send(hass, UPDATE_TOPIC)
hass.services.async_register(
DOMAIN,
SERVICE_REMOVE_TRACKING,
handle_remove_tracking,
schema=REMOVE_TRACKING_SERVICE_SCHEMA,
)
class AfterShipSensor(Entity):
"""Representation of a AfterShip sensor."""
def __init__(self, aftership, name):
"""Initialize the sensor."""
self._attributes = {}
self._name = name
self._state = None
self.aftership = aftership
@property
def name(self):
"""Return the name of the sensor."""
return self._name
@property
def state(self):
"""Return the state of the sensor."""
return self._state
@property
def unit_of_measurement(self):
"""Return the unit of measurement of this entity, if any."""
return 'packages'
@property
def device_state_attributes(self):
"""Return attributes for the sensor."""
return self._attributes
@property
def icon(self):
"""Icon to use in the frontend."""
return ICON
async def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
UPDATE_TOPIC, self.force_update)
async def force_update(self):
"""Force update of data."""
await self.async_update(no_throttle=True)
await self.async_update_ha_state()
@Throttle(MIN_TIME_BETWEEN_UPDATES)
async def async_update(self, **kwargs):
"""Get the latest data from the AfterShip API."""
await self.aftership.get_trackings()
if not self.aftership.meta:
_LOGGER.error("Unknown errors when querying")
return
if self.aftership.meta['code'] != 200:
_LOGGER.error(
"Errors when querying AfterShip. %s", str(self.aftership.meta))
return
status_to_ignore = {'delivered'}
status_counts = {}
trackings = []
not_delivered_count = 0
for track in self.aftership.trackings['trackings']:
status = track['tag'].lower()
name = (
track['tracking_number']
if track['title'] is None
else track['title']
)
status_counts[status] = status_counts.get(status, 0) + 1
trackings.append({
'name': name,
'tracking_number': track['tracking_number'],
'slug': track['slug'],
'link': '%s%s/%s' %
(BASE, track['slug'], track['tracking_number']),
'last_update': track['updated_at'],
'expected_delivery': track['expected_delivery'],
'status': track['tag'],
'last_checkpoint': track['checkpoints'][-1]
})
if status not in status_to_ignore:
not_delivered_count += 1
else:
_LOGGER.debug("Ignoring %s as it has status: %s", name, status)
self._attributes = {
ATTR_ATTRIBUTION: ATTRIBUTION,
**status_counts,
ATTR_TRACKINGS: trackings,
}
self._state = not_delivered_count

View File

@@ -0,0 +1,24 @@
# Describes the format for available aftership services
add_tracking:
description: Add new tracking to Aftership.
fields:
tracking_number:
description: Tracking number for the new tracking
example: '123456789'
title:
description: A custom title for the new tracking
example: 'Laptop'
slug:
description: Slug (carrier) of the new tracking
example: 'USPS'
remove_tracking:
description: Remove a tracking from Aftership.
fields:
tracking_number:
description: Tracking number of the tracking to remove
example: '123456789'
slug:
description: Slug (carrier) of the tracking to remove
example: 'USPS'

View File

@@ -1,21 +1,17 @@
"""
Component for handling Air Quality data for your location.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/air_quality/
"""
"""Component for handling Air Quality data for your location."""
from datetime import timedelta
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa
from homeassistant.helpers.config_validation import ( # noqa
PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE)
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
ATTR_AQI = 'air_quality_index'
ATTR_ATTRIBUTION = 'attribution'
ATTR_C02 = 'carbon_dioxide'
ATTR_CO2 = 'carbon_dioxide'
ATTR_CO = 'carbon_monoxide'
ATTR_N2O = 'nitrogen_oxide'
ATTR_NO = 'nitrogen_monoxide'
@@ -35,7 +31,7 @@ SCAN_INTERVAL = timedelta(seconds=30)
PROP_TO_ATTR = {
'air_quality_index': ATTR_AQI,
'attribution': ATTR_ATTRIBUTION,
'carbon_dioxide': ATTR_C02,
'carbon_dioxide': ATTR_CO2,
'carbon_monoxide': ATTR_CO,
'nitrogen_oxide': ATTR_N2O,
'nitrogen_monoxide': ATTR_NO,

View File

@@ -1,56 +0,0 @@
"""
Demo platform that offers fake air quality data.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
from homeassistant.components.air_quality import AirQualityEntity
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Air Quality."""
add_entities([
DemoAirQuality('Home', 14, 23, 100),
DemoAirQuality('Office', 4, 16, None)
])
class DemoAirQuality(AirQualityEntity):
"""Representation of Air Quality data."""
def __init__(self, name, pm_2_5, pm_10, n2o):
"""Initialize the Demo Air Quality."""
self._name = name
self._pm_2_5 = pm_2_5
self._pm_10 = pm_10
self._n2o = n2o
@property
def name(self):
"""Return the name of the sensor."""
return '{} {}'.format('Demo Air Quality', self._name)
@property
def should_poll(self):
"""No polling needed for Demo Air Quality."""
return False
@property
def particulate_matter_2_5(self):
"""Return the particulate matter 2.5 level."""
return self._pm_2_5
@property
def particulate_matter_10(self):
"""Return the particulate matter 10 level."""
return self._pm_10
@property
def nitrogen_oxide(self):
"""Return the nitrogen oxide (N2O) level."""
return self._n2o
@property
def attribution(self):
"""Return the attribution."""
return 'Powered by Home Assistant'

View File

@@ -0,0 +1,8 @@
{
"domain": "air_quality",
"name": "Air quality",
"documentation": "https://www.home-assistant.io/components/air_quality",
"requirements": [],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,105 +0,0 @@
"""
Support for openSenseMap Air Quality data.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/air_quality/opensensemap/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.air_quality import (
PLATFORM_SCHEMA, AirQualityEntity)
from homeassistant.const import CONF_NAME
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
REQUIREMENTS = ['opensensemap-api==0.1.3']
_LOGGER = logging.getLogger(__name__)
ATTRIBUTION = 'Data provided by openSenseMap'
CONF_STATION_ID = 'station_id'
SCAN_INTERVAL = timedelta(minutes=10)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_STATION_ID): cv.string,
vol.Optional(CONF_NAME): cv.string,
})
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
"""Set up the openSenseMap air quality platform."""
from opensensemap_api import OpenSenseMap
name = config.get(CONF_NAME)
station_id = config[CONF_STATION_ID]
session = async_get_clientsession(hass)
osm_api = OpenSenseMapData(OpenSenseMap(station_id, hass.loop, session))
await osm_api.async_update()
if 'name' not in osm_api.api.data:
_LOGGER.error("Station %s is not available", station_id)
return
station_name = osm_api.api.data['name'] if name is None else name
async_add_entities([OpenSenseMapQuality(station_name, osm_api)], True)
class OpenSenseMapQuality(AirQualityEntity):
"""Implementation of an openSenseMap air quality entity."""
def __init__(self, name, osm):
"""Initialize the air quality entity."""
self._name = name
self._osm = osm
@property
def name(self):
"""Return the name of the air quality entity."""
return self._name
@property
def particulate_matter_2_5(self):
"""Return the particulate matter 2.5 level."""
return self._osm.api.pm2_5
@property
def particulate_matter_10(self):
"""Return the particulate matter 10 level."""
return self._osm.api.pm10
@property
def attribution(self):
"""Return the attribution."""
return ATTRIBUTION
async def async_update(self):
"""Get the latest data from the openSenseMap API."""
await self._osm.async_update()
class OpenSenseMapData:
"""Get the latest data and update the states."""
def __init__(self, api):
"""Initialize the data object."""
self.api = api
@Throttle(SCAN_INTERVAL)
async def async_update(self):
"""Get the latest data from the Pi-hole."""
from opensensemap_api.exceptions import OpenSenseMapError
try:
await self.api.get_data()
except OpenSenseMapError as err:
_LOGGER.error("Unable to fetch data: %s", err)

View File

@@ -0,0 +1 @@
"""The airvisual component."""

View File

@@ -0,0 +1,12 @@
{
"domain": "airvisual",
"name": "Airvisual",
"documentation": "https://www.home-assistant.io/components/airvisual",
"requirements": [
"pyairvisual==3.0.1"
],
"dependencies": [],
"codeowners": [
"@bachya"
]
}

View File

@@ -0,0 +1,294 @@
"""Support for AirVisual air quality sensors."""
from logging import getLogger
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_API_KEY,
CONF_LATITUDE, CONF_LONGITUDE, CONF_MONITORED_CONDITIONS,
CONF_SCAN_INTERVAL, CONF_STATE, CONF_SHOW_ON_MAP)
from homeassistant.helpers import aiohttp_client, config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = getLogger(__name__)
ATTR_CITY = 'city'
ATTR_COUNTRY = 'country'
ATTR_POLLUTANT_SYMBOL = 'pollutant_symbol'
ATTR_POLLUTANT_UNIT = 'pollutant_unit'
ATTR_REGION = 'region'
CONF_CITY = 'city'
CONF_COUNTRY = 'country'
DEFAULT_ATTRIBUTION = "Data provided by AirVisual"
DEFAULT_SCAN_INTERVAL = timedelta(minutes=10)
MASS_PARTS_PER_MILLION = 'ppm'
MASS_PARTS_PER_BILLION = 'ppb'
VOLUME_MICROGRAMS_PER_CUBIC_METER = 'µg/m3'
SENSOR_TYPE_LEVEL = 'air_pollution_level'
SENSOR_TYPE_AQI = 'air_quality_index'
SENSOR_TYPE_POLLUTANT = 'main_pollutant'
SENSORS = [
(SENSOR_TYPE_LEVEL, 'Air Pollution Level', 'mdi:gauge', None),
(SENSOR_TYPE_AQI, 'Air Quality Index', 'mdi:chart-line', 'AQI'),
(SENSOR_TYPE_POLLUTANT, 'Main Pollutant', 'mdi:chemical-weapon', None),
]
POLLUTANT_LEVEL_MAPPING = [{
'label': 'Good',
'icon': 'mdi:emoticon-excited',
'minimum': 0,
'maximum': 50
}, {
'label': 'Moderate',
'icon': 'mdi:emoticon-happy',
'minimum': 51,
'maximum': 100
}, {
'label': 'Unhealthy for sensitive groups',
'icon': 'mdi:emoticon-neutral',
'minimum': 101,
'maximum': 150
}, {
'label': 'Unhealthy',
'icon': 'mdi:emoticon-sad',
'minimum': 151,
'maximum': 200
}, {
'label': 'Very Unhealthy',
'icon': 'mdi:emoticon-dead',
'minimum': 201,
'maximum': 300
}, {
'label': 'Hazardous',
'icon': 'mdi:biohazard',
'minimum': 301,
'maximum': 10000
}]
POLLUTANT_MAPPING = {
'co': {
'label': 'Carbon Monoxide',
'unit': MASS_PARTS_PER_MILLION
},
'n2': {
'label': 'Nitrogen Dioxide',
'unit': MASS_PARTS_PER_BILLION
},
'o3': {
'label': 'Ozone',
'unit': MASS_PARTS_PER_BILLION
},
'p1': {
'label': 'PM10',
'unit': VOLUME_MICROGRAMS_PER_CUBIC_METER
},
'p2': {
'label': 'PM2.5',
'unit': VOLUME_MICROGRAMS_PER_CUBIC_METER
},
's2': {
'label': 'Sulfur Dioxide',
'unit': MASS_PARTS_PER_BILLION
},
}
SENSOR_LOCALES = {'cn': 'Chinese', 'us': 'U.S.'}
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_API_KEY): cv.string,
vol.Required(CONF_MONITORED_CONDITIONS, default=list(SENSOR_LOCALES)):
vol.All(cv.ensure_list, [vol.In(SENSOR_LOCALES)]),
vol.Inclusive(CONF_CITY, 'city'): cv.string,
vol.Inclusive(CONF_COUNTRY, 'city'): cv.string,
vol.Inclusive(CONF_LATITUDE, 'coords'): cv.latitude,
vol.Inclusive(CONF_LONGITUDE, 'coords'): cv.longitude,
vol.Optional(CONF_SHOW_ON_MAP, default=True): cv.boolean,
vol.Inclusive(CONF_STATE, 'city'): cv.string,
vol.Optional(CONF_SCAN_INTERVAL, default=DEFAULT_SCAN_INTERVAL):
cv.time_period
})
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
"""Configure the platform and add the sensors."""
from pyairvisual import Client
city = config.get(CONF_CITY)
state = config.get(CONF_STATE)
country = config.get(CONF_COUNTRY)
latitude = config.get(CONF_LATITUDE, hass.config.latitude)
longitude = config.get(CONF_LONGITUDE, hass.config.longitude)
websession = aiohttp_client.async_get_clientsession(hass)
if city and state and country:
_LOGGER.debug(
"Using city, state, and country: %s, %s, %s", city, state, country)
location_id = ','.join((city, state, country))
data = AirVisualData(
Client(websession, api_key=config[CONF_API_KEY]),
city=city,
state=state,
country=country,
show_on_map=config[CONF_SHOW_ON_MAP],
scan_interval=config[CONF_SCAN_INTERVAL])
else:
_LOGGER.debug(
"Using latitude and longitude: %s, %s", latitude, longitude)
location_id = ','.join((str(latitude), str(longitude)))
data = AirVisualData(
Client(websession, api_key=config[CONF_API_KEY]),
latitude=latitude,
longitude=longitude,
show_on_map=config[CONF_SHOW_ON_MAP],
scan_interval=config[CONF_SCAN_INTERVAL])
await data.async_update()
sensors = []
for locale in config[CONF_MONITORED_CONDITIONS]:
for kind, name, icon, unit in SENSORS:
sensors.append(
AirVisualSensor(
data, kind, name, icon, unit, locale, location_id))
async_add_entities(sensors, True)
class AirVisualSensor(Entity):
"""Define an AirVisual sensor."""
def __init__(self, airvisual, kind, name, icon, unit, locale, location_id):
"""Initialize."""
self._attrs = {ATTR_ATTRIBUTION: DEFAULT_ATTRIBUTION}
self._icon = icon
self._locale = locale
self._location_id = location_id
self._name = name
self._state = None
self._type = kind
self._unit = unit
self.airvisual = airvisual
@property
def device_state_attributes(self):
"""Return the device state attributes."""
if self.airvisual.show_on_map:
self._attrs[ATTR_LATITUDE] = self.airvisual.latitude
self._attrs[ATTR_LONGITUDE] = self.airvisual.longitude
else:
self._attrs['lati'] = self.airvisual.latitude
self._attrs['long'] = self.airvisual.longitude
return self._attrs
@property
def available(self):
"""Return True if entity is available."""
return bool(self.airvisual.pollution_info)
@property
def icon(self):
"""Return the icon."""
return self._icon
@property
def name(self):
"""Return the name."""
return '{0} {1}'.format(SENSOR_LOCALES[self._locale], self._name)
@property
def state(self):
"""Return the state."""
return self._state
@property
def unique_id(self):
"""Return a unique, HASS-friendly identifier for this entity."""
return '{0}_{1}_{2}'.format(
self._location_id, self._locale, self._type)
@property
def unit_of_measurement(self):
"""Return the unit the value is expressed in."""
return self._unit
async def async_update(self):
"""Update the sensor."""
await self.airvisual.async_update()
data = self.airvisual.pollution_info
if not data:
return
if self._type == SENSOR_TYPE_LEVEL:
aqi = data['aqi{0}'.format(self._locale)]
[level] = [
i for i in POLLUTANT_LEVEL_MAPPING
if i['minimum'] <= aqi <= i['maximum']
]
self._state = level['label']
self._icon = level['icon']
elif self._type == SENSOR_TYPE_AQI:
self._state = data['aqi{0}'.format(self._locale)]
elif self._type == SENSOR_TYPE_POLLUTANT:
symbol = data['main{0}'.format(self._locale)]
self._state = POLLUTANT_MAPPING[symbol]['label']
self._attrs.update({
ATTR_POLLUTANT_SYMBOL: symbol,
ATTR_POLLUTANT_UNIT: POLLUTANT_MAPPING[symbol]['unit']
})
class AirVisualData:
"""Define an object to hold sensor data."""
def __init__(self, client, **kwargs):
"""Initialize."""
self._client = client
self.city = kwargs.get(CONF_CITY)
self.country = kwargs.get(CONF_COUNTRY)
self.latitude = kwargs.get(CONF_LATITUDE)
self.longitude = kwargs.get(CONF_LONGITUDE)
self.pollution_info = {}
self.show_on_map = kwargs.get(CONF_SHOW_ON_MAP)
self.state = kwargs.get(CONF_STATE)
self.async_update = Throttle(
kwargs[CONF_SCAN_INTERVAL])(self._async_update)
async def _async_update(self):
"""Update AirVisual data."""
from pyairvisual.errors import AirVisualError
try:
if self.city and self.state and self.country:
resp = await self._client.api.city(
self.city, self.state, self.country)
self.longitude, self.latitude = resp['location']['coordinates']
else:
resp = await self._client.api.nearest_city(
self.latitude, self.longitude)
_LOGGER.debug("New data retrieved: %s", resp)
self.pollution_info = resp['current']['pollution']
except (KeyError, AirVisualError) as err:
if self.city and self.state and self.country:
location = (self.city, self.state, self.country)
else:
location = (self.latitude, self.longitude)
_LOGGER.error(
"Can't retrieve data for location: %s (%s)", location,
err)
self.pollution_info = {}

View File

@@ -0,0 +1 @@
"""The aladdin_connect component."""

View File

@@ -0,0 +1,113 @@
"""Platform for the Aladdin Connect cover component."""
import logging
import voluptuous as vol
from homeassistant.components.cover import (CoverDevice, PLATFORM_SCHEMA,
SUPPORT_OPEN, SUPPORT_CLOSE)
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, STATE_CLOSED,
STATE_OPENING, STATE_CLOSING, STATE_OPEN)
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
NOTIFICATION_ID = 'aladdin_notification'
NOTIFICATION_TITLE = 'Aladdin Connect Cover Setup'
STATES_MAP = {
'open': STATE_OPEN,
'opening': STATE_OPENING,
'closed': STATE_CLOSED,
'closing': STATE_CLOSING
}
SUPPORTED_FEATURES = SUPPORT_OPEN | SUPPORT_CLOSE
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Aladdin Connect platform."""
from aladdin_connect import AladdinConnectClient
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
acc = AladdinConnectClient(username, password)
try:
if not acc.login():
raise ValueError("Username or Password is incorrect")
add_entities(AladdinDevice(acc, door) for door in acc.get_doors())
except (TypeError, KeyError, NameError, ValueError) as ex:
_LOGGER.error("%s", ex)
hass.components.persistent_notification.create(
'Error: {}<br />'
'You will need to restart hass after fixing.'
''.format(ex),
title=NOTIFICATION_TITLE,
notification_id=NOTIFICATION_ID)
class AladdinDevice(CoverDevice):
"""Representation of Aladdin Connect cover."""
def __init__(self, acc, device):
"""Initialize the cover."""
self._acc = acc
self._device_id = device['device_id']
self._number = device['door_number']
self._name = device['name']
self._status = STATES_MAP.get(device['status'])
@property
def device_class(self):
"""Define this cover as a garage door."""
return 'garage'
@property
def supported_features(self):
"""Flag supported features."""
return SUPPORTED_FEATURES
@property
def unique_id(self):
"""Return a unique ID."""
return '{}-{}'.format(self._device_id, self._number)
@property
def name(self):
"""Return the name of the garage door."""
return self._name
@property
def is_opening(self):
"""Return if the cover is opening or not."""
return self._status == STATE_OPENING
@property
def is_closing(self):
"""Return if the cover is closing or not."""
return self._status == STATE_CLOSING
@property
def is_closed(self):
"""Return None if status is unknown, True if closed, else False."""
if self._status is None:
return None
return self._status == STATE_CLOSED
def close_cover(self, **kwargs):
"""Issue close command to cover."""
self._acc.close_door(self._device_id, self._number)
def open_cover(self, **kwargs):
"""Issue open command to cover."""
self._acc.open_door(self._device_id, self._number)
def update(self):
"""Update status of cover."""
acc_status = self._acc.get_door_status(self._device_id, self._number)
self._status = STATES_MAP.get(acc_status)

View File

@@ -0,0 +1,10 @@
{
"domain": "aladdin_connect",
"name": "Aladdin connect",
"documentation": "https://www.home-assistant.io/components/aladdin_connect",
"requirements": [
"aladdin_connect==0.3"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
"""
Component to interface with an alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel/
"""
"""Component to interface with an alarm control panel."""
from datetime import timedelta
import logging
@@ -13,7 +8,8 @@ from homeassistant.const import (
ATTR_CODE, ATTR_CODE_FORMAT, ATTR_ENTITY_ID, SERVICE_ALARM_TRIGGER,
SERVICE_ALARM_DISARM, SERVICE_ALARM_ARM_HOME, SERVICE_ALARM_ARM_AWAY,
SERVICE_ALARM_ARM_NIGHT, SERVICE_ALARM_ARM_CUSTOM_BYPASS)
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa
from homeassistant.helpers.config_validation import ( # noqa
PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent

View File

@@ -1,85 +0,0 @@
"""
This component provides HA alarm_control_panel support for Abode System.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.abode/
"""
import logging
from homeassistant.components.abode import CONF_ATTRIBUTION, AbodeDevice
from homeassistant.components.abode import DOMAIN as ABODE_DOMAIN
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)
DEPENDENCIES = ['abode']
_LOGGER = logging.getLogger(__name__)
ICON = 'mdi:security'
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up an alarm control panel for an Abode device."""
data = hass.data[ABODE_DOMAIN]
alarm_devices = [AbodeAlarm(data, data.abode.get_alarm(), data.name)]
data.devices.extend(alarm_devices)
add_entities(alarm_devices)
class AbodeAlarm(AbodeDevice, AlarmControlPanel):
"""An alarm_control_panel implementation for Abode."""
def __init__(self, data, device, name):
"""Initialize the alarm control panel."""
super().__init__(data, device)
self._name = name
@property
def icon(self):
"""Return the icon."""
return ICON
@property
def state(self):
"""Return the state of the device."""
if self._device.is_standby:
state = STATE_ALARM_DISARMED
elif self._device.is_away:
state = STATE_ALARM_ARMED_AWAY
elif self._device.is_home:
state = STATE_ALARM_ARMED_HOME
else:
state = None
return state
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._device.set_standby()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._device.set_home()
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._device.set_away()
@property
def name(self):
"""Return the name of the alarm."""
return self._name or super().name
@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,
}

View File

@@ -1,142 +0,0 @@
"""
Support for AlarmDecoder-based alarm control panels (Honeywell/DSC).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.alarmdecoder/
"""
import logging
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarmdecoder import DATA_AD, SIGNAL_PANEL_MESSAGE
from homeassistant.const import (
ATTR_CODE, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED, STATE_ALARM_TRIGGERED)
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['alarmdecoder']
SERVICE_ALARM_TOGGLE_CHIME = 'alarmdecoder_alarm_toggle_chime'
ALARM_TOGGLE_CHIME_SCHEMA = vol.Schema({
vol.Required(ATTR_CODE): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up for AlarmDecoder alarm panels."""
device = AlarmDecoderAlarmPanel()
add_entities([device])
def alarm_toggle_chime_handler(service):
"""Register toggle chime handler."""
code = service.data.get(ATTR_CODE)
device.alarm_toggle_chime(code)
hass.services.register(
alarm.DOMAIN, SERVICE_ALARM_TOGGLE_CHIME, alarm_toggle_chime_handler,
schema=ALARM_TOGGLE_CHIME_SCHEMA)
class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
"""Representation of an AlarmDecoder-based alarm panel."""
def __init__(self):
"""Initialize the alarm panel."""
self._display = ""
self._name = "Alarm Panel"
self._state = None
self._ac_power = None
self._backlight_on = None
self._battery_low = None
self._check_zone = None
self._chime = None
self._entry_delay_off = None
self._programming_mode = None
self._ready = None
self._zone_bypassed = None
async def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
SIGNAL_PANEL_MESSAGE, self._message_callback)
def _message_callback(self, message):
"""Handle received messages."""
if message.alarm_sounding or message.fire_alarm:
self._state = STATE_ALARM_TRIGGERED
elif message.armed_away:
self._state = STATE_ALARM_ARMED_AWAY
elif message.armed_home:
self._state = STATE_ALARM_ARMED_HOME
else:
self._state = STATE_ALARM_DISARMED
self._ac_power = message.ac_power
self._backlight_on = message.backlight_on
self._battery_low = message.battery_low
self._check_zone = message.check_zone
self._chime = message.chime_on
self._entry_delay_off = message.entry_delay_off
self._programming_mode = message.programming_mode
self._ready = message.ready
self._zone_bypassed = message.zone_bypassed
self.schedule_update_ha_state()
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def should_poll(self):
"""Return the polling state."""
return False
@property
def code_format(self):
"""Return one or more digits/characters."""
return alarm.FORMAT_NUMBER
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
'ac_power': self._ac_power,
'backlight_on': self._backlight_on,
'battery_low': self._battery_low,
'check_zone': self._check_zone,
'chime': self._chime,
'entry_delay_off': self._entry_delay_off,
'programming_mode': self._programming_mode,
'ready': self._ready,
'zone_bypassed': self._zone_bypassed,
}
def alarm_disarm(self, code=None):
"""Send disarm command."""
if code:
self.hass.data[DATA_AD].send("{!s}1".format(code))
def alarm_arm_away(self, code=None):
"""Send arm away command."""
if code:
self.hass.data[DATA_AD].send("{!s}2".format(code))
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if code:
self.hass.data[DATA_AD].send("{!s}3".format(code))
def alarm_toggle_chime(self, code=None):
"""Send toggle chime command."""
if code:
self.hass.data[DATA_AD].send("{!s}9".format(code))

View File

@@ -1,125 +0,0 @@
"""
Interfaces with Alarm.com alarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.alarmdotcom/
"""
import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_CODE, CONF_NAME, CONF_PASSWORD, CONF_USERNAME, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED, STATE_UNKNOWN)
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pyalarmdotcom==0.3.2']
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'Alarm.com'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Optional(CONF_CODE): cv.positive_int,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up a Alarm.com control panel."""
name = config.get(CONF_NAME)
code = config.get(CONF_CODE)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
alarmdotcom = AlarmDotCom(hass, name, code, username, password)
await alarmdotcom.async_login()
async_add_entities([alarmdotcom])
class AlarmDotCom(alarm.AlarmControlPanel):
"""Representation of an Alarm.com status."""
def __init__(self, hass, name, code, username, password):
"""Initialize the Alarm.com status."""
from pyalarmdotcom import Alarmdotcom
_LOGGER.debug('Setting up Alarm.com...')
self._hass = hass
self._name = name
self._code = str(code) if code else None
self._username = username
self._password = password
self._websession = async_get_clientsession(self._hass)
self._state = STATE_UNKNOWN
self._alarm = Alarmdotcom(
username, password, self._websession, hass.loop)
async def async_login(self):
"""Login to Alarm.com."""
await self._alarm.async_login()
async def async_update(self):
"""Fetch the latest state."""
await self._alarm.async_update()
return self._alarm.state
@property
def name(self):
"""Return the name of the alarm."""
return self._name
@property
def code_format(self):
"""Return one or more digits/characters."""
if self._code is None:
return None
if isinstance(self._code, str) and re.search('^\\d+$', self._code):
return alarm.FORMAT_NUMBER
return alarm.FORMAT_TEXT
@property
def state(self):
"""Return the state of the device."""
if self._alarm.state.lower() == 'disarmed':
return STATE_ALARM_DISARMED
if self._alarm.state.lower() == 'armed stay':
return STATE_ALARM_ARMED_HOME
if self._alarm.state.lower() == 'armed away':
return STATE_ALARM_ARMED_AWAY
return STATE_UNKNOWN
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
'sensor_status': self._alarm.sensor_status
}
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
if self._validate_code(code):
await self._alarm.async_alarm_disarm()
async def async_alarm_arm_home(self, code=None):
"""Send arm hom command."""
if self._validate_code(code):
await self._alarm.async_alarm_arm_home()
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
if self._validate_code(code):
await self._alarm.async_alarm_arm_away()
def _validate_code(self, code):
"""Validate given code."""
check = self._code is None or code == self._code
if not check:
_LOGGER.warning("Wrong code entered")
return check

View File

@@ -1,141 +0,0 @@
"""
Support for Arlo Alarm Control Panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.arlo/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.alarm_control_panel import (
AlarmControlPanel, PLATFORM_SCHEMA)
from homeassistant.components.arlo import (
DATA_ARLO, CONF_ATTRIBUTION, SIGNAL_UPDATE_ARLO)
from homeassistant.const import (
ATTR_ATTRIBUTION, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_NIGHT)
_LOGGER = logging.getLogger(__name__)
ARMED = 'armed'
CONF_HOME_MODE_NAME = 'home_mode_name'
CONF_AWAY_MODE_NAME = 'away_mode_name'
CONF_NIGHT_MODE_NAME = 'night_mode_name'
DEPENDENCIES = ['arlo']
DISARMED = 'disarmed'
ICON = 'mdi:security'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_HOME_MODE_NAME, default=ARMED): cv.string,
vol.Optional(CONF_AWAY_MODE_NAME, default=ARMED): cv.string,
vol.Optional(CONF_NIGHT_MODE_NAME, default=ARMED): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Arlo Alarm Control Panels."""
arlo = hass.data[DATA_ARLO]
if not arlo.base_stations:
return
home_mode_name = config.get(CONF_HOME_MODE_NAME)
away_mode_name = config.get(CONF_AWAY_MODE_NAME)
night_mode_name = config.get(CONF_NIGHT_MODE_NAME)
base_stations = []
for base_station in arlo.base_stations:
base_stations.append(ArloBaseStation(base_station, home_mode_name,
away_mode_name, night_mode_name))
add_entities(base_stations, True)
class ArloBaseStation(AlarmControlPanel):
"""Representation of an Arlo Alarm Control Panel."""
def __init__(self, data, home_mode_name, away_mode_name, night_mode_name):
"""Initialize the alarm control panel."""
self._base_station = data
self._home_mode_name = home_mode_name
self._away_mode_name = away_mode_name
self._night_mode_name = night_mode_name
self._state = None
@property
def icon(self):
"""Return icon."""
return ICON
async def async_added_to_hass(self):
"""Register callbacks."""
async_dispatcher_connect(
self.hass, SIGNAL_UPDATE_ARLO, self._update_callback)
@callback
def _update_callback(self):
"""Call update method."""
self.async_schedule_update_ha_state(True)
@property
def state(self):
"""Return the state of the device."""
return self._state
def update(self):
"""Update the state of the device."""
_LOGGER.debug("Updating Arlo Alarm Control Panel %s", self.name)
mode = self._base_station.mode
if mode:
self._state = self._get_state_from_mode(mode)
else:
self._state = None
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
self._base_station.mode = DISARMED
async def async_alarm_arm_away(self, code=None):
"""Send arm away command. Uses custom mode."""
self._base_station.mode = self._away_mode_name
async def async_alarm_arm_home(self, code=None):
"""Send arm home command. Uses custom mode."""
self._base_station.mode = self._home_mode_name
async def async_alarm_arm_night(self, code=None):
"""Send arm night command. Uses custom mode."""
self._base_station.mode = self._night_mode_name
@property
def name(self):
"""Return the name of the base station."""
return self._base_station.name
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
'device_id': self._base_station.device_id
}
def _get_state_from_mode(self, mode):
"""Convert Arlo mode to Home Assistant state."""
if mode == ARMED:
return STATE_ALARM_ARMED_AWAY
if mode == DISARMED:
return STATE_ALARM_DISARMED
if mode == self._home_mode_name:
return STATE_ALARM_ARMED_HOME
if mode == self._away_mode_name:
return STATE_ALARM_ARMED_AWAY
if mode == self._night_mode_name:
return STATE_ALARM_ARMED_NIGHT
return mode

View File

@@ -1,91 +0,0 @@
"""
Support for Blink Alarm Control Panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.blink/
"""
import logging
from homeassistant.components.alarm_control_panel import AlarmControlPanel
from homeassistant.components.blink import (
BLINK_DATA, DEFAULT_ATTRIBUTION)
from homeassistant.const import (
ATTR_ATTRIBUTION, STATE_ALARM_DISARMED, STATE_ALARM_ARMED_AWAY)
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['blink']
ICON = 'mdi:security'
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Arlo Alarm Control Panels."""
if discovery_info is None:
return
data = hass.data[BLINK_DATA]
sync_modules = []
for sync_name, sync_module in data.sync.items():
sync_modules.append(BlinkSyncModule(data, sync_name, sync_module))
add_entities(sync_modules, True)
class BlinkSyncModule(AlarmControlPanel):
"""Representation of a Blink Alarm Control Panel."""
def __init__(self, data, name, sync):
"""Initialize the alarm control panel."""
self.data = data
self.sync = sync
self._name = name
self._state = None
@property
def unique_id(self):
"""Return the unique id for the sync module."""
return self.sync.serial
@property
def icon(self):
"""Return icon."""
return ICON
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def name(self):
"""Return the name of the panel."""
return "{} {}".format(BLINK_DATA, self._name)
@property
def device_state_attributes(self):
"""Return the state attributes."""
attr = self.sync.attributes
attr['network_info'] = self.data.networks
attr['associated_cameras'] = list(self.sync.cameras.keys())
attr[ATTR_ATTRIBUTION] = DEFAULT_ATTRIBUTION
return attr
def update(self):
"""Update the state of the device."""
_LOGGER.debug("Updating Blink Alarm Control Panel %s", self._name)
self.data.refresh()
mode = self.sync.arm
if mode:
self._state = STATE_ALARM_ARMED_AWAY
else:
self._state = STATE_ALARM_DISARMED
def alarm_disarm(self, code=None):
"""Send disarm command."""
self.sync.arm = False
self.sync.refresh()
def alarm_arm_away(self, code=None):
"""Send arm command."""
self.sync.arm = True
self.sync.refresh()

View File

@@ -1,91 +0,0 @@
"""
Support for Canary alarm.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.canary/
"""
import logging
from homeassistant.components.alarm_control_panel import AlarmControlPanel
from homeassistant.components.canary import DATA_CANARY
from homeassistant.const import STATE_ALARM_DISARMED, STATE_ALARM_ARMED_AWAY, \
STATE_ALARM_ARMED_NIGHT, STATE_ALARM_ARMED_HOME
DEPENDENCIES = ['canary']
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Canary alarms."""
data = hass.data[DATA_CANARY]
devices = []
for location in data.locations:
devices.append(CanaryAlarm(data, location.location_id))
add_entities(devices, True)
class CanaryAlarm(AlarmControlPanel):
"""Representation of a Canary alarm control panel."""
def __init__(self, data, location_id):
"""Initialize a Canary security camera."""
self._data = data
self._location_id = location_id
@property
def name(self):
"""Return the name of the alarm."""
location = self._data.get_location(self._location_id)
return location.name
@property
def state(self):
"""Return the state of the device."""
from canary.api import LOCATION_MODE_AWAY, LOCATION_MODE_HOME, \
LOCATION_MODE_NIGHT
location = self._data.get_location(self._location_id)
if location.is_private:
return STATE_ALARM_DISARMED
mode = location.mode
if mode.name == LOCATION_MODE_AWAY:
return STATE_ALARM_ARMED_AWAY
if mode.name == LOCATION_MODE_HOME:
return STATE_ALARM_ARMED_HOME
if mode.name == LOCATION_MODE_NIGHT:
return STATE_ALARM_ARMED_NIGHT
return None
@property
def device_state_attributes(self):
"""Return the state attributes."""
location = self._data.get_location(self._location_id)
return {
'private': location.is_private
}
def alarm_disarm(self, code=None):
"""Send disarm command."""
location = self._data.get_location(self._location_id)
self._data.set_location_mode(self._location_id, location.mode.name,
True)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
from canary.api import LOCATION_MODE_HOME
self._data.set_location_mode(self._location_id, LOCATION_MODE_HOME)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
from canary.api import LOCATION_MODE_AWAY
self._data.set_location_mode(self._location_id, LOCATION_MODE_AWAY)
def alarm_arm_night(self, code=None):
"""Send arm night command."""
from canary.api import LOCATION_MODE_NIGHT
self._data.set_location_mode(self._location_id, LOCATION_MODE_NIGHT)

View File

@@ -1,124 +0,0 @@
"""
Support for Concord232 alarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.concord232/
"""
import datetime
from datetime import timedelta
import logging
import requests
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_HOST, CONF_NAME, CONF_PORT, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED, STATE_UNKNOWN)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['concord232==0.15']
_LOGGER = logging.getLogger(__name__)
DEFAULT_HOST = 'localhost'
DEFAULT_NAME = 'CONCORD232'
DEFAULT_PORT = 5007
SCAN_INTERVAL = timedelta(seconds=10)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Concord232 alarm control panel platform."""
name = config.get(CONF_NAME)
host = config.get(CONF_HOST)
port = config.get(CONF_PORT)
url = 'http://{}:{}'.format(host, port)
try:
add_entities([Concord232Alarm(hass, url, name)])
except requests.exceptions.ConnectionError as ex:
_LOGGER.error("Unable to connect to Concord232: %s", str(ex))
return
class Concord232Alarm(alarm.AlarmControlPanel):
"""Representation of the Concord232-based alarm panel."""
def __init__(self, hass, url, name):
"""Initialize the Concord232 alarm panel."""
from concord232 import client as concord232_client
self._state = STATE_UNKNOWN
self._hass = hass
self._name = name
self._url = url
try:
client = concord232_client.Client(self._url)
except requests.exceptions.ConnectionError as ex:
_LOGGER.error("Unable to connect to Concord232: %s", str(ex))
self._alarm = client
self._alarm.partitions = self._alarm.list_partitions()
self._alarm.last_partition_update = datetime.datetime.now()
self.update()
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def code_format(self):
"""Return the characters if code is defined."""
return alarm.FORMAT_NUMBER
@property
def state(self):
"""Return the state of the device."""
return self._state
def update(self):
"""Update values from API."""
try:
part = self._alarm.list_partitions()[0]
except requests.exceptions.ConnectionError as ex:
_LOGGER.error("Unable to connect to %(host)s: %(reason)s",
dict(host=self._url, reason=ex))
newstate = STATE_UNKNOWN
except IndexError:
_LOGGER.error("Concord232 reports no partitions")
newstate = STATE_UNKNOWN
if part['arming_level'] == 'Off':
newstate = STATE_ALARM_DISARMED
elif 'Home' in part['arming_level']:
newstate = STATE_ALARM_ARMED_HOME
else:
newstate = STATE_ALARM_ARMED_AWAY
if not newstate == self._state:
_LOGGER.info("State change from %s to %s", self._state, newstate)
self._state = newstate
return self._state
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._alarm.disarm(code)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._alarm.arm('stay')
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._alarm.arm('away')

View File

@@ -1,49 +0,0 @@
"""
Demo platform that has two fake alarm control panels.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
import datetime
from homeassistant.components.alarm_control_panel import manual
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED, STATE_ALARM_TRIGGERED, CONF_DELAY_TIME,
CONF_PENDING_TIME, CONF_TRIGGER_TIME)
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the Demo alarm control panel platform."""
async_add_entities([
manual.ManualAlarm(hass, 'Alarm', '1234', None, False, {
STATE_ALARM_ARMED_AWAY: {
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_PENDING_TIME: datetime.timedelta(seconds=5),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_ARMED_HOME: {
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_PENDING_TIME: datetime.timedelta(seconds=5),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_ARMED_NIGHT: {
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_PENDING_TIME: datetime.timedelta(seconds=5),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_DISARMED: {
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_ARMED_CUSTOM_BYPASS: {
CONF_DELAY_TIME: datetime.timedelta(seconds=0),
CONF_PENDING_TIME: datetime.timedelta(seconds=5),
CONF_TRIGGER_TIME: datetime.timedelta(seconds=10),
},
STATE_ALARM_TRIGGERED: {
CONF_PENDING_TIME: datetime.timedelta(seconds=5),
},
}),
])

View File

@@ -1,142 +0,0 @@
"""
Interfaces with Egardia/Woonveilig alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.egardia/
"""
import logging
import requests
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY, STATE_ALARM_TRIGGERED,
STATE_ALARM_ARMED_NIGHT)
from homeassistant.components.egardia import (
EGARDIA_DEVICE, EGARDIA_SERVER,
REPORT_SERVER_CODES_IGNORE, CONF_REPORT_SERVER_CODES,
CONF_REPORT_SERVER_ENABLED, CONF_REPORT_SERVER_PORT
)
DEPENDENCIES = ['egardia']
_LOGGER = logging.getLogger(__name__)
STATES = {
'ARM': STATE_ALARM_ARMED_AWAY,
'DAY HOME': STATE_ALARM_ARMED_HOME,
'DISARM': STATE_ALARM_DISARMED,
'ARMHOME': STATE_ALARM_ARMED_HOME,
'HOME': STATE_ALARM_ARMED_HOME,
'NIGHT HOME': STATE_ALARM_ARMED_NIGHT,
'TRIGGERED': STATE_ALARM_TRIGGERED
}
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Egardia platform."""
if discovery_info is None:
return
device = EgardiaAlarm(
discovery_info['name'],
hass.data[EGARDIA_DEVICE],
discovery_info[CONF_REPORT_SERVER_ENABLED],
discovery_info.get(CONF_REPORT_SERVER_CODES),
discovery_info[CONF_REPORT_SERVER_PORT])
# add egardia alarm device
add_entities([device], True)
class EgardiaAlarm(alarm.AlarmControlPanel):
"""Representation of a Egardia alarm."""
def __init__(self, name, egardiasystem,
rs_enabled=False, rs_codes=None, rs_port=52010):
"""Initialize the Egardia alarm."""
self._name = name
self._egardiasystem = egardiasystem
self._status = None
self._rs_enabled = rs_enabled
self._rs_codes = rs_codes
self._rs_port = rs_port
async def async_added_to_hass(self):
"""Add Egardiaserver callback if enabled."""
if self._rs_enabled:
_LOGGER.debug("Registering callback to Egardiaserver")
self.hass.data[EGARDIA_SERVER].register_callback(
self.handle_status_event)
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def state(self):
"""Return the state of the device."""
return self._status
@property
def should_poll(self):
"""Poll if no report server is enabled."""
if not self._rs_enabled:
return True
return False
def handle_status_event(self, event):
"""Handle the Egardia system status event."""
statuscode = event.get('status')
if statuscode is not None:
status = self.lookupstatusfromcode(statuscode)
self.parsestatus(status)
self.schedule_update_ha_state()
def lookupstatusfromcode(self, statuscode):
"""Look at the rs_codes and returns the status from the code."""
status = next((
status_group.upper() for status_group, codes
in self._rs_codes.items() for code in codes
if statuscode == code), 'UNKNOWN')
return status
def parsestatus(self, status):
"""Parse the status."""
_LOGGER.debug("Parsing status %s", status)
# Ignore the statuscode if it is IGNORE
if status.lower().strip() != REPORT_SERVER_CODES_IGNORE:
_LOGGER.debug("Not ignoring status %s", status)
newstatus = STATES.get(status.upper())
_LOGGER.debug("newstatus %s", newstatus)
self._status = newstatus
else:
_LOGGER.error("Ignoring status")
def update(self):
"""Update the alarm status."""
status = self._egardiasystem.getstate()
self.parsestatus(status)
def alarm_disarm(self, code=None):
"""Send disarm command."""
try:
self._egardiasystem.alarm_disarm()
except requests.exceptions.RequestException as err:
_LOGGER.error("Egardia device exception occurred when "
"sending disarm command: %s", err)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
try:
self._egardiasystem.alarm_arm_home()
except requests.exceptions.RequestException as err:
_LOGGER.error("Egardia device exception occurred when "
"sending arm home command: %s", err)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
try:
self._egardiasystem.alarm_arm_away()
except requests.exceptions.RequestException as err:
_LOGGER.error("Egardia device exception occurred when "
"sending arm away command: %s", err)

View File

@@ -1,204 +0,0 @@
"""
Each ElkM1 area will be created as a separate alarm_control_panel in HASS.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.elkm1/
"""
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
ATTR_CODE, ATTR_ENTITY_ID, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT, STATE_ALARM_ARMING, STATE_ALARM_DISARMED,
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED)
from homeassistant.components.elkm1 import (
DOMAIN as ELK_DOMAIN, create_elk_entities, ElkEntity)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect, async_dispatcher_send)
DEPENDENCIES = [ELK_DOMAIN]
SIGNAL_ARM_ENTITY = 'elkm1_arm'
SIGNAL_DISPLAY_MESSAGE = 'elkm1_display_message'
ELK_ALARM_SERVICE_SCHEMA = vol.Schema({
vol.Required(ATTR_ENTITY_ID, default=[]): cv.entity_ids,
vol.Required(ATTR_CODE): vol.All(vol.Coerce(int), vol.Range(0, 999999)),
})
DISPLAY_MESSAGE_SERVICE_SCHEMA = vol.Schema({
vol.Optional(ATTR_ENTITY_ID, default=[]): cv.entity_ids,
vol.Optional('clear', default=2): vol.In([0, 1, 2]),
vol.Optional('beep', default=False): cv.boolean,
vol.Optional('timeout', default=0): vol.Range(min=0, max=65535),
vol.Optional('line1', default=''): cv.string,
vol.Optional('line2', default=''): cv.string,
})
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the ElkM1 alarm platform."""
if discovery_info is None:
return
elk = hass.data[ELK_DOMAIN]['elk']
entities = create_elk_entities(hass, elk.areas, 'area', ElkArea, [])
async_add_entities(entities, True)
def _dispatch(signal, entity_ids, *args):
for entity_id in entity_ids:
async_dispatcher_send(
hass, '{}_{}'.format(signal, entity_id), *args)
def _arm_service(service):
entity_ids = service.data.get(ATTR_ENTITY_ID, [])
arm_level = _arm_services().get(service.service)
args = (arm_level, service.data.get(ATTR_CODE))
_dispatch(SIGNAL_ARM_ENTITY, entity_ids, *args)
for service in _arm_services():
hass.services.async_register(
alarm.DOMAIN, service, _arm_service, ELK_ALARM_SERVICE_SCHEMA)
def _display_message_service(service):
entity_ids = service.data.get(ATTR_ENTITY_ID, [])
data = service.data
args = (data['clear'], data['beep'], data['timeout'],
data['line1'], data['line2'])
_dispatch(SIGNAL_DISPLAY_MESSAGE, entity_ids, *args)
hass.services.async_register(
alarm.DOMAIN, 'elkm1_alarm_display_message',
_display_message_service, DISPLAY_MESSAGE_SERVICE_SCHEMA)
def _arm_services():
from elkm1_lib.const import ArmLevel
return {
'elkm1_alarm_arm_vacation': ArmLevel.ARMED_VACATION.value,
'elkm1_alarm_arm_home_instant': ArmLevel.ARMED_STAY_INSTANT.value,
'elkm1_alarm_arm_night_instant': ArmLevel.ARMED_NIGHT_INSTANT.value,
}
class ElkArea(ElkEntity, alarm.AlarmControlPanel):
"""Representation of an Area / Partition within the ElkM1 alarm panel."""
def __init__(self, element, elk, elk_data):
"""Initialize Area as Alarm Control Panel."""
super().__init__(element, elk, elk_data)
self._changed_by_entity_id = ''
self._state = None
async def async_added_to_hass(self):
"""Register callback for ElkM1 changes."""
await super().async_added_to_hass()
for keypad in self._elk.keypads:
keypad.add_callback(self._watch_keypad)
async_dispatcher_connect(
self.hass, '{}_{}'.format(SIGNAL_ARM_ENTITY, self.entity_id),
self._arm_service)
async_dispatcher_connect(
self.hass, '{}_{}'.format(SIGNAL_DISPLAY_MESSAGE, self.entity_id),
self._display_message)
def _watch_keypad(self, keypad, changeset):
if keypad.area != self._element.index:
return
if changeset.get('last_user') is not None:
self._changed_by_entity_id = self.hass.data[
ELK_DOMAIN]['keypads'].get(keypad.index, '')
self.async_schedule_update_ha_state(True)
@property
def code_format(self):
"""Return the alarm code format."""
return alarm.FORMAT_NUMBER
@property
def state(self):
"""Return the state of the element."""
return self._state
@property
def device_state_attributes(self):
"""Attributes of the area."""
from elkm1_lib.const import AlarmState, ArmedStatus, ArmUpState
attrs = self.initial_attrs()
elmt = self._element
attrs['is_exit'] = elmt.is_exit
attrs['timer1'] = elmt.timer1
attrs['timer2'] = elmt.timer2
if elmt.armed_status is not None:
attrs['armed_status'] = \
ArmedStatus(elmt.armed_status).name.lower()
if elmt.arm_up_state is not None:
attrs['arm_up_state'] = ArmUpState(elmt.arm_up_state).name.lower()
if elmt.alarm_state is not None:
attrs['alarm_state'] = AlarmState(elmt.alarm_state).name.lower()
attrs['changed_by_entity_id'] = self._changed_by_entity_id
return attrs
def _element_changed(self, element, changeset):
from elkm1_lib.const import ArmedStatus
elk_state_to_hass_state = {
ArmedStatus.DISARMED.value: STATE_ALARM_DISARMED,
ArmedStatus.ARMED_AWAY.value: STATE_ALARM_ARMED_AWAY,
ArmedStatus.ARMED_STAY.value: STATE_ALARM_ARMED_HOME,
ArmedStatus.ARMED_STAY_INSTANT.value: STATE_ALARM_ARMED_HOME,
ArmedStatus.ARMED_TO_NIGHT.value: STATE_ALARM_ARMED_NIGHT,
ArmedStatus.ARMED_TO_NIGHT_INSTANT.value: STATE_ALARM_ARMED_NIGHT,
ArmedStatus.ARMED_TO_VACATION.value: STATE_ALARM_ARMED_AWAY,
}
if self._element.alarm_state is None:
self._state = None
elif self._area_is_in_alarm_state():
self._state = STATE_ALARM_TRIGGERED
elif self._entry_exit_timer_is_running():
self._state = STATE_ALARM_ARMING \
if self._element.is_exit else STATE_ALARM_PENDING
else:
self._state = elk_state_to_hass_state[self._element.armed_status]
def _entry_exit_timer_is_running(self):
return self._element.timer1 > 0 or self._element.timer2 > 0
def _area_is_in_alarm_state(self):
from elkm1_lib.const import AlarmState
return self._element.alarm_state >= AlarmState.FIRE_ALARM.value
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
self._element.disarm(int(code))
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
from elkm1_lib.const import ArmLevel
self._element.arm(ArmLevel.ARMED_STAY.value, int(code))
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
from elkm1_lib.const import ArmLevel
self._element.arm(ArmLevel.ARMED_AWAY.value, int(code))
async def async_alarm_arm_night(self, code=None):
"""Send arm night command."""
from elkm1_lib.const import ArmLevel
self._element.arm(ArmLevel.ARMED_NIGHT.value, int(code))
async def _arm_service(self, arm_level, code):
self._element.arm(arm_level, code)
async def _display_message(self, clear, beep, timeout, line1, line2):
"""Display a message on all keypads for the area."""
self._element.display_message(clear, beep, timeout, line1, line2)

View File

@@ -1,164 +0,0 @@
"""
Support for Envisalink-based alarm control panels (Honeywell/DSC).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.envisalink/
"""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
import homeassistant.components.alarm_control_panel as alarm
import homeassistant.helpers.config_validation as cv
from homeassistant.components.envisalink import (
DATA_EVL, EnvisalinkDevice, PARTITION_SCHEMA, CONF_CODE, CONF_PANIC,
CONF_PARTITIONNAME, SIGNAL_KEYPAD_UPDATE, SIGNAL_PARTITION_UPDATE)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN, STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING, ATTR_ENTITY_ID)
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['envisalink']
SERVICE_ALARM_KEYPRESS = 'envisalink_alarm_keypress'
ATTR_KEYPRESS = 'keypress'
ALARM_KEYPRESS_SCHEMA = vol.Schema({
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
vol.Required(ATTR_KEYPRESS): cv.string
})
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Perform the setup for Envisalink alarm panels."""
configured_partitions = discovery_info['partitions']
code = discovery_info[CONF_CODE]
panic_type = discovery_info[CONF_PANIC]
devices = []
for part_num in configured_partitions:
device_config_data = PARTITION_SCHEMA(configured_partitions[part_num])
device = EnvisalinkAlarm(
hass,
part_num,
device_config_data[CONF_PARTITIONNAME],
code,
panic_type,
hass.data[DATA_EVL].alarm_state['partition'][part_num],
hass.data[DATA_EVL]
)
devices.append(device)
async_add_entities(devices)
@callback
def alarm_keypress_handler(service):
"""Map services to methods on Alarm."""
entity_ids = service.data.get(ATTR_ENTITY_ID)
keypress = service.data.get(ATTR_KEYPRESS)
target_devices = [device for device in devices
if device.entity_id in entity_ids]
for device in target_devices:
device.async_alarm_keypress(keypress)
hass.services.async_register(
alarm.DOMAIN, SERVICE_ALARM_KEYPRESS, alarm_keypress_handler,
schema=ALARM_KEYPRESS_SCHEMA)
return True
class EnvisalinkAlarm(EnvisalinkDevice, alarm.AlarmControlPanel):
"""Representation of an Envisalink-based alarm panel."""
def __init__(self, hass, partition_number, alarm_name, code, panic_type,
info, controller):
"""Initialize the alarm panel."""
self._partition_number = partition_number
self._code = code
self._panic_type = panic_type
_LOGGER.debug("Setting up alarm: %s", alarm_name)
super().__init__(alarm_name, info, controller)
async def async_added_to_hass(self):
"""Register callbacks."""
async_dispatcher_connect(
self.hass, SIGNAL_KEYPAD_UPDATE, self._update_callback)
async_dispatcher_connect(
self.hass, SIGNAL_PARTITION_UPDATE, self._update_callback)
@callback
def _update_callback(self, partition):
"""Update Home Assistant state, if needed."""
if partition is None or int(partition) == self._partition_number:
self.async_schedule_update_ha_state()
@property
def code_format(self):
"""Regex for code format or None if no code is required."""
if self._code:
return None
return alarm.FORMAT_NUMBER
@property
def state(self):
"""Return the state of the device."""
state = STATE_UNKNOWN
if self._info['status']['alarm']:
state = STATE_ALARM_TRIGGERED
elif self._info['status']['armed_away']:
state = STATE_ALARM_ARMED_AWAY
elif self._info['status']['armed_stay']:
state = STATE_ALARM_ARMED_HOME
elif self._info['status']['exit_delay']:
state = STATE_ALARM_PENDING
elif self._info['status']['entry_delay']:
state = STATE_ALARM_PENDING
elif self._info['status']['alpha']:
state = STATE_ALARM_DISARMED
return state
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
if code:
self.hass.data[DATA_EVL].disarm_partition(
str(code), self._partition_number)
else:
self.hass.data[DATA_EVL].disarm_partition(
str(self._code), self._partition_number)
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
if code:
self.hass.data[DATA_EVL].arm_stay_partition(
str(code), self._partition_number)
else:
self.hass.data[DATA_EVL].arm_stay_partition(
str(self._code), self._partition_number)
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
if code:
self.hass.data[DATA_EVL].arm_away_partition(
str(code), self._partition_number)
else:
self.hass.data[DATA_EVL].arm_away_partition(
str(self._code), self._partition_number)
async def async_alarm_trigger(self, code=None):
"""Alarm trigger command. Will be used to trigger a panic alarm."""
self.hass.data[DATA_EVL].panic_alarm(self._panic_type)
@callback
def async_alarm_keypress(self, keypress=None):
"""Send custom keypress."""
if keypress:
self.hass.data[DATA_EVL].keypresses_to_partition(
self._partition_number, keypress)

View File

@@ -1,117 +0,0 @@
"""
Support for Homekit Alarm Control Panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.homekit_controller/
"""
import logging
from homeassistant.components.homekit_controller import (HomeKitEntity,
KNOWN_ACCESSORIES)
from homeassistant.components.alarm_control_panel import AlarmControlPanel
from homeassistant.const import (
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT, STATE_ALARM_TRIGGERED)
from homeassistant.const import ATTR_BATTERY_LEVEL
DEPENDENCIES = ['homekit_controller']
ICON = 'mdi:security'
_LOGGER = logging.getLogger(__name__)
CURRENT_STATE_MAP = {
0: STATE_ALARM_ARMED_HOME,
1: STATE_ALARM_ARMED_AWAY,
2: STATE_ALARM_ARMED_NIGHT,
3: STATE_ALARM_DISARMED,
4: STATE_ALARM_TRIGGERED
}
TARGET_STATE_MAP = {
STATE_ALARM_ARMED_HOME: 0,
STATE_ALARM_ARMED_AWAY: 1,
STATE_ALARM_ARMED_NIGHT: 2,
STATE_ALARM_DISARMED: 3,
}
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Homekit Alarm Control Panel support."""
if discovery_info is None:
return
accessory = hass.data[KNOWN_ACCESSORIES][discovery_info['serial']]
add_entities([HomeKitAlarmControlPanel(accessory, discovery_info)],
True)
class HomeKitAlarmControlPanel(HomeKitEntity, AlarmControlPanel):
"""Representation of a Homekit Alarm Control Panel."""
def __init__(self, *args):
"""Initialise the Alarm Control Panel."""
super().__init__(*args)
self._state = None
self._battery_level = None
def update_characteristics(self, characteristics):
"""Synchronise the Alarm Control Panel state with Home Assistant."""
# pylint: disable=import-error
from homekit.model.characteristics import CharacteristicsTypes
for characteristic in characteristics:
ctype = characteristic['type']
ctype = CharacteristicsTypes.get_short(ctype)
if ctype == "security-system-state.current":
self._chars['security-system-state.current'] = \
characteristic['iid']
self._state = CURRENT_STATE_MAP[characteristic['value']]
elif ctype == "security-system-state.target":
self._chars['security-system-state.target'] = \
characteristic['iid']
elif ctype == "battery-level":
self._chars['battery-level'] = characteristic['iid']
self._battery_level = characteristic['value']
@property
def icon(self):
"""Return icon."""
return ICON
@property
def state(self):
"""Return the state of the device."""
return self._state
def alarm_disarm(self, code=None):
"""Send disarm command."""
self.set_alarm_state(STATE_ALARM_DISARMED, code)
def alarm_arm_away(self, code=None):
"""Send arm command."""
self.set_alarm_state(STATE_ALARM_ARMED_AWAY, code)
def alarm_arm_home(self, code=None):
"""Send stay command."""
self.set_alarm_state(STATE_ALARM_ARMED_HOME, code)
def alarm_arm_night(self, code=None):
"""Send night command."""
self.set_alarm_state(STATE_ALARM_ARMED_NIGHT, code)
def set_alarm_state(self, state, code=None):
"""Send state command."""
characteristics = [{'aid': self._aid,
'iid': self._chars['security-system-state.target'],
'value': TARGET_STATE_MAP[state]}]
self.put_characteristics(characteristics)
@property
def device_state_attributes(self):
"""Return the optional state attributes."""
if self._battery_level is None:
return None
return {
ATTR_BATTERY_LEVEL: self._battery_level,
}

View File

@@ -1,83 +0,0 @@
"""
Support for HomematicIP Cloud alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.homematicip_cloud/
"""
import logging
from homeassistant.components.alarm_control_panel import AlarmControlPanel
from homeassistant.components.homematicip_cloud import (
HMIPC_HAPID, HomematicipGenericDevice)
from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_ALARM_TRIGGERED)
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['homematicip_cloud']
HMIP_ZONE_AWAY = 'EXTERNAL'
HMIP_ZONE_HOME = 'INTERNAL'
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
"""Set up the HomematicIP Cloud alarm control devices."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the HomematicIP alarm control panel from a config entry."""
from homematicip.aio.group import AsyncSecurityZoneGroup
home = hass.data[HMIPC_DOMAIN][config_entry.data[HMIPC_HAPID]].home
devices = []
for group in home.groups:
if isinstance(group, AsyncSecurityZoneGroup):
devices.append(HomematicipSecurityZone(home, group))
if devices:
async_add_entities(devices)
class HomematicipSecurityZone(HomematicipGenericDevice, AlarmControlPanel):
"""Representation of an HomematicIP Cloud security zone group."""
def __init__(self, home, device):
"""Initialize the security zone group."""
device.modelType = 'Group-SecurityZone'
device.windowState = ''
super().__init__(home, device)
@property
def state(self):
"""Return the state of the device."""
from homematicip.base.enums import WindowState
if self._device.active:
if (self._device.sabotage or self._device.motionDetected or
self._device.windowState == WindowState.OPEN):
return STATE_ALARM_TRIGGERED
active = self._home.get_security_zones_activation()
if active == (True, True):
return STATE_ALARM_ARMED_AWAY
if active == (False, True):
return STATE_ALARM_ARMED_HOME
return STATE_ALARM_DISARMED
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
await self._home.set_security_zones_activation(False, False)
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
await self._home.set_security_zones_activation(True, False)
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
await self._home.set_security_zones_activation(True, True)

View File

@@ -1,133 +0,0 @@
"""
Interfaces with iAlarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.ialarm/
"""
import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_CODE, CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME,
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_ALARM_TRIGGERED)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pyialarm==0.3']
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'iAlarm'
def no_application_protocol(value):
"""Validate that value is without the application protocol."""
protocol_separator = "://"
if not value or protocol_separator in value:
raise vol.Invalid(
'Invalid host, {} is not allowed'.format(protocol_separator))
return value
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_HOST): vol.All(cv.string, no_application_protocol),
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Optional(CONF_CODE): cv.positive_int,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up an iAlarm control panel."""
name = config.get(CONF_NAME)
code = config.get(CONF_CODE)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
host = config.get(CONF_HOST)
url = 'http://{}'.format(host)
ialarm = IAlarmPanel(name, code, username, password, url)
add_entities([ialarm], True)
class IAlarmPanel(alarm.AlarmControlPanel):
"""Representation of an iAlarm status."""
def __init__(self, name, code, username, password, url):
"""Initialize the iAlarm status."""
from pyialarm import IAlarm
self._name = name
self._code = str(code) if code else None
self._username = username
self._password = password
self._url = url
self._state = None
self._client = IAlarm(username, password, url)
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def code_format(self):
"""Return one or more digits/characters."""
if self._code is None:
return None
if isinstance(self._code, str) and re.search('^\\d+$', self._code):
return alarm.FORMAT_NUMBER
return alarm.FORMAT_TEXT
@property
def state(self):
"""Return the state of the device."""
return self._state
def update(self):
"""Return the state of the device."""
status = self._client.get_status()
_LOGGER.debug('iAlarm status: %s', status)
if status:
status = int(status)
if status == self._client.DISARMED:
state = STATE_ALARM_DISARMED
elif status == self._client.ARMED_AWAY:
state = STATE_ALARM_ARMED_AWAY
elif status == self._client.ARMED_STAY:
state = STATE_ALARM_ARMED_HOME
elif status == self._client.TRIGGERED:
state = STATE_ALARM_TRIGGERED
else:
state = None
self._state = state
def alarm_disarm(self, code=None):
"""Send disarm command."""
if self._validate_code(code):
self._client.disarm()
def alarm_arm_away(self, code=None):
"""Send arm away command."""
if self._validate_code(code):
self._client.arm_away()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if self._validate_code(code):
self._client.arm_stay()
def _validate_code(self, code):
"""Validate given code."""
check = self._code is None or code == self._code
if not check:
_LOGGER.warning("Wrong code entered")
return check

View File

@@ -1,175 +0,0 @@
"""
Interfaces with alarm control panels that have to be controlled through IFTTT.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.ifttt/
"""
import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import (
DOMAIN, PLATFORM_SCHEMA)
from homeassistant.components.ifttt import (
ATTR_EVENT, DOMAIN as IFTTT_DOMAIN, SERVICE_TRIGGER)
from homeassistant.const import (
ATTR_ENTITY_ID, ATTR_STATE, CONF_NAME, CONF_CODE,
CONF_OPTIMISTIC, STATE_ALARM_DISARMED, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY)
import homeassistant.helpers.config_validation as cv
DEPENDENCIES = ['ifttt']
_LOGGER = logging.getLogger(__name__)
ALLOWED_STATES = [
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME]
DATA_IFTTT_ALARM = 'ifttt_alarm'
DEFAULT_NAME = "Home"
CONF_EVENT_AWAY = "event_arm_away"
CONF_EVENT_HOME = "event_arm_home"
CONF_EVENT_NIGHT = "event_arm_night"
CONF_EVENT_DISARM = "event_disarm"
DEFAULT_EVENT_AWAY = "alarm_arm_away"
DEFAULT_EVENT_HOME = "alarm_arm_home"
DEFAULT_EVENT_NIGHT = "alarm_arm_night"
DEFAULT_EVENT_DISARM = "alarm_disarm"
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_CODE): cv.string,
vol.Optional(CONF_EVENT_AWAY, default=DEFAULT_EVENT_AWAY): cv.string,
vol.Optional(CONF_EVENT_HOME, default=DEFAULT_EVENT_HOME): cv.string,
vol.Optional(CONF_EVENT_NIGHT, default=DEFAULT_EVENT_NIGHT): cv.string,
vol.Optional(CONF_EVENT_DISARM, default=DEFAULT_EVENT_DISARM): cv.string,
vol.Optional(CONF_OPTIMISTIC, default=False): cv.boolean,
})
SERVICE_PUSH_ALARM_STATE = "ifttt_push_alarm_state"
PUSH_ALARM_STATE_SERVICE_SCHEMA = vol.Schema({
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
vol.Required(ATTR_STATE): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up a control panel managed through IFTTT."""
if DATA_IFTTT_ALARM not in hass.data:
hass.data[DATA_IFTTT_ALARM] = []
name = config.get(CONF_NAME)
code = config.get(CONF_CODE)
event_away = config.get(CONF_EVENT_AWAY)
event_home = config.get(CONF_EVENT_HOME)
event_night = config.get(CONF_EVENT_NIGHT)
event_disarm = config.get(CONF_EVENT_DISARM)
optimistic = config.get(CONF_OPTIMISTIC)
alarmpanel = IFTTTAlarmPanel(name, code, event_away, event_home,
event_night, event_disarm, optimistic)
hass.data[DATA_IFTTT_ALARM].append(alarmpanel)
add_entities([alarmpanel])
async def push_state_update(service):
"""Set the service state as device state attribute."""
entity_ids = service.data.get(ATTR_ENTITY_ID)
state = service.data.get(ATTR_STATE)
devices = hass.data[DATA_IFTTT_ALARM]
if entity_ids:
devices = [d for d in devices if d.entity_id in entity_ids]
for device in devices:
device.push_alarm_state(state)
device.async_schedule_update_ha_state()
hass.services.register(DOMAIN, SERVICE_PUSH_ALARM_STATE, push_state_update,
schema=PUSH_ALARM_STATE_SERVICE_SCHEMA)
class IFTTTAlarmPanel(alarm.AlarmControlPanel):
"""Representation of an alarm control panel controlled through IFTTT."""
def __init__(self, name, code, event_away, event_home, event_night,
event_disarm, optimistic):
"""Initialize the alarm control panel."""
self._name = name
self._code = code
self._event_away = event_away
self._event_home = event_home
self._event_night = event_night
self._event_disarm = event_disarm
self._optimistic = optimistic
self._state = None
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def assumed_state(self):
"""Notify that this platform return an assumed state."""
return True
@property
def code_format(self):
"""Return one or more digits/characters."""
if self._code is None:
return None
if isinstance(self._code, str) and re.search('^\\d+$', self._code):
return alarm.FORMAT_NUMBER
return alarm.FORMAT_TEXT
def alarm_disarm(self, code=None):
"""Send disarm command."""
if not self._check_code(code):
return
self.set_alarm_state(self._event_disarm, STATE_ALARM_DISARMED)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
if not self._check_code(code):
return
self.set_alarm_state(self._event_away, STATE_ALARM_ARMED_AWAY)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if not self._check_code(code):
return
self.set_alarm_state(self._event_home, STATE_ALARM_ARMED_HOME)
def alarm_arm_night(self, code=None):
"""Send arm night command."""
if not self._check_code(code):
return
self.set_alarm_state(self._event_night, STATE_ALARM_ARMED_NIGHT)
def set_alarm_state(self, event, state):
"""Call the IFTTT trigger service to change the alarm state."""
data = {ATTR_EVENT: event}
self.hass.services.call(IFTTT_DOMAIN, SERVICE_TRIGGER, data)
_LOGGER.debug("Called IFTTT component to trigger event %s", event)
if self._optimistic:
self._state = state
def push_alarm_state(self, value):
"""Push the alarm state to the given value."""
if value in ALLOWED_STATES:
_LOGGER.debug("Pushed the alarm state to %s", value)
self._state = value
def _check_code(self, code):
return self._code is None or self._code == code

View File

@@ -1,70 +0,0 @@
"""
This component provides HA alarm_control_panel support for Lupusec System.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.lupusec/
"""
from datetime import timedelta
from homeassistant.components.alarm_control_panel import AlarmControlPanel
from homeassistant.components.lupusec import DOMAIN as LUPUSEC_DOMAIN
from homeassistant.components.lupusec import LupusecDevice
from homeassistant.const import (STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED,
STATE_ALARM_TRIGGERED)
DEPENDENCIES = ['lupusec']
ICON = 'mdi:security'
SCAN_INTERVAL = timedelta(seconds=2)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up an alarm control panel for a Lupusec device."""
if discovery_info is None:
return
data = hass.data[LUPUSEC_DOMAIN]
alarm_devices = [LupusecAlarm(data, data.lupusec.get_alarm())]
add_entities(alarm_devices)
class LupusecAlarm(LupusecDevice, AlarmControlPanel):
"""An alarm_control_panel implementation for Lupusec."""
@property
def icon(self):
"""Return the icon."""
return ICON
@property
def state(self):
"""Return the state of the device."""
if self._device.is_standby:
state = STATE_ALARM_DISARMED
elif self._device.is_away:
state = STATE_ALARM_ARMED_AWAY
elif self._device.is_home:
state = STATE_ALARM_ARMED_HOME
elif self._device.is_alarm_triggered:
state = STATE_ALARM_TRIGGERED
else:
state = None
return state
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._device.set_away()
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._device.set_standby()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._device.set_home()

View File

@@ -0,0 +1,10 @@
{
"domain": "alarm_control_panel",
"name": "Alarm control panel",
"documentation": "https://www.home-assistant.io/components/alarm_control_panel",
"requirements": [],
"dependencies": [],
"codeowners": [
"@colinodell"
]
}

View File

@@ -1,324 +0,0 @@
"""
Support for manual alarms.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.manual/
"""
import copy
import datetime
import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
CONF_CODE, CONF_DELAY_TIME, CONF_DISARM_AFTER_TRIGGER, CONF_NAME,
CONF_PENDING_TIME, CONF_PLATFORM, CONF_TRIGGER_TIME,
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_DISARMED,
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_point_in_time
import homeassistant.util.dt as dt_util
from homeassistant.helpers.restore_state import RestoreEntity
_LOGGER = logging.getLogger(__name__)
CONF_CODE_TEMPLATE = 'code_template'
DEFAULT_ALARM_NAME = 'HA Alarm'
DEFAULT_DELAY_TIME = datetime.timedelta(seconds=0)
DEFAULT_PENDING_TIME = datetime.timedelta(seconds=60)
DEFAULT_TRIGGER_TIME = datetime.timedelta(seconds=120)
DEFAULT_DISARM_AFTER_TRIGGER = False
SUPPORTED_STATES = [STATE_ALARM_DISARMED, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_ARMED_CUSTOM_BYPASS, STATE_ALARM_TRIGGERED]
SUPPORTED_PRETRIGGER_STATES = [state for state in SUPPORTED_STATES
if state != STATE_ALARM_TRIGGERED]
SUPPORTED_PENDING_STATES = [state for state in SUPPORTED_STATES
if state != STATE_ALARM_DISARMED]
ATTR_PRE_PENDING_STATE = 'pre_pending_state'
ATTR_POST_PENDING_STATE = 'post_pending_state'
def _state_validator(config):
"""Validate the state."""
config = copy.deepcopy(config)
for state in SUPPORTED_PRETRIGGER_STATES:
if CONF_DELAY_TIME not in config[state]:
config[state][CONF_DELAY_TIME] = config[CONF_DELAY_TIME]
if CONF_TRIGGER_TIME not in config[state]:
config[state][CONF_TRIGGER_TIME] = config[CONF_TRIGGER_TIME]
for state in SUPPORTED_PENDING_STATES:
if CONF_PENDING_TIME not in config[state]:
config[state][CONF_PENDING_TIME] = config[CONF_PENDING_TIME]
return config
def _state_schema(state):
"""Validate the state."""
schema = {}
if state in SUPPORTED_PRETRIGGER_STATES:
schema[vol.Optional(CONF_DELAY_TIME)] = vol.All(
cv.time_period, cv.positive_timedelta)
schema[vol.Optional(CONF_TRIGGER_TIME)] = vol.All(
cv.time_period, cv.positive_timedelta)
if state in SUPPORTED_PENDING_STATES:
schema[vol.Optional(CONF_PENDING_TIME)] = vol.All(
cv.time_period, cv.positive_timedelta)
return vol.Schema(schema)
PLATFORM_SCHEMA = vol.Schema(vol.All({
vol.Required(CONF_PLATFORM): 'manual',
vol.Optional(CONF_NAME, default=DEFAULT_ALARM_NAME): cv.string,
vol.Exclusive(CONF_CODE, 'code validation'): cv.string,
vol.Exclusive(CONF_CODE_TEMPLATE, 'code validation'): cv.template,
vol.Optional(CONF_DELAY_TIME, default=DEFAULT_DELAY_TIME):
vol.All(cv.time_period, cv.positive_timedelta),
vol.Optional(CONF_PENDING_TIME, default=DEFAULT_PENDING_TIME):
vol.All(cv.time_period, cv.positive_timedelta),
vol.Optional(CONF_TRIGGER_TIME, default=DEFAULT_TRIGGER_TIME):
vol.All(cv.time_period, cv.positive_timedelta),
vol.Optional(CONF_DISARM_AFTER_TRIGGER,
default=DEFAULT_DISARM_AFTER_TRIGGER): cv.boolean,
vol.Optional(STATE_ALARM_ARMED_AWAY, default={}):
_state_schema(STATE_ALARM_ARMED_AWAY),
vol.Optional(STATE_ALARM_ARMED_HOME, default={}):
_state_schema(STATE_ALARM_ARMED_HOME),
vol.Optional(STATE_ALARM_ARMED_NIGHT, default={}):
_state_schema(STATE_ALARM_ARMED_NIGHT),
vol.Optional(STATE_ALARM_ARMED_CUSTOM_BYPASS, default={}):
_state_schema(STATE_ALARM_ARMED_CUSTOM_BYPASS),
vol.Optional(STATE_ALARM_DISARMED, default={}):
_state_schema(STATE_ALARM_DISARMED),
vol.Optional(STATE_ALARM_TRIGGERED, default={}):
_state_schema(STATE_ALARM_TRIGGERED),
}, _state_validator))
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the manual alarm platform."""
add_entities([ManualAlarm(
hass,
config[CONF_NAME],
config.get(CONF_CODE),
config.get(CONF_CODE_TEMPLATE),
config.get(CONF_DISARM_AFTER_TRIGGER, DEFAULT_DISARM_AFTER_TRIGGER),
config
)])
class ManualAlarm(alarm.AlarmControlPanel, RestoreEntity):
"""
Representation of an alarm status.
When armed, will be pending for 'pending_time', after that armed.
When triggered, will be pending for the triggering state's 'delay_time'
plus the triggered state's 'pending_time'.
After that will be triggered for 'trigger_time', after that we return to
the previous state or disarm if `disarm_after_trigger` is true.
A trigger_time of zero disables the alarm_trigger service.
"""
def __init__(self, hass, name, code, code_template,
disarm_after_trigger, config):
"""Init the manual alarm panel."""
self._state = STATE_ALARM_DISARMED
self._hass = hass
self._name = name
if code_template:
self._code = code_template
self._code.hass = hass
else:
self._code = code or None
self._disarm_after_trigger = disarm_after_trigger
self._previous_state = self._state
self._state_ts = None
self._delay_time_by_state = {
state: config[state][CONF_DELAY_TIME]
for state in SUPPORTED_PRETRIGGER_STATES}
self._trigger_time_by_state = {
state: config[state][CONF_TRIGGER_TIME]
for state in SUPPORTED_PRETRIGGER_STATES}
self._pending_time_by_state = {
state: config[state][CONF_PENDING_TIME]
for state in SUPPORTED_PENDING_STATES}
@property
def should_poll(self):
"""Return the polling state."""
return False
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def state(self):
"""Return the state of the device."""
if self._state == STATE_ALARM_TRIGGERED:
if self._within_pending_time(self._state):
return STATE_ALARM_PENDING
trigger_time = self._trigger_time_by_state[self._previous_state]
if (self._state_ts + self._pending_time(self._state) +
trigger_time) < dt_util.utcnow():
if self._disarm_after_trigger:
return STATE_ALARM_DISARMED
self._state = self._previous_state
return self._state
if self._state in SUPPORTED_PENDING_STATES and \
self._within_pending_time(self._state):
return STATE_ALARM_PENDING
return self._state
@property
def _active_state(self):
"""Get the current state."""
if self.state == STATE_ALARM_PENDING:
return self._previous_state
return self._state
def _pending_time(self, state):
"""Get the pending time."""
pending_time = self._pending_time_by_state[state]
if state == STATE_ALARM_TRIGGERED:
pending_time += self._delay_time_by_state[self._previous_state]
return pending_time
def _within_pending_time(self, state):
"""Get if the action is in the pending time window."""
return self._state_ts + self._pending_time(state) > dt_util.utcnow()
@property
def code_format(self):
"""Return one or more digits/characters."""
if self._code is None:
return None
if isinstance(self._code, str) and re.search('^\\d+$', self._code):
return alarm.FORMAT_NUMBER
return alarm.FORMAT_TEXT
def alarm_disarm(self, code=None):
"""Send disarm command."""
if not self._validate_code(code, STATE_ALARM_DISARMED):
return
self._state = STATE_ALARM_DISARMED
self._state_ts = dt_util.utcnow()
self.schedule_update_ha_state()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if not self._validate_code(code, STATE_ALARM_ARMED_HOME):
return
self._update_state(STATE_ALARM_ARMED_HOME)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
if not self._validate_code(code, STATE_ALARM_ARMED_AWAY):
return
self._update_state(STATE_ALARM_ARMED_AWAY)
def alarm_arm_night(self, code=None):
"""Send arm night command."""
if not self._validate_code(code, STATE_ALARM_ARMED_NIGHT):
return
self._update_state(STATE_ALARM_ARMED_NIGHT)
def alarm_arm_custom_bypass(self, code=None):
"""Send arm custom bypass command."""
if not self._validate_code(code, STATE_ALARM_ARMED_CUSTOM_BYPASS):
return
self._update_state(STATE_ALARM_ARMED_CUSTOM_BYPASS)
def alarm_trigger(self, code=None):
"""
Send alarm trigger command.
No code needed, a trigger time of zero for the current state
disables the alarm.
"""
if not self._trigger_time_by_state[self._active_state]:
return
self._update_state(STATE_ALARM_TRIGGERED)
def _update_state(self, state):
"""Update the state."""
if self._state == state:
return
self._previous_state = self._state
self._state = state
self._state_ts = dt_util.utcnow()
self.schedule_update_ha_state()
pending_time = self._pending_time(state)
if state == STATE_ALARM_TRIGGERED:
track_point_in_time(
self._hass, self.async_update_ha_state,
self._state_ts + pending_time)
trigger_time = self._trigger_time_by_state[self._previous_state]
track_point_in_time(
self._hass, self.async_update_ha_state,
self._state_ts + pending_time + trigger_time)
elif state in SUPPORTED_PENDING_STATES and pending_time:
track_point_in_time(
self._hass, self.async_update_ha_state,
self._state_ts + pending_time)
def _validate_code(self, code, state):
"""Validate given code."""
if self._code is None:
return True
if isinstance(self._code, str):
alarm_code = self._code
else:
alarm_code = self._code.render(from_state=self._state,
to_state=state)
check = not alarm_code or code == alarm_code
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_PRE_PENDING_STATE] = self._previous_state
state_attr[ATTR_POST_PENDING_STATE] = self._state
return state_attr
async def async_added_to_hass(self):
"""Run when entity about to be added to hass."""
await super().async_added_to_hass()
state = await self.async_get_last_state()
if state:
if state.state == STATE_ALARM_PENDING and \
hasattr(state, 'attributes') and \
state.attributes['pre_pending_state']:
# If in pending state, we return to the pre_pending_state
self._state = state.attributes['pre_pending_state']
self._state_ts = dt_util.utcnow()
else:
self._state = state.state
self._state_ts = state.last_updated

View File

@@ -1,366 +0,0 @@
"""
Support for manual alarms controllable via MQTT.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.manual_mqtt/
"""
import copy
import datetime
import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
import homeassistant.util.dt as dt_util
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED, STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED,
CONF_PLATFORM, CONF_NAME, CONF_CODE, CONF_DELAY_TIME, CONF_PENDING_TIME,
CONF_TRIGGER_TIME, CONF_DISARM_AFTER_TRIGGER)
from homeassistant.components import mqtt
from homeassistant.helpers.event import async_track_state_change
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_point_in_time
_LOGGER = logging.getLogger(__name__)
CONF_CODE_TEMPLATE = 'code_template'
CONF_PAYLOAD_DISARM = 'payload_disarm'
CONF_PAYLOAD_ARM_HOME = 'payload_arm_home'
CONF_PAYLOAD_ARM_AWAY = 'payload_arm_away'
CONF_PAYLOAD_ARM_NIGHT = 'payload_arm_night'
DEFAULT_ALARM_NAME = 'HA Alarm'
DEFAULT_DELAY_TIME = datetime.timedelta(seconds=0)
DEFAULT_PENDING_TIME = datetime.timedelta(seconds=60)
DEFAULT_TRIGGER_TIME = datetime.timedelta(seconds=120)
DEFAULT_DISARM_AFTER_TRIGGER = False
DEFAULT_ARM_AWAY = 'ARM_AWAY'
DEFAULT_ARM_HOME = 'ARM_HOME'
DEFAULT_ARM_NIGHT = 'ARM_NIGHT'
DEFAULT_DISARM = 'DISARM'
SUPPORTED_STATES = [STATE_ALARM_DISARMED, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_TRIGGERED]
SUPPORTED_PRETRIGGER_STATES = [state for state in SUPPORTED_STATES
if state != STATE_ALARM_TRIGGERED]
SUPPORTED_PENDING_STATES = [state for state in SUPPORTED_STATES
if state != STATE_ALARM_DISARMED]
ATTR_PRE_PENDING_STATE = 'pre_pending_state'
ATTR_POST_PENDING_STATE = 'post_pending_state'
def _state_validator(config):
"""Validate the state."""
config = copy.deepcopy(config)
for state in SUPPORTED_PRETRIGGER_STATES:
if CONF_DELAY_TIME not in config[state]:
config[state][CONF_DELAY_TIME] = config[CONF_DELAY_TIME]
if CONF_TRIGGER_TIME not in config[state]:
config[state][CONF_TRIGGER_TIME] = config[CONF_TRIGGER_TIME]
for state in SUPPORTED_PENDING_STATES:
if CONF_PENDING_TIME not in config[state]:
config[state][CONF_PENDING_TIME] = config[CONF_PENDING_TIME]
return config
def _state_schema(state):
"""Validate the state."""
schema = {}
if state in SUPPORTED_PRETRIGGER_STATES:
schema[vol.Optional(CONF_DELAY_TIME)] = vol.All(
cv.time_period, cv.positive_timedelta)
schema[vol.Optional(CONF_TRIGGER_TIME)] = vol.All(
cv.time_period, cv.positive_timedelta)
if state in SUPPORTED_PENDING_STATES:
schema[vol.Optional(CONF_PENDING_TIME)] = vol.All(
cv.time_period, cv.positive_timedelta)
return vol.Schema(schema)
DEPENDENCIES = ['mqtt']
PLATFORM_SCHEMA = vol.Schema(vol.All(mqtt.MQTT_BASE_PLATFORM_SCHEMA.extend({
vol.Required(CONF_PLATFORM): 'manual_mqtt',
vol.Optional(CONF_NAME, default=DEFAULT_ALARM_NAME): cv.string,
vol.Exclusive(CONF_CODE, 'code validation'): cv.string,
vol.Exclusive(CONF_CODE_TEMPLATE, 'code validation'): cv.template,
vol.Optional(CONF_DELAY_TIME, default=DEFAULT_DELAY_TIME):
vol.All(cv.time_period, cv.positive_timedelta),
vol.Optional(CONF_PENDING_TIME, default=DEFAULT_PENDING_TIME):
vol.All(cv.time_period, cv.positive_timedelta),
vol.Optional(CONF_TRIGGER_TIME, default=DEFAULT_TRIGGER_TIME):
vol.All(cv.time_period, cv.positive_timedelta),
vol.Optional(CONF_DISARM_AFTER_TRIGGER,
default=DEFAULT_DISARM_AFTER_TRIGGER): cv.boolean,
vol.Optional(STATE_ALARM_ARMED_AWAY, default={}):
_state_schema(STATE_ALARM_ARMED_AWAY),
vol.Optional(STATE_ALARM_ARMED_HOME, default={}):
_state_schema(STATE_ALARM_ARMED_HOME),
vol.Optional(STATE_ALARM_ARMED_NIGHT, default={}):
_state_schema(STATE_ALARM_ARMED_NIGHT),
vol.Optional(STATE_ALARM_DISARMED, default={}):
_state_schema(STATE_ALARM_DISARMED),
vol.Optional(STATE_ALARM_TRIGGERED, default={}):
_state_schema(STATE_ALARM_TRIGGERED),
vol.Required(mqtt.CONF_COMMAND_TOPIC): mqtt.valid_publish_topic,
vol.Required(mqtt.CONF_STATE_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_PAYLOAD_ARM_AWAY, default=DEFAULT_ARM_AWAY): cv.string,
vol.Optional(CONF_PAYLOAD_ARM_HOME, default=DEFAULT_ARM_HOME): cv.string,
vol.Optional(CONF_PAYLOAD_ARM_NIGHT, default=DEFAULT_ARM_NIGHT): cv.string,
vol.Optional(CONF_PAYLOAD_DISARM, default=DEFAULT_DISARM): cv.string,
}), _state_validator))
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the manual MQTT alarm platform."""
add_entities([ManualMQTTAlarm(
hass,
config[CONF_NAME],
config.get(CONF_CODE),
config.get(CONF_CODE_TEMPLATE),
config.get(CONF_DISARM_AFTER_TRIGGER, DEFAULT_DISARM_AFTER_TRIGGER),
config.get(mqtt.CONF_STATE_TOPIC),
config.get(mqtt.CONF_COMMAND_TOPIC),
config.get(mqtt.CONF_QOS),
config.get(CONF_PAYLOAD_DISARM),
config.get(CONF_PAYLOAD_ARM_HOME),
config.get(CONF_PAYLOAD_ARM_AWAY),
config.get(CONF_PAYLOAD_ARM_NIGHT),
config)])
class ManualMQTTAlarm(alarm.AlarmControlPanel):
"""
Representation of an alarm status.
When armed, will be pending for 'pending_time', after that armed.
When triggered, will be pending for the triggering state's 'delay_time'
plus the triggered state's 'pending_time'.
After that will be triggered for 'trigger_time', after that we return to
the previous state or disarm if `disarm_after_trigger` is true.
A trigger_time of zero disables the alarm_trigger service.
"""
def __init__(self, hass, name, code, code_template, disarm_after_trigger,
state_topic, command_topic, qos, payload_disarm,
payload_arm_home, payload_arm_away, payload_arm_night,
config):
"""Init the manual MQTT alarm panel."""
self._state = STATE_ALARM_DISARMED
self._hass = hass
self._name = name
if code_template:
self._code = code_template
self._code.hass = hass
else:
self._code = code or None
self._disarm_after_trigger = disarm_after_trigger
self._previous_state = self._state
self._state_ts = None
self._delay_time_by_state = {
state: config[state][CONF_DELAY_TIME]
for state in SUPPORTED_PRETRIGGER_STATES}
self._trigger_time_by_state = {
state: config[state][CONF_TRIGGER_TIME]
for state in SUPPORTED_PRETRIGGER_STATES}
self._pending_time_by_state = {
state: config[state][CONF_PENDING_TIME]
for state in SUPPORTED_PENDING_STATES}
self._state_topic = state_topic
self._command_topic = command_topic
self._qos = qos
self._payload_disarm = payload_disarm
self._payload_arm_home = payload_arm_home
self._payload_arm_away = payload_arm_away
self._payload_arm_night = payload_arm_night
@property
def should_poll(self):
"""Return the polling state."""
return False
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def state(self):
"""Return the state of the device."""
if self._state == STATE_ALARM_TRIGGERED:
if self._within_pending_time(self._state):
return STATE_ALARM_PENDING
trigger_time = self._trigger_time_by_state[self._previous_state]
if (self._state_ts + self._pending_time(self._state) +
trigger_time) < dt_util.utcnow():
if self._disarm_after_trigger:
return STATE_ALARM_DISARMED
self._state = self._previous_state
return self._state
if self._state in SUPPORTED_PENDING_STATES and \
self._within_pending_time(self._state):
return STATE_ALARM_PENDING
return self._state
@property
def _active_state(self):
"""Get the current state."""
if self.state == STATE_ALARM_PENDING:
return self._previous_state
return self._state
def _pending_time(self, state):
"""Get the pending time."""
pending_time = self._pending_time_by_state[state]
if state == STATE_ALARM_TRIGGERED:
pending_time += self._delay_time_by_state[self._previous_state]
return pending_time
def _within_pending_time(self, state):
"""Get if the action is in the pending time window."""
return self._state_ts + self._pending_time(state) > dt_util.utcnow()
@property
def code_format(self):
"""Return one or more digits/characters."""
if self._code is None:
return None
if isinstance(self._code, str) and re.search('^\\d+$', self._code):
return alarm.FORMAT_NUMBER
return alarm.FORMAT_TEXT
def alarm_disarm(self, code=None):
"""Send disarm command."""
if not self._validate_code(code, STATE_ALARM_DISARMED):
return
self._state = STATE_ALARM_DISARMED
self._state_ts = dt_util.utcnow()
self.schedule_update_ha_state()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if not self._validate_code(code, STATE_ALARM_ARMED_HOME):
return
self._update_state(STATE_ALARM_ARMED_HOME)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
if not self._validate_code(code, STATE_ALARM_ARMED_AWAY):
return
self._update_state(STATE_ALARM_ARMED_AWAY)
def alarm_arm_night(self, code=None):
"""Send arm night command."""
if not self._validate_code(code, STATE_ALARM_ARMED_NIGHT):
return
self._update_state(STATE_ALARM_ARMED_NIGHT)
def alarm_trigger(self, code=None):
"""
Send alarm trigger command.
No code needed, a trigger time of zero for the current state
disables the alarm.
"""
if not self._trigger_time_by_state[self._active_state]:
return
self._update_state(STATE_ALARM_TRIGGERED)
def _update_state(self, state):
"""Update the state."""
if self._state == state:
return
self._previous_state = self._state
self._state = state
self._state_ts = dt_util.utcnow()
self.schedule_update_ha_state()
pending_time = self._pending_time(state)
if state == STATE_ALARM_TRIGGERED:
track_point_in_time(
self._hass, self.async_update_ha_state,
self._state_ts + pending_time)
trigger_time = self._trigger_time_by_state[self._previous_state]
track_point_in_time(
self._hass, self.async_update_ha_state,
self._state_ts + pending_time + trigger_time)
elif state in SUPPORTED_PENDING_STATES and pending_time:
track_point_in_time(
self._hass, self.async_update_ha_state,
self._state_ts + pending_time)
def _validate_code(self, code, state):
"""Validate given code."""
if self._code is None:
return True
if isinstance(self._code, str):
alarm_code = self._code
else:
alarm_code = self._code.render(from_state=self._state,
to_state=state)
check = not alarm_code or code == alarm_code
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_PRE_PENDING_STATE] = self._previous_state
state_attr[ATTR_POST_PENDING_STATE] = self._state
return state_attr
async def async_added_to_hass(self):
"""Subscribe to MQTT events."""
async_track_state_change(
self.hass, self.entity_id, self._async_state_changed_listener
)
@callback
def message_received(topic, payload, qos):
"""Run when new MQTT message has been received."""
if payload == self._payload_disarm:
self.async_alarm_disarm(self._code)
elif payload == self._payload_arm_home:
self.async_alarm_arm_home(self._code)
elif payload == self._payload_arm_away:
self.async_alarm_arm_away(self._code)
elif payload == self._payload_arm_night:
self.async_alarm_arm_night(self._code)
else:
_LOGGER.warning("Received unexpected payload: %s", payload)
return
await mqtt.async_subscribe(
self.hass, self._command_topic, message_received, self._qos)
async def _async_state_changed_listener(self, entity_id, old_state,
new_state):
"""Publish state change to MQTT."""
mqtt.async_publish(
self.hass, self._state_topic, new_state.state, self._qos, True)

View File

@@ -1,107 +0,0 @@
"""
Support for Ness D8X/D16X alarm panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.ness_alarm/
"""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.ness_alarm import (
DATA_NESS, SIGNAL_ARMING_STATE_CHANGED)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMING,
STATE_ALARM_TRIGGERED, STATE_ALARM_PENDING, STATE_ALARM_DISARMED)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['ness_alarm']
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the Ness Alarm alarm control panel devices."""
if discovery_info is None:
return
device = NessAlarmPanel(hass.data[DATA_NESS], 'Alarm Panel')
async_add_entities([device])
class NessAlarmPanel(alarm.AlarmControlPanel):
"""Representation of a Ness alarm panel."""
def __init__(self, client, name):
"""Initialize the alarm panel."""
self._client = client
self._name = name
self._state = None
async def async_added_to_hass(self):
"""Register callbacks."""
async_dispatcher_connect(
self.hass, SIGNAL_ARMING_STATE_CHANGED,
self._handle_arming_state_change)
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def should_poll(self):
"""Return the polling state."""
return False
@property
def code_format(self):
"""Return the regex for code format or None if no code is required."""
return alarm.FORMAT_NUMBER
@property
def state(self):
"""Return the state of the device."""
return self._state
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
await self._client.disarm(code)
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
await self._client.arm_away(code)
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
await self._client.arm_home(code)
async def async_alarm_trigger(self, code=None):
"""Send trigger/panic command."""
await self._client.panic(code)
@callback
def _handle_arming_state_change(self, arming_state):
"""Handle arming state update."""
from nessclient import ArmingState
if arming_state == ArmingState.UNKNOWN:
self._state = None
elif arming_state == ArmingState.DISARMED:
self._state = STATE_ALARM_DISARMED
elif arming_state == ArmingState.ARMING:
self._state = STATE_ALARM_ARMING
elif arming_state == ArmingState.EXIT_DELAY:
self._state = STATE_ALARM_ARMING
elif arming_state == ArmingState.ARMED:
self._state = STATE_ALARM_ARMED_AWAY
elif arming_state == ArmingState.ENTRY_DELAY:
self._state = STATE_ALARM_PENDING
elif arming_state == ArmingState.TRIGGERED:
self._state = STATE_ALARM_TRIGGERED
else:
_LOGGER.warning("Unhandled arming state: %s", arming_state)
self.async_schedule_update_ha_state()

View File

@@ -1,124 +0,0 @@
"""
Support for NX584 alarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.nx584/
"""
import logging
import requests
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_HOST, CONF_NAME, CONF_PORT, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED, STATE_ALARM_TRIGGERED)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pynx584==0.4']
_LOGGER = logging.getLogger(__name__)
DEFAULT_HOST = 'localhost'
DEFAULT_NAME = 'NX584'
DEFAULT_PORT = 5007
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_HOST, default=DEFAULT_HOST): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the NX584 platform."""
name = config.get(CONF_NAME)
host = config.get(CONF_HOST)
port = config.get(CONF_PORT)
url = 'http://{}:{}'.format(host, port)
try:
add_entities([NX584Alarm(hass, url, name)])
except requests.exceptions.ConnectionError as ex:
_LOGGER.error("Unable to connect to NX584: %s", str(ex))
return
class NX584Alarm(alarm.AlarmControlPanel):
"""Representation of a NX584-based alarm panel."""
def __init__(self, hass, url, name):
"""Init the nx584 alarm panel."""
from nx584 import client
self._hass = hass
self._name = name
self._url = url
self._alarm = client.Client(self._url)
# Do an initial list operation so that we will try to actually
# talk to the API and trigger a requests exception for setup_platform()
# to catch
self._alarm.list_zones()
self._state = None
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def code_format(self):
"""Return one or more digits/characters."""
return alarm.FORMAT_NUMBER
@property
def state(self):
"""Return the state of the device."""
return self._state
def update(self):
"""Process new events from panel."""
try:
part = self._alarm.list_partitions()[0]
zones = self._alarm.list_zones()
except requests.exceptions.ConnectionError as ex:
_LOGGER.error("Unable to connect to %(host)s: %(reason)s",
dict(host=self._url, reason=ex))
self._state = None
zones = []
except IndexError:
_LOGGER.error("NX584 reports no partitions")
self._state = None
zones = []
bypassed = False
for zone in zones:
if zone['bypassed']:
_LOGGER.debug("Zone %(zone)s is bypassed, assuming HOME",
dict(zone=zone['number']))
bypassed = True
break
if not part['armed']:
self._state = STATE_ALARM_DISARMED
elif bypassed:
self._state = STATE_ALARM_ARMED_HOME
else:
self._state = STATE_ALARM_ARMED_AWAY
for flag in part['condition_flags']:
if flag == "Siren on":
self._state = STATE_ALARM_TRIGGERED
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._alarm.disarm(code)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._alarm.arm('stay')
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._alarm.arm('exit')

View File

@@ -1,88 +0,0 @@
"""
Support for Satel Integra alarm, using ETHM module: https://www.satel.pl/en/ .
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.satel_integra/
"""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.satel_integra import (
CONF_ARM_HOME_MODE, DATA_SATEL, SIGNAL_PANEL_MESSAGE)
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['satel_integra']
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up for Satel Integra alarm panels."""
if not discovery_info:
return
device = SatelIntegraAlarmPanel(
"Alarm Panel", discovery_info.get(CONF_ARM_HOME_MODE))
async_add_entities([device])
class SatelIntegraAlarmPanel(alarm.AlarmControlPanel):
"""Representation of an AlarmDecoder-based alarm panel."""
def __init__(self, name, arm_home_mode):
"""Initialize the alarm panel."""
self._name = name
self._state = None
self._arm_home_mode = arm_home_mode
async def async_added_to_hass(self):
"""Register callbacks."""
async_dispatcher_connect(
self.hass, SIGNAL_PANEL_MESSAGE, self._message_callback)
@callback
def _message_callback(self, message):
"""Handle received messages."""
if message != self._state:
self._state = message
self.async_schedule_update_ha_state()
else:
_LOGGER.warning("Ignoring alarm status message, same state")
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def should_poll(self):
"""Return the polling state."""
return False
@property
def code_format(self):
"""Return the regex for code format or None if no code is required."""
return alarm.FORMAT_NUMBER
@property
def state(self):
"""Return the state of the device."""
return self._state
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
if code:
await self.hass.data[DATA_SATEL].disarm(code)
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
if code:
await self.hass.data[DATA_SATEL].arm(code)
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
if code:
await self.hass.data[DATA_SATEL].arm(
code, self._arm_home_mode)

View File

@@ -1,107 +0,0 @@
"""
Support for Vanderbilt (formerly Siemens) SPC alarm systems.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.spc/
"""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.core import callback
from homeassistant.components.spc import (DATA_API, SIGNAL_UPDATE_ALARM)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED, STATE_ALARM_TRIGGERED)
_LOGGER = logging.getLogger(__name__)
def _get_alarm_state(area):
"""Get the alarm state."""
from pyspcwebgw.const import AreaMode
if area.verified_alarm:
return STATE_ALARM_TRIGGERED
mode_to_state = {
AreaMode.UNSET: STATE_ALARM_DISARMED,
AreaMode.PART_SET_A: STATE_ALARM_ARMED_HOME,
AreaMode.PART_SET_B: STATE_ALARM_ARMED_NIGHT,
AreaMode.FULL_SET: STATE_ALARM_ARMED_AWAY,
}
return mode_to_state.get(area.mode)
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the SPC alarm control panel platform."""
if discovery_info is None:
return
api = hass.data[DATA_API]
async_add_entities([SpcAlarm(area=area, api=api)
for area in api.areas.values()])
class SpcAlarm(alarm.AlarmControlPanel):
"""Representation of the SPC alarm panel."""
def __init__(self, area, api):
"""Initialize the SPC alarm panel."""
self._area = area
self._api = api
async def async_added_to_hass(self):
"""Call for adding new entities."""
async_dispatcher_connect(self.hass,
SIGNAL_UPDATE_ALARM.format(self._area.id),
self._update_callback)
@callback
def _update_callback(self):
"""Call update method."""
self.async_schedule_update_ha_state(True)
@property
def should_poll(self):
"""No polling needed."""
return False
@property
def name(self):
"""Return the name of the device."""
return self._area.name
@property
def changed_by(self):
"""Return the user the last change was triggered by."""
return self._area.last_changed_by
@property
def state(self):
"""Return the state of the device."""
return _get_alarm_state(self._area)
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
from pyspcwebgw.const import AreaMode
await self._api.change_mode(area=self._area,
new_mode=AreaMode.UNSET)
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
from pyspcwebgw.const import AreaMode
await self._api.change_mode(area=self._area,
new_mode=AreaMode.PART_SET_A)
async def async_alarm_arm_night(self, code=None):
"""Send arm home command."""
from pyspcwebgw.const import AreaMode
await self._api.change_mode(area=self._area,
new_mode=AreaMode.PART_SET_B)
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
from pyspcwebgw.const import AreaMode
await self._api.change_mode(area=self._area,
new_mode=AreaMode.FULL_SET)

View File

@@ -1,106 +0,0 @@
"""
Interfaces with TotalConnect alarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.totalconnect/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_PASSWORD, CONF_USERNAME, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_DISARMED,
STATE_ALARM_ARMING, STATE_ALARM_DISARMING, STATE_UNKNOWN, CONF_NAME,
STATE_ALARM_ARMED_CUSTOM_BYPASS)
REQUIREMENTS = ['total_connect_client==0.22']
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'Total Connect'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up a TotalConnect control panel."""
name = config.get(CONF_NAME)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
total_connect = TotalConnect(name, username, password)
add_entities([total_connect], True)
class TotalConnect(alarm.AlarmControlPanel):
"""Represent an TotalConnect status."""
def __init__(self, name, username, password):
"""Initialize the TotalConnect status."""
from total_connect_client import TotalConnectClient
_LOGGER.debug("Setting up TotalConnect...")
self._name = name
self._username = username
self._password = password
self._state = STATE_UNKNOWN
self._client = TotalConnectClient.TotalConnectClient(
username, password)
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def state(self):
"""Return the state of the device."""
return self._state
def update(self):
"""Return the state of the device."""
status = self._client.get_armed_status()
if status == self._client.DISARMED:
state = STATE_ALARM_DISARMED
elif status == self._client.ARMED_STAY:
state = STATE_ALARM_ARMED_HOME
elif status == self._client.ARMED_AWAY:
state = STATE_ALARM_ARMED_AWAY
elif status == self._client.ARMED_STAY_NIGHT:
state = STATE_ALARM_ARMED_NIGHT
elif status == self._client.ARMED_CUSTOM_BYPASS:
state = STATE_ALARM_ARMED_CUSTOM_BYPASS
elif status == self._client.ARMING:
state = STATE_ALARM_ARMING
elif status == self._client.DISARMING:
state = STATE_ALARM_DISARMING
else:
state = STATE_UNKNOWN
self._state = state
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._client.disarm()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._client.arm_stay()
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._client.arm_away()
def alarm_arm_night(self, code=None):
"""Send arm night command."""
self._client.arm_stay_night()

View File

@@ -1,95 +0,0 @@
"""
Interfaces with Verisure alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.verisure/
"""
import logging
from time import sleep
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.verisure import CONF_ALARM, CONF_CODE_DIGITS
from homeassistant.components.verisure import HUB as hub
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN)
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Verisure platform."""
alarms = []
if int(hub.config.get(CONF_ALARM, 1)):
hub.update_overview()
alarms.append(VerisureAlarm())
add_entities(alarms)
def set_arm_state(state, code=None):
"""Send set arm state command."""
transaction_id = hub.session.set_arm_state(code, state)[
'armStateChangeTransactionId']
_LOGGER.info('verisure set arm state %s', state)
transaction = {}
while 'result' not in transaction:
sleep(0.5)
transaction = hub.session.get_arm_state_transaction(transaction_id)
# pylint: disable=unexpected-keyword-arg
hub.update_overview(no_throttle=True)
class VerisureAlarm(alarm.AlarmControlPanel):
"""Representation of a Verisure alarm status."""
def __init__(self):
"""Initialize the Verisure alarm panel."""
self._state = STATE_UNKNOWN
self._digits = hub.config.get(CONF_CODE_DIGITS)
self._changed_by = None
@property
def name(self):
"""Return the name of the device."""
return '{} alarm'.format(hub.session.installations[0]['alias'])
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def code_format(self):
"""Return one or more digits/characters."""
return alarm.FORMAT_NUMBER
@property
def changed_by(self):
"""Return the last change triggered by."""
return self._changed_by
def update(self):
"""Update alarm status."""
hub.update_overview()
status = hub.get_first("$.armState.statusType")
if status == 'DISARMED':
self._state = STATE_ALARM_DISARMED
elif status == 'ARMED_HOME':
self._state = STATE_ALARM_ARMED_HOME
elif status == 'ARMED_AWAY':
self._state = STATE_ALARM_ARMED_AWAY
elif status != 'PENDING':
_LOGGER.error('Unknown alarm state %s', status)
self._changed_by = hub.get_first("$.armState.name")
def alarm_disarm(self, code=None):
"""Send disarm command."""
set_arm_state('DISARMED', code)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
set_arm_state('ARMED_HOME', code)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
set_arm_state('ARMED_AWAY', code)

View File

@@ -1,75 +0,0 @@
"""
Interfaces with Wink Cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.wink/
"""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.wink import DOMAIN, WinkDevice
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN)
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['wink']
STATE_ALARM_PRIVACY = 'Private'
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Wink platform."""
import pywink
for camera in pywink.get_cameras():
# get_cameras returns multiple device types.
# Only add those that aren't sensors.
try:
camera.capability()
except AttributeError:
_id = camera.object_id() + camera.name()
if _id not in hass.data[DOMAIN]['unique_ids']:
add_entities([WinkCameraDevice(camera, hass)])
class WinkCameraDevice(WinkDevice, alarm.AlarmControlPanel):
"""Representation a Wink camera alarm."""
async def async_added_to_hass(self):
"""Call when entity is added to hass."""
self.hass.data[DOMAIN]['entities']['alarm_control_panel'].append(self)
@property
def state(self):
"""Return the state of the device."""
wink_state = self.wink.state()
if wink_state == "away":
state = STATE_ALARM_ARMED_AWAY
elif wink_state == "home":
state = STATE_ALARM_DISARMED
elif wink_state == "night":
state = STATE_ALARM_ARMED_HOME
else:
state = STATE_UNKNOWN
return state
def alarm_disarm(self, code=None):
"""Send disarm command."""
self.wink.set_mode("home")
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self.wink.set_mode("night")
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self.wink.set_mode("away")
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
'private': self.wink.private()
}

View File

@@ -1,98 +0,0 @@
"""
Yale Smart Alarm client for interacting with the Yale Smart Alarm System API.
For more details about this platform, please refer to the documentation at
https://www.home-assistant.io/components/alarm_control_panel.yale_smart_alarm
"""
import logging
import voluptuous as vol
from homeassistant.components.alarm_control_panel import (
AlarmControlPanel, PLATFORM_SCHEMA)
from homeassistant.const import (
CONF_PASSWORD, CONF_USERNAME, CONF_NAME,
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['yalesmartalarmclient==0.1.6']
CONF_AREA_ID = 'area_id'
DEFAULT_NAME = 'Yale Smart Alarm'
DEFAULT_AREA_ID = '1'
_LOGGER = logging.getLogger(__name__)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_AREA_ID, default=DEFAULT_AREA_ID): cv.string,
})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the alarm platform."""
name = config[CONF_NAME]
username = config[CONF_USERNAME]
password = config[CONF_PASSWORD]
area_id = config[CONF_AREA_ID]
from yalesmartalarmclient.client import (
YaleSmartAlarmClient, AuthenticationError)
try:
client = YaleSmartAlarmClient(username, password, area_id)
except AuthenticationError:
_LOGGER.error("Authentication failed. Check credentials")
return
add_entities([YaleAlarmDevice(name, client)], True)
class YaleAlarmDevice(AlarmControlPanel):
"""Represent a Yale Smart Alarm."""
def __init__(self, name, client):
"""Initialize the Yale Alarm Device."""
self._name = name
self._client = client
self._state = None
from yalesmartalarmclient.client import (YALE_STATE_DISARM,
YALE_STATE_ARM_PARTIAL,
YALE_STATE_ARM_FULL)
self._state_map = {
YALE_STATE_DISARM: STATE_ALARM_DISARMED,
YALE_STATE_ARM_PARTIAL: STATE_ALARM_ARMED_HOME,
YALE_STATE_ARM_FULL: STATE_ALARM_ARMED_AWAY
}
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def state(self):
"""Return the state of the device."""
return self._state
def update(self):
"""Return the state of the device."""
armed_status = self._client.get_armed_status()
self._state = self._state_map.get(armed_status)
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._client.disarm()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._client.arm_partial()
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._client.arm_full()

View File

@@ -1,206 +0,0 @@
"""
Support for AlarmDecoder devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alarmdecoder/
"""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.helpers.discovery import load_platform
from homeassistant.util import dt as dt_util
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
REQUIREMENTS = ['alarmdecoder==1.13.2']
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'alarmdecoder'
DATA_AD = 'alarmdecoder'
CONF_DEVICE = 'device'
CONF_DEVICE_BAUD = 'baudrate'
CONF_DEVICE_HOST = 'host'
CONF_DEVICE_PATH = 'path'
CONF_DEVICE_PORT = 'port'
CONF_DEVICE_TYPE = 'type'
CONF_PANEL_DISPLAY = 'panel_display'
CONF_ZONE_NAME = 'name'
CONF_ZONE_TYPE = 'type'
CONF_ZONE_LOOP = 'loop'
CONF_ZONE_RFID = 'rfid'
CONF_ZONES = 'zones'
CONF_RELAY_ADDR = 'relayaddr'
CONF_RELAY_CHAN = 'relaychan'
DEFAULT_DEVICE_TYPE = 'socket'
DEFAULT_DEVICE_HOST = 'localhost'
DEFAULT_DEVICE_PORT = 10000
DEFAULT_DEVICE_PATH = '/dev/ttyUSB0'
DEFAULT_DEVICE_BAUD = 115200
DEFAULT_PANEL_DISPLAY = False
DEFAULT_ZONE_TYPE = 'opening'
SIGNAL_PANEL_MESSAGE = 'alarmdecoder.panel_message'
SIGNAL_PANEL_ARM_AWAY = 'alarmdecoder.panel_arm_away'
SIGNAL_PANEL_ARM_HOME = 'alarmdecoder.panel_arm_home'
SIGNAL_PANEL_DISARM = 'alarmdecoder.panel_disarm'
SIGNAL_ZONE_FAULT = 'alarmdecoder.zone_fault'
SIGNAL_ZONE_RESTORE = 'alarmdecoder.zone_restore'
SIGNAL_RFX_MESSAGE = 'alarmdecoder.rfx_message'
SIGNAL_REL_MESSAGE = 'alarmdecoder.rel_message'
DEVICE_SOCKET_SCHEMA = vol.Schema({
vol.Required(CONF_DEVICE_TYPE): 'socket',
vol.Optional(CONF_DEVICE_HOST, default=DEFAULT_DEVICE_HOST): cv.string,
vol.Optional(CONF_DEVICE_PORT, default=DEFAULT_DEVICE_PORT): cv.port})
DEVICE_SERIAL_SCHEMA = vol.Schema({
vol.Required(CONF_DEVICE_TYPE): 'serial',
vol.Optional(CONF_DEVICE_PATH, default=DEFAULT_DEVICE_PATH): cv.string,
vol.Optional(CONF_DEVICE_BAUD, default=DEFAULT_DEVICE_BAUD): cv.string})
DEVICE_USB_SCHEMA = vol.Schema({
vol.Required(CONF_DEVICE_TYPE): 'usb'})
ZONE_SCHEMA = vol.Schema({
vol.Required(CONF_ZONE_NAME): cv.string,
vol.Optional(CONF_ZONE_TYPE,
default=DEFAULT_ZONE_TYPE): vol.Any(DEVICE_CLASSES_SCHEMA),
vol.Optional(CONF_ZONE_RFID): cv.string,
vol.Optional(CONF_ZONE_LOOP):
vol.All(vol.Coerce(int), vol.Range(min=1, max=4)),
vol.Inclusive(CONF_RELAY_ADDR, 'relaylocation',
'Relay address and channel must exist together'): cv.byte,
vol.Inclusive(CONF_RELAY_CHAN, 'relaylocation',
'Relay address and channel must exist together'): cv.byte})
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_DEVICE): vol.Any(
DEVICE_SOCKET_SCHEMA, DEVICE_SERIAL_SCHEMA,
DEVICE_USB_SCHEMA),
vol.Optional(CONF_PANEL_DISPLAY,
default=DEFAULT_PANEL_DISPLAY): cv.boolean,
vol.Optional(CONF_ZONES): {vol.Coerce(int): ZONE_SCHEMA},
}),
}, extra=vol.ALLOW_EXTRA)
def setup(hass, config):
"""Set up for the AlarmDecoder devices."""
from alarmdecoder import AlarmDecoder
from alarmdecoder.devices import (SocketDevice, SerialDevice, USBDevice)
conf = config.get(DOMAIN)
restart = False
device = conf.get(CONF_DEVICE)
display = conf.get(CONF_PANEL_DISPLAY)
zones = conf.get(CONF_ZONES)
device_type = device.get(CONF_DEVICE_TYPE)
host = DEFAULT_DEVICE_HOST
port = DEFAULT_DEVICE_PORT
path = DEFAULT_DEVICE_PATH
baud = DEFAULT_DEVICE_BAUD
def stop_alarmdecoder(event):
"""Handle the shutdown of AlarmDecoder."""
_LOGGER.debug("Shutting down alarmdecoder")
nonlocal restart
restart = False
controller.close()
def open_connection(now=None):
"""Open a connection to AlarmDecoder."""
from alarmdecoder.util import NoDeviceError
nonlocal restart
try:
controller.open(baud)
except NoDeviceError:
_LOGGER.debug("Failed to connect. Retrying in 5 seconds")
hass.helpers.event.track_point_in_time(
open_connection, dt_util.utcnow() + timedelta(seconds=5))
return
_LOGGER.debug("Established a connection with the alarmdecoder")
restart = True
def handle_closed_connection(event):
"""Restart after unexpected loss of connection."""
nonlocal restart
if not restart:
return
restart = False
_LOGGER.warning("AlarmDecoder unexpectedly lost connection.")
hass.add_job(open_connection)
def handle_message(sender, message):
"""Handle message from AlarmDecoder."""
hass.helpers.dispatcher.dispatcher_send(
SIGNAL_PANEL_MESSAGE, message)
def handle_rfx_message(sender, message):
"""Handle RFX message from AlarmDecoder."""
hass.helpers.dispatcher.dispatcher_send(
SIGNAL_RFX_MESSAGE, message)
def zone_fault_callback(sender, zone):
"""Handle zone fault from AlarmDecoder."""
hass.helpers.dispatcher.dispatcher_send(
SIGNAL_ZONE_FAULT, zone)
def zone_restore_callback(sender, zone):
"""Handle zone restore from AlarmDecoder."""
hass.helpers.dispatcher.dispatcher_send(
SIGNAL_ZONE_RESTORE, zone)
def handle_rel_message(sender, message):
"""Handle relay message from AlarmDecoder."""
hass.helpers.dispatcher.dispatcher_send(
SIGNAL_REL_MESSAGE, message)
controller = False
if device_type == 'socket':
host = device.get(CONF_DEVICE_HOST)
port = device.get(CONF_DEVICE_PORT)
controller = AlarmDecoder(SocketDevice(interface=(host, port)))
elif device_type == 'serial':
path = device.get(CONF_DEVICE_PATH)
baud = device.get(CONF_DEVICE_BAUD)
controller = AlarmDecoder(SerialDevice(interface=path))
elif device_type == 'usb':
AlarmDecoder(USBDevice.find())
return False
controller.on_message += handle_message
controller.on_rfx_message += handle_rfx_message
controller.on_zone_fault += zone_fault_callback
controller.on_zone_restore += zone_restore_callback
controller.on_close += handle_closed_connection
controller.on_relay_changed += handle_rel_message
hass.data[DATA_AD] = controller
open_connection()
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_alarmdecoder)
load_platform(hass, 'alarm_control_panel', DOMAIN, conf, config)
if zones:
load_platform(
hass, 'binary_sensor', DOMAIN, {CONF_ZONES: zones}, config)
if display:
load_platform(hass, 'sensor', DOMAIN, conf, config)
return True

Some files were not shown because too many files have changed in this diff Show More