Compare commits

...

5031 Commits

Author SHA1 Message Date
Paulus Schoutsen
279fd39677 Bumped version to 0.73.0b1 2018-07-01 13:40:55 -04:00
cdce8p
c978281d1e Revert some changes to setup.py (#15248) 2018-07-01 13:40:48 -04:00
Jason Hu
311a44007c Fix an issue when user's nest developer account don't have permission (#15237) 2018-07-01 13:40:48 -04:00
Anders Melchiorsen
47401739ea Make LIFX color/temperature attributes mutually exclusive (#15234) 2018-07-01 13:40:48 -04:00
Jason Hu
11ba7cc8ce Only create front-end client_id once (#15214)
* Only create frontend client_id once

* Check user and client_id before create refresh token

* Lint

* Follow code review comment

* Minor clenaup

* Update doc string
2018-07-01 13:40:47 -04:00
Andy Castille
c3ad30ec87 Rachio webhooks (#15111)
* Make fewer requests to the Rachio API

* BREAKING: Rewrite Rachio component
2018-07-01 13:40:47 -04:00
Paulus Schoutsen
5d6db9a915 Bump frontend to 20180701.0 2018-07-01 13:00:48 -04:00
Paulus Schoutsen
56bbadb501 Version bump to 0.73.0b0 2018-06-29 18:06:32 -04:00
Paulus Schoutsen
fa79aead9a Bumped version to 0.74.0b0 2018-06-29 18:04:00 -04:00
Paulus Schoutsen
24fec3e826 Merge remote-tracking branch 'origin/master' into dev 2018-06-29 18:01:40 -04:00
Daniel Shokouhi
2524dca7bf Use cached states for neato when possible (#15218) 2018-06-29 17:27:18 -04:00
Sebastian Muszynski
56f17b8651 Fix 'AirQualityMonitorStatus' object has no attribute ‘time_state’ (#15216) 2018-06-29 17:26:48 -04:00
Vignesh Venkat
49623d2dad Update python-wink to 1.9.1 (#15215)
Fixes a bug for when GE Z-Wave fan speeds are adjusted using the
wink app.
2018-06-29 17:26:06 -04:00
Anders Melchiorsen
66479dc2e5 Update eternalegypt (#15180)
* Update eternalegypt to 0.0.2

* Share websession

* Renames
2018-06-29 17:25:49 -04:00
Paulus Schoutsen
bbbec5a056 Bump frontend to 20180629.1 2018-06-29 17:21:54 -04:00
Hmmbob
94b55efef3 Stop supporting deprecated TLS ciphers (#15217)
* Stop supporting deprecated TLS ciphers

* Lint
2018-06-29 17:18:44 -04:00
Colin O'Dell
fd38caa287 X-Forwarded-For improvements and bug fixes (#15204)
* Use new trusted_proxies setting for X-Forwarded-For whitelist

* Only use the last IP in the header

Per Wikipedia (https://en.wikipedia.org/wiki/X-Forwarded-For#Format):

 > The last IP address is always the IP address that connects to the last proxy,
 > which means it is the most reliable source of information.

* Add two additional tests

* Ignore nonsense header values instead of failing
2018-06-29 16:27:06 -04:00
Sriram Vaidyanathan
c61a652c90 Fixed Indentation error (#15210)
* Fixed Indentation error

* Update xiaomi.py
2018-06-29 16:23:14 +02:00
cdce8p
e3e014bccc Fix zwave climate operation mode mappings (#15162) 2018-06-29 16:09:46 +02:00
Paulus Schoutsen
26590e244c Migrate home assistant auth provider to use storage helper (#15200) 2018-06-29 00:02:45 -04:00
Paulus Schoutsen
39971ee919 Make sure we check access token expiration (#15207)
* Make sure we check access token expiration

* Use correct access token websocket
2018-06-29 00:02:33 -04:00
Paulus Schoutsen
2205090795 Storage auth (#15192)
* Support parallel loading

* Add storage mock

* Store auth

* Fix tests
2018-06-28 22:14:26 -04:00
Alex Barcelo
a277470363 Adding 'namespace' for prometheus metrics (#13738)
* Updating prometheus client version

* Using `entity_filter` as filter mechanism

* New optional `namespace` configuration
2018-06-28 16:49:33 +02:00
Colin O'Dell
19f2bbf52f Only use the X-Forwarded-For header if connection is from a trusted network (#15182)
See https://github.com/home-assistant/home-assistant/issues/14345#issuecomment-400854569
2018-06-28 09:16:11 -04:00
Pascal Vizeli
dbb786c548 DarkSky weather / Fix states (#15174)
* DarkSky weather / Fix states

* fix lint

* fix tests
2018-06-28 12:23:32 +02:00
Daniel Shokouhi
4fbe3bb070 Finalize BotVac D7 Support And Further Reduce Cloud Calls (#15161)
* Finalize BotVac D7 Support And Further Reduce Cloud Calls

* Lint

* Lint Again

* Implement requested changes

* Hound

* Lint
2018-06-27 22:55:27 +02:00
MizterB
9066ac44fe Philips Hue Scene Activation: Simplified scene lookup logic, improved error handling (#15175)
* Simplified scene lookup logic, improved error handling

* Lint
2018-06-27 15:22:29 -04:00
Paulus Schoutsen
742144f401 Warn when using custom components (#15172)
* Warn when using custom components

* Update text
2018-06-27 15:21:32 -04:00
Paulus Schoutsen
c0b6a857f7 Version bump to 20180627.0 2018-06-27 14:20:24 -04:00
Tom Harris
d6dee62c92 Add Mini remote support to insteon_plm (#15152)
* Add mini-remote

* Bump insteonplm version to 0.11.3 to support mini-remotes
2018-06-27 12:19:56 +02:00
Fabian Affolter
41017f10a3 Upgrade sendgrid to 5.4.1 (#15166) 2018-06-27 12:12:02 +02:00
Fabian Affolter
ba50a5c329 Upgrade keyring to 13.0.0 (#15167) 2018-06-27 12:11:41 +02:00
Fabian Affolter
4208bb457d Upgrade youtube_dl to 2018.06.25 (#15168) 2018-06-27 12:11:26 +02:00
Matt Snyder
15af6b1ad9 Address inconsistent behavior on flux_led component (#14713)
* Address inconsistent behavior between different controllers.
Correct issue with comparison that was preventing white value slider from being shown.

* Add white mode for Flux LED

* Call _bulb.turnOn() after bulb properties have been set to prevent immediate on action

* Only use existing brightness if rgb is None to prevent unexpected recalculation of passed rgb values.

* Remove blank line

* Undo change so current brightness is used in all cases.
2018-06-26 21:23:57 +02:00
Robert Kiss
3921dc77a6 Add SSL peer certificate support to HTTP server (#15043)
* adding SSL peer certificate support to HTTP server

* remove unnecessary exception block
2018-06-26 11:44:08 -04:00
Matt LeBrun
0094fd5c34 Add channel changing support to SamsungTV component (#14451)
Add channel changing support to SamsungTV component
2018-06-26 16:22:10 +02:00
Paulus Schoutsen
d58e401812 Merge pull request #15149 from home-assistant/rc
0.72.1
2018-06-25 17:25:44 -04:00
Paulus Schoutsen
c79c94550f Return None to indicate no config found (#15147)
* Return None to indicate no config found

* Fix tests
2018-06-25 17:21:38 -04:00
Paulus Schoutsen
9b950f5192 Bumped version to 0.72.1 2018-06-25 16:59:14 -04:00
Jason Hu
2520fddbdf Bump python-nest to 4.0.3 (#15098)
Resolve network reconnect issue
2018-06-25 16:59:00 -04:00
Paulus Schoutsen
3f21966ec9 Fix cast config (#15143) 2018-06-25 16:58:27 -04:00
Jason Hu
69502163bd Skip nest security state sensor if no Nest Cam exists (#15112) 2018-06-25 16:57:27 -04:00
Aaron Bach
893e0f8db6 Fix socket bug with Yi in 0.72 (#15109)
* Fixes BrokenPipeError exceptions with Yi (#15108)

* Make sure to close the socket
2018-06-25 16:57:26 -04:00
Jason Hu
1c8b52f630 Prevent Nest component setup crash due insufficient permission. (#14966)
* Prevent Nest component setup crash due insufficient permission.

* Trigger CI

* Better error handle and address code review comments

* Lint

* Tiny wording adjust

* Notify user if async_setup_entry failed

* Return False if exception occurred in NestDevice.initialize
2018-06-25 16:57:26 -04:00
Jason Hu
6e4fb7a937 Prevent Nest component setup crash due insufficient permission. (#14966)
* Prevent Nest component setup crash due insufficient permission.

* Trigger CI

* Better error handle and address code review comments

* Lint

* Tiny wording adjust

* Notify user if async_setup_entry failed

* Return False if exception occurred in NestDevice.initialize
2018-06-25 16:06:00 -04:00
Paulus Schoutsen
ab1939f56f Bump frontend to 20180625.0 2018-06-25 16:04:30 -04:00
Paulus Schoutsen
15507df407 Bump frontend to 20180625.0 2018-06-25 16:04:17 -04:00
Paulus Schoutsen
46ea28a4f8 Fix cast config (#15143) 2018-06-25 15:59:05 -04:00
Sriram Vaidyanathan
c8458fd7c5 Update xiaomi.py (#15136)
* Update xiaomi.py

Minor logic fix for Xiaofang cameras.

* Removed whitespace

* Removed whitespace
2018-06-25 13:14:36 -04:00
Jason Hu
e681a7929c Skip nest security state sensor if no Nest Cam exists (#15112) 2018-06-25 13:13:41 -04:00
Martin Hjelmare
b2d37ccef6 Fix mysensors climate supported features (#15110) 2018-06-25 13:06:12 -04:00
Luc Touraille
9dd2c36de4 Update aiofreepybox to fix HTTPS connection issues (#15104)
The previous version of aiofreepybox was not working with custom
domain names, which uses a Let's Encrypt certificates. Also, it
was not working with the default domain name when connecting to
Freebox v6. This should be fixed in aiofreepybox 0.0.4.

See https://github.com/stilllman/freepybox/pull/1,
https://github.com/stilllman/freepybox/pull/3 and
https://github.com/stilllman/freepybox/issues/2 for more info.
2018-06-25 13:05:33 -04:00
Ville Skyttä
b92350fb55 Lint cleanup (#15103)
* Remove unneeded inline pylint disables

* Remove unneeded noqa's

* Use symbol names instead of message ids in inline pylint disables
2018-06-25 13:05:07 -04:00
Jason Hu
6c0fc65eaf Bump python-nest to 4.0.3 (#15098)
Resolve network reconnect issue
2018-06-25 13:04:32 -04:00
Pascal Vizeli
42ba2a68ce Revert "Add language to dark sky weather component" (#15142)
* Revert "Fix #14919. Should throw exception when camera stream closed by frontend (#15028)"

This reverts commit 508d0459a7.

* Revert "Fix pylintrc section order and option placements (#15120)"

This reverts commit dbae410cf4.

* Revert "Add storage helper and migrate config entries (#15045)"

This reverts commit ae51dc08bf.

* Revert "Add language to dark sky weather component (#15130)"

This reverts commit 672a3c7178.
2018-06-25 19:04:07 +02:00
Jason Hu
508d0459a7 Fix #14919. Should throw exception when camera stream closed by frontend (#15028)
* Fix #14919. Should throw exception when camera stream closed by frontend

* Re-trigger CI

* pythonic re-raise
2018-06-25 13:03:39 -04:00
Ville Skyttä
dbae410cf4 Fix pylintrc section order and option placements (#15120) 2018-06-25 12:55:03 -04:00
Paulus Schoutsen
ae51dc08bf Add storage helper and migrate config entries (#15045)
* Add storage helper

* Migrate config entries to use the storage helper

* Make sure tests do not do I/O

* Lint

* Add versions to stored data

* Add more instance variables

* Make migrator load config if nothing to migrate

* Address comments
2018-06-25 12:53:49 -04:00
Pascal Vizeli
672a3c7178 Add language to dark sky weather component (#15130)
* Add language to dark sky weather component

* Update darksky.py
2018-06-25 08:35:44 -06:00
cdce8p
f8bc3411ad PyPi: Fix description and setup.cfg (#15107)
* Fix description and extend use of setup.cfg

* Fix lint
2018-06-25 09:57:26 -04:00
Adam Mills
038168c417 Support for Homekit Controller climate devices (#15057)
* Support for Homekit Controller climate devices

* Handle stale state when operating mode off
2018-06-25 09:45:26 -04:00
dreizehnelf
73034c933e Add discovery support to mqtt climate component. (#15085)
* Add discovery support to mqtt climate component.

* - Fix flake8 error (./homeassistant/components/climate/mqtt.py:130:1: D202 No blank lines allowed after function docstring)
- Fix test error (since climate component was expected not to work - changed it to "lock" component, which also does not have MQTT discovery support yet)

* Fix old assert statement to reflect new lock component usage

* Change invalid MQTT discovery component type from 'lock' to 'timer', since contrary to the documentation the lock component is properly supported when using MQTT discovery.

* Make configuration of invalid MQTT config component a single point of entry to prevent missing the assertion later in the code when changing.

* Add new testcases to cover not-yet-covered code paths in https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/climate/mqtt.py
2018-06-25 15:13:19 +02:00
b3nj1
d3ceb9080c MQTT Alarm Control Panel: add retain option for publishing for cases... (#15134)
* MQTT Alarm Control Panel: add retain option for publishing for cases where receiver is asleep

* MQTT Alarm Control Panel: add retain option for publishing for cases where receiver is asleep

* MQTT Alarm Control Panel: add retain option for publishing for cases where receiver is asleep
2018-06-25 14:04:16 +02:00
Martin Hjelmare
3893d8a876 Reorganize mysensors (#15123)
* Move mysensors.py to package

* Move mysensors component to package

* Split code into multiple modules.

* Update coveragerc
2018-06-25 13:58:16 +02:00
Tom Harris
05924a2868 Bump insteonplm version to 0.11.2 (#15133)
* Bump insteonplm version to 0.11.2

* Gratuitous commit to force travis again.

* Reverse change made to force Travis CI
2018-06-25 13:46:55 +02:00
Aaron Bach
021d08a9c4 Make sure Yi utilizes existing event loop (#15131) 2018-06-24 19:09:08 -06:00
Robert Svensson
5a71a22fb9 deCONZ small improvements (#15128)
* Make sure that bridge id is available for config entry

* Fix so deconz reports proper color values

* Bump dependency to v39
2018-06-24 15:48:59 -06:00
Aaron Bach
6064932e2e Make Pollen.com platform async (#14963)
* Most of the work in place

* Final touches

* Small style updates

* Owner-requested changes

* Member-requested changes
2018-06-24 11:04:31 -06:00
Marcelo Moreira de Mello
9de7034d0e Added attribute attribution to Digital Ocean component (#15114) 2018-06-24 13:36:27 +02:00
Andrey
96d5684a89 Switch to pypi version of pybotvac (#15115) 2018-06-24 11:06:25 +02:00
Aaron Bach
91962e2681 Fix socket bug with Yi in 0.72 (#15109)
* Fixes BrokenPipeError exceptions with Yi (#15108)

* Make sure to close the socket
2018-06-23 13:22:48 -06:00
Paulus Schoutsen
ee31f89049 Merge branch 'master' into dev 2018-06-22 13:40:53 -04:00
Paulus Schoutsen
370c3f28b8 Merge pull request #15088 from home-assistant/rc
0.72
2018-06-22 13:38:44 -04:00
Paulus Schoutsen
66110a7d57 Bump frontend to 20180622.1 2018-06-22 12:48:01 -04:00
Paulus Schoutsen
c419cbb46f Bump frontend to 20180622.1 2018-06-22 12:46:45 -04:00
Paulus Schoutsen
a02d7989d5 Use older syntax for version bump 2018-06-22 11:07:26 -04:00
Paulus Schoutsen
7325847fa9 Bumped version to 0.72.0 2018-06-22 10:24:45 -04:00
Paulus Schoutsen
124495dd84 Update frontend to 20180622.0 2018-06-22 10:24:38 -04:00
Paulus Schoutsen
0c01f3a0fe Update frontend to 20180622.0 2018-06-22 10:24:04 -04:00
Paulus Schoutsen
0ea2d99910 Bumped version to 0.72.0b9 2018-06-21 17:39:02 -04:00
Paulus Schoutsen
6456f66b47 Frontend bump to 20180621.2 2018-06-21 17:38:57 -04:00
Paulus Schoutsen
94eee6d069 Frontend bump to 20180621.2 2018-06-21 17:38:44 -04:00
Paulus Schoutsen
6e5a2a77ab Bumped version to 0.72.0b8 2018-06-21 17:27:08 -04:00
Paulus Schoutsen
35b609dd8b Allow writing commit with version bump 2018-06-21 17:27:01 -04:00
Paulus Schoutsen
0df99f8762 Bump frontend to 20180621.1 2018-06-21 17:22:08 -04:00
Paulus Schoutsen
6781ecf159 Bump frontend to 20180621.1 2018-06-21 17:15:16 -04:00
Paulus Schoutsen
a4b843eb2d Version bump to 0.72.0b7 2018-06-21 15:02:29 -04:00
Daniel Shokouhi
302717e8a1 Update Neato Library And Reduce Cloud Calls (#15072)
* Update Neato library to 0.0.6 and reduce the amount of calls to the cloud

* Remove file commited in error

* Lint
2018-06-21 15:02:13 -04:00
Bob Clough
617647c5fd Fix MQTT Light with RGB and Brightness (#15053)
* Fix MQTT Light with RGB and Brightness

When an MQTT light is given an RGB and Brightness topic, the RGB
is scaled by the brightness *as well* as the brightness being set

This causes 255,0,0 at 50% brightness to be sent as 127,0,0 at 50%
brightness, which ends up as 63,0,0 after the RGB bulb has applied
its brightness scaling.

Fixes the same issue in mqtt, mqtt-json and mqtt-template.

Related Issue: #13725

* Add comment to mqtt_json as well
2018-06-21 15:00:06 -04:00
Tom Harris
4b5d578c08 X10 (#14741)
* Implement X10

* Add X10 after add_device_callback

* Ref device by id not hex and add x10OnOffSwitch name

* X10 services and add sensor device

* Correctly reference X10_HOUSECODE_SCHEMA

* Log adding of X10 devices

* Add X10 All Units Off, All Lights On and All Lights Off devices

* Correct ref to X10 states vs devices

* Add X10 All Units Off, All Lights On and All Lights Off devices

* Correct X10 config

* Debug x10 device additions

* Config x10 from bool to housecode char

* Pass PLM to X10 device create

* Remove PLM to call to add_x10_device

* Unconfuse x10 config and method names

* Correct spelling of x10_all_lights_off_housecode

* Bump insteonplm to 0.10.0 to support X10
2018-06-21 15:00:06 -04:00
Bob Clough
bfc55137ea Fix MQTT Light with RGB and Brightness (#15053)
* Fix MQTT Light with RGB and Brightness

When an MQTT light is given an RGB and Brightness topic, the RGB
is scaled by the brightness *as well* as the brightness being set

This causes 255,0,0 at 50% brightness to be sent as 127,0,0 at 50%
brightness, which ends up as 63,0,0 after the RGB bulb has applied
its brightness scaling.

Fixes the same issue in mqtt, mqtt-json and mqtt-template.

Related Issue: #13725

* Add comment to mqtt_json as well
2018-06-21 14:59:02 -04:00
Paulus Schoutsen
e98e7e2751 Update frontend to 20180621.0 2018-06-21 14:57:19 -04:00
Paulus Schoutsen
b687de879c Update frontend to 20180621.0 2018-06-21 14:57:08 -04:00
Martin Hjelmare
4048ad36a8 Add script to run monkeytype typing on test suite (#14440)
* The monkeytype script takes an optional argument to specify a test
  module or directory to run. Otherwise the whole test suite will run.
* Add monkeytype sqlite db to gitignore.
2018-06-21 15:06:05 +02:00
hanzoh
8c2f0e3b30 Homematic: Add optional port for resolvenames via JSON (#15029)
* Add optional JSON port
2018-06-21 14:52:02 +02:00
Daniel Shokouhi
6cabbd2592 Update Neato Library And Reduce Cloud Calls (#15072)
* Update Neato library to 0.0.6 and reduce the amount of calls to the cloud

* Remove file commited in error

* Lint
2018-06-20 21:46:15 -04:00
Daniel Perna
8d22754a06 Update pyhomematic to 0.1.44 (#15069)
* Update __init__.py

* Update requirements_all.txt
2018-06-20 21:44:50 -04:00
Tom Harris
be6d1b5e94 X10 (#14741)
* Implement X10

* Add X10 after add_device_callback

* Ref device by id not hex and add x10OnOffSwitch name

* X10 services and add sensor device

* Correctly reference X10_HOUSECODE_SCHEMA

* Log adding of X10 devices

* Add X10 All Units Off, All Lights On and All Lights Off devices

* Correct ref to X10 states vs devices

* Add X10 All Units Off, All Lights On and All Lights Off devices

* Correct X10 config

* Debug x10 device additions

* Config x10 from bool to housecode char

* Pass PLM to X10 device create

* Remove PLM to call to add_x10_device

* Unconfuse x10 config and method names

* Correct spelling of x10_all_lights_off_housecode

* Bump insteonplm to 0.10.0 to support X10
2018-06-20 21:44:05 -04:00
Paulus Schoutsen
c84f1d7d33 Version bump to 0.72.0b6 2018-06-20 15:13:33 -04:00
Paulus Schoutsen
49845d9398 Rename experimental UI to lovelace (#15065)
* Rename experimental UI to lovelace

* Bump frontend to 20180620.0
2018-06-20 15:13:22 -04:00
Paulus Schoutsen
895306f822 Rename experimental UI to lovelace (#15065)
* Rename experimental UI to lovelace

* Bump frontend to 20180620.0
2018-06-20 15:13:08 -04:00
Thibault Cohen
a729742757 Fix tplink max/min kelvin for temperature adjustment (#15020) 2018-06-20 19:29:36 +02:00
William Scanlon
6bc03ee763 Python wink update (#15048)
* Updated python-wink to 1.9.0

* Added support for groups of Wink shades.
2018-06-20 09:41:28 -04:00
Dejan Dakić
75580dfade Upgraded librouteros since it has support for authenticatoin in new RouterOS. (#15056) 2018-06-20 09:15:40 +02:00
Marcelo Moreira de Mello
1f8699d9b4 Upgrade pyarlo to 0.1.8 to support Arlo Baby monitor (#15060) 2018-06-20 07:50:38 +02:00
gstorer
fca5d55b43 Update pywemo to version 0.4.28. (#15052) 2018-06-19 11:16:31 -04:00
Paulus Schoutsen
659616a4eb Version bump to 0.72.0b5 2018-06-19 10:58:57 -04:00
Paulus Schoutsen
3b4f7b4f5d Update frontend to 20180619.0 2018-06-19 10:56:44 -04:00
Paulus Schoutsen
62432ced90 Update frontend to 20180619.0 2018-06-19 10:56:33 -04:00
Raoul Teeuwen
27873b4457 Update condition.py (#15021)
* Update condition.py

Added code that writes to warning-log what entity causes a problem when 'value cannot be processed as a number', making troubleshooting easier.

* Make a one-line warning
2018-06-19 13:26:52 +02:00
Andrey
1e7333eeb6 Switch to own packaged version of pyflic (#15041) 2018-06-19 10:31:21 +02:00
Andrey
7cd620d30f Switch upstream adafruit package (#15038) 2018-06-19 10:30:43 +02:00
Fabian Affolter
7a180ac205 Update loopenergy link to docs (#15050) 2018-06-19 09:56:29 +02:00
Hate-Usernames
153ccda853 Patch save_json (#15046) 2018-06-18 21:34:36 -04:00
Jeff Irion
067e4f6d9a Show running apps as sources for Fire TV (#15033)
* Show running apps as sources for Fire TV

* Fix unnecessary 'else' after 'return' (no-else-return)

* Remove 'pylint: disable=unused-argument'

* cleanup
2018-06-18 18:13:50 +02:00
Fabian Affolter
9d6ce609f9 Upgrade requests to 2.19.1 (#15019) 2018-06-18 18:13:21 +02:00
Paulus Schoutsen
9800b74a6d Version bump to 0.72.0b4 2018-06-18 10:00:47 -04:00
Paulus Schoutsen
ef5b2a2492 Version bump to 0.72.0b3 2018-06-18 10:00:24 -04:00
Pascal Vizeli
60179a1cbb Bugfix empty entity lists (#15035)
* Bugfix empty entity lists

* Add tests

* Update test_entity_platform.py

* Update entity_platform.py
2018-06-18 09:59:58 -04:00
Paulus Schoutsen
e0cea2d18d Make zone entries work without radius (#15032) 2018-06-18 09:59:58 -04:00
Fabian Affolter
e29dfa8609 Upgrade aiohttp to 3.3.2 (#15025) 2018-06-18 09:59:57 -04:00
Martin Hjelmare
ef39bca52e Fix linode I/O in state property (#15010)
* Fix linode I/O in state property

* Move update of all attrs to update
2018-06-18 09:58:58 -04:00
Paulus Schoutsen
5a3ea74a26 Bump frontend to 20180618.0 2018-06-18 09:58:35 -04:00
Paulus Schoutsen
8869617890 Bump frontend to 20180618.0 2018-06-18 09:58:16 -04:00
Pascal Vizeli
62f970e486 Bugfix empty entity lists (#15035)
* Bugfix empty entity lists

* Add tests

* Update test_entity_platform.py

* Update entity_platform.py
2018-06-18 09:22:52 -04:00
Martin Hjelmare
f9a21dbfda Fix linode I/O in state property (#15010)
* Fix linode I/O in state property

* Move update of all attrs to update
2018-06-18 09:21:41 -04:00
Pascal Vizeli
86c6b4d8e3 Fix panel URL authentication for Hass.io (#15024)
* Update http.py

* Update http.py

* fix tests

* Update test_http.py
2018-06-18 07:26:41 +02:00
Jeff Irion
7bfa81c592 Improve volume support for Vizio Smartcast (#14981)
* Improve volume support for Vizio Smartcast

* Vizio: avoid an error when 'self._device.get_current_volume()' returns 'None'

* Improve volume support for Vizio Smartcast

* Vizio: avoid an error when 'self._device.get_current_volume()' returns 'None'

* First line should end with a period
2018-06-17 22:06:53 -06:00
gstorer
d07e40c483 Expose Wemo component availability to home assistant (#14995)
* Expose Wemo component availability to home assistant

* Do not add availability feature to dimmer - it works differently

* Brain fade, deleted completely the wrong thing.

Revert "Do not add availability feature to dimmer - it works differently"

This reverts commit f64e717981.

* (2nd attempt) Do not add availability feature to dimmer - it works differently
2018-06-17 22:05:14 -06:00
Kees Schollaart
0e7e58f172 Update PostNL unit of measure to align with UPS (#15023)
I'm using both the UPS and PostNL package trackers. I'd like to have the unit of measure to be the same, now they appear in two different graphs in the history view. 

If we prefer ```package(s)``` over ```package``` then I'll do a PR for [this line](https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/sensor/ups.py#L81)
2018-06-17 21:57:08 -06:00
Paulus Schoutsen
cbdfc95cc8 Make zone entries work without radius (#15032) 2018-06-17 21:55:35 -06:00
Paulus Schoutsen
1642502a70 Update translations 2018-06-17 23:05:10 -04:00
Paulus Schoutsen
33ebd99068 Update translations 2018-06-17 23:04:52 -04:00
Fabian Affolter
9c17e95fc5 Upgrade aiohttp to 3.3.2 (#15025) 2018-06-17 20:24:11 -04:00
Matt Schmitt
1533bc1e1f Add support for Homekit battery service (#14288) 2018-06-17 20:54:34 +02:00
Pascal Vizeli
da3695dccc Update test_http.py 2018-06-17 20:37:46 +02:00
Pascal Vizeli
40c8f5f70e Fix panel URL authentication for Hass.io (#15024)
* Update http.py

* Update http.py

* fix tests

* Update test_http.py
2018-06-17 20:34:47 +02:00
Fabian Affolter
3ceee66e1b Remove typing (#15018) 2018-06-17 19:13:39 +02:00
Andrey
6b908b6f4e Switch nuimo to a hopefully working pypi version (#15006) 2018-06-17 09:41:49 -04:00
Fabian Affolter
a74b081d44 Upgrade youtube_dl to 2018.06.14 (#15013) 2018-06-17 09:41:06 -04:00
Fabian Affolter
bc8093c73b Upgrade numpy to 1.14.5 (#15015) 2018-06-17 09:39:27 -04:00
Fabian Affolter
ca2712506b Update to hole to 0.3.0 (#15014) 2018-06-17 09:38:56 -04:00
Fabian Affolter
c871e8da5d Upgrade netdisco to 1.5.0 (#15016) 2018-06-17 09:38:00 -04:00
Matt Schmitt
722c27f1e2 HomeKit style clean up (#14793) 2018-06-17 13:37:44 +02:00
Andrey
e3fcf46566 Switch to own packaged version of braviarc (#15009) 2018-06-17 13:07:10 +02:00
Andrey
1117371b31 Switch to own packaged version of anel_pwrctrl (#15011) 2018-06-17 13:05:25 +02:00
Petro31
addca54118 Add entity support to Waze Travel Time (#14934)
Current version only supports latitude and longitude or an address for the origin and destination fields. This update allows those fields to use entity IDs of device_tracker, zone, and sensor.
2018-06-17 07:13:47 +02:00
Paulus Schoutsen
471d6e45eb Version bump to 0.72.0b2 2018-06-16 22:37:13 -04:00
Paulus Schoutsen
7238205adb Frontend bump to 20180617.0 2018-06-16 22:36:51 -04:00
Paulus Schoutsen
3db5d5bbf9 Frontend bump to 20180617.0 2018-06-16 22:35:19 -04:00
Paulus Schoutsen
65970a2248 Version bump to 0.72.0b1 2018-06-16 17:36:35 -04:00
Paulus Schoutsen
5d82f48c02 Add experimental UI backend (#15002)
* Add experimental UI

* Add test

* Lint
2018-06-16 17:36:10 -04:00
Teemu R
8e185bc300 Bump pyhs100 version (#15001)
Fixes #13925
2018-06-16 17:36:10 -04:00
Andrey
a013908115 Switch to own packaged version of spotipy (#14997) 2018-06-16 17:36:09 -04:00
Sebastian Muszynski
bdf6257640 Remove load power attribute for channel USB (#14996)
* Remove load power attribute for channel USB

* Fix format
2018-06-16 17:36:09 -04:00
Paulus Schoutsen
1f50e335fa Bump frontend to 20180616.0 2018-06-16 17:35:52 -04:00
Paulus Schoutsen
1375adfeab Bump frontend to 20180616.0 2018-06-16 17:32:49 -04:00
Paulus Schoutsen
00cbdffa12 Add experimental UI backend (#15002)
* Add experimental UI

* Add test

* Lint
2018-06-16 17:12:03 -04:00
Sebastian Muszynski
c5f012c85a Remove load power attribute for channel USB (#14996)
* Remove load power attribute for channel USB

* Fix format
2018-06-16 15:53:25 -04:00
Andrey
656eae288e Switch to own packaged version of spotipy (#14997) 2018-06-16 15:52:23 -04:00
Teemu R
5898307715 Bump pyhs100 version (#15001)
Fixes #13925
2018-06-16 15:52:03 -04:00
Paulus Schoutsen
9b0efdc8c8 Version bump to 0.73.0.dev0 2018-06-16 10:51:55 -04:00
Paulus Schoutsen
87f9f17335 Version bump to 0.72.0b0 2018-06-16 10:51:07 -04:00
Paulus Schoutsen
f101f6b7cb Merge remote-tracking branch 'origin/master' into dev 2018-06-16 10:50:43 -04:00
Jason Hu
abf07b60f0 Refactoring camera component to use async/await syntax. (#14990)
* Refactoring camera component to use async/await syntax

Also updated camera demo platform to encourage use of async

* Code review
2018-06-16 10:49:11 -04:00
Paulus Schoutsen
0b114f0755 Do not mount deps folder when running in virtual env (#14993)
* Do not mount deps folder when inside virtual env

* Add tests

* Fix package test
2018-06-16 10:48:41 -04:00
Marcelo Moreira de Mello
3ee8f58fdf Upgraded RainCloudy to version 0.0.5 (#14986) 2018-06-16 06:58:18 -04:00
Marcelo Moreira de Mello
ff4da05267 Upgraded python-amcrest to 1.2.3 (#14988) 2018-06-16 06:57:58 -04:00
Marcelo Moreira de Mello
17308a2730 Upgraded PyArlo to 0.1.7 (#14987) 2018-06-16 06:57:27 -04:00
cdce8p
7d9bce2153 Fix extended package support (#14980)
* Fix package recurive merge bug

* Fixed extended package support
2018-06-16 06:55:32 -04:00
Marcelo Moreira de Mello
2839f0ff5f Upgrade ring_doorbell to 0.2.1 to fix oauth issues (#14984)
* Upgraded to ring_doorbell to 0.2.1 to fix oauth issues

* Updated unittest to cover Ring oauth
2018-06-16 08:58:39 +02:00
Johan Bloemberg
2ec295a6f8 Add availability to Rflink entities. (#14977) 2018-06-16 00:26:48 +02:00
Ville Skyttä
4bd7a7eee3 Remove inline pylint disables for messages disabled in pylintrc (#14978) 2018-06-16 00:15:46 +02:00
c727
d0cbbe6141 Return ISO formated datetime in forecast (#14975)
* Return ISO formated datetime in forecast

* Lint
2018-06-15 17:09:01 -04:00
John Mihalic
9efa31ef9f Eight Sleep add REM type, Update async syntax, Catch API quirks (#14937) 2018-06-15 15:24:09 -04:00
Paulus Schoutsen
8a777f6e78 Show notification when user configures Nest client_id/secret (#14970)
* Show notification when user configures Nest client_id/secret

* Lint
2018-06-15 15:19:58 -04:00
Robert Svensson
ac13a2736b Deconz make groups configurable (#14704)
* Make groups configurable

* Config flow and tests in place

* Fix too long line
2018-06-15 14:31:22 -04:00
Albert Lee
940577e105 Fix binary_sensor.skybell state update when there are no events (#14927) 2018-06-15 14:30:35 -04:00
Sriram Vaidyanathan
c917470836 Xiaomi Cameras - multiple models (#14244)
* Added support for Xiaofang Camera

* Added entry for Xiaofang 1080p camera

* Code fix

* Minor comment fix

* Updated coveragerc for Xiaomi cameras

* Added Xiaomi Camera

Added Xiaomi Camera to accommodate multiple models like Yi, Xiaofang, etc.

* Minor code fix

* Minor code fix

* Added model property

* Update xiaomi.py

* Minor code fix

* Update xiaomi.py

* Update xiaomi.py

* Minor code fix

* Package requirement fix due to Version conflict

* To fix conflicts

* Update package_constraints.txt

* Minor fix

* Update xiaomi.py

* Update xiaomi.py

Changes made per comment

* Update xiaomi.py

* Don't update on add.
2018-06-15 14:27:52 -04:00
Paulus Schoutsen
47a344f3a1 Bump frontend to 20180615.0 2018-06-15 13:46:31 -04:00
Paulus Schoutsen
f744a29d9d Add calendar panel, add tests (#14973) 2018-06-15 13:37:46 -04:00
Thibault Cohen
3cd4cb741c Add Calendar API endpoint to get events (#14702)
* Add Calendar API endpoint to get events

* Set default event color

* Fix PR comments

* Fix PR comments

* Fix PR comments

* Remote local.py file

* Use iso 8601

* Fix lint

* Fix PR comments

* Fix PR comments

* Add Support for todoist and demo calendar

* Todoist events are allday events

* Add calendar demo api endpoint test

* Register only one api endpoint for calendar

* Rename demo calendar
2018-06-15 11:16:31 -04:00
Paulus Schoutsen
1128104281 Adhere to scan_interval in platforms when setup via config entry (#14969) 2018-06-15 16:59:13 +02:00
Aaron Bach
d6d685a483 Fix smappee component - "Error on device update" (#14883) 2018-06-14 19:35:53 -06:00
Paulus Schoutsen
2c6e6c2a6f Add config entry for Sonos + Cast (#14955)
* Add config entry for Sonos

* Lint

* Use add_job

* Add Cast config entry

* Lint

* Rename DOMAIN import

* Mock pychromecast in test
2018-06-14 15:17:54 -04:00
Benedict Aas
c8e0de19b6 add relative time option to simulated sensors (#14038)
By default simulated sensors are relative to when they're activated,
instead we make this togglable with this new option 'relative_to_epoch',
and instead they become relative to 1970-01-01 00:00:00.
2018-06-14 14:06:49 -04:00
Paulus Schoutsen
b2440a6d95 Fix tests (#14959)
* Fix tests

* Lint
2018-06-14 11:57:09 -04:00
ruohan.chen
c36c3f0d64 Add support for ZhongHong HVAC Controllers (#14552)
* first blood for ZhongHong HVAC Controller

* add requirements

* requirements_all.txt updated

* add zhong_hong.py to coveragerc

* add comments

* unique_id add platform name

* zhong_hong_hvac version bump to 1.0.1

* improve some coding style to match the project standard

* zhong_hong_hvac version bump to 1.0.4

* zhong_hong_hvac version require 1.0.7

* update requirements by script/gen_requirements_all.py

* zhong_hong_hvac version bump to 1.0.8

* fix startup problem

* remove unused import

* zhong_hong_hvac version bump to 1.0.9

- operation_mode: cold -> cool

* start hub listen event when all climate entities is ready

* use dispatcher to setup hub

* var name change

SIGNAL_DEVICE_SETTED_UP -> SIGNAL_DEVICE_ADDED

* async problem fix

* bugfix: set_operation_mode forget to use upper case

* stringify the exception instead of print full stack of traceback

* avoid to call str(exception) explicity

* remove unnecessary try...except clause

* remove unused import
2018-06-14 09:47:17 -04:00
Aaron Bach
0e7d284c83 Make AirVisual platform async + other adjustments (#14943)
* Changes complete

* Updated requirements

* Add support for scan_interval

* Small style update

* Owner-requested changes
2018-06-14 09:30:47 -04:00
Nick Whyte
cdd111df49 Add sensor.nsw_fuel_station component (#14757)
* Add sensor.nsw_fuel_station component

* bump dependency

* PR Changes

* flake8

* Use MockPrice

* Fix requirements

* Fix tests

* line length

* wip

* Handle errors and show persistent notification

* update tests

* Address @MartinHjelmare's comments

* Fetch station name from API

* Update tests

* Update requirements

* Address comments
2018-06-14 13:56:04 +02:00
Robin
cccd0deb65 Fix Facebox face data parsing (#14951)
* Adds parse_faces

* Update facebox.py
2018-06-13 21:02:46 +02:00
Paulus Schoutsen
e014a84215 Nest config flow (#14921)
* Move nest to dir based component

* Add config flow for Nest

* Load Nest platforms via config entry

* Add tests for Nest config flow

* Import existing access tokens as config entries

* Lint

* Update coverage

* Update translation

* Fix tests

* Address strings

* Use python-nest token resolution

* Lint

* Do not do I/O inside constructor

* Lint

* Update test requirements
2018-06-13 11:14:52 -04:00
Aaron Bach
d549e26a9b Make Yi platform async (#14944)
* Conversion complete

* Updated requirements

* Got rid of 3.6-specific syntax

* Removed more 3.6-specific syntax

* Contributor-requested changes
2018-06-13 11:00:33 -04:00
Marius
08adfd87f7 Add unique_id for mqtt binary sensor (#14929)
* Added unique_id for mqtt binary sensor

* Added missing mqtt message fire in test
2018-06-13 16:20:38 +02:00
Vignesh Venkat
65b0ec6615 Update python-wink to 1.8.0 (#14894)
* wink: Update to python-wink 1.8.0

This pulls in a patch to expose the GE Z-Wave in wall fan switch
as a fan component instead of a light dimmer switch component.

* Update requirements_all.txt
2018-06-13 07:09:42 -04:00
Ville Skyttä
cb646e48d0 Upgrade pylint to 1.9.2 (#14916) 2018-06-13 07:08:39 -04:00
ArrayLabs
fecce206a9 Myq update from 0.0.8 to 0.0.11 (#14947)
* Update requirements_all.txt

Update myq from 0.0.8 to 0.0.11

* Update myq.py

Update myq from 0.0.8 to 0.0.11
2018-06-13 08:02:27 +02:00
Aaron Bach
176ef411de Add scan_interval to RainMachine (#14945) 2018-06-13 07:30:06 +02:00
Pawel
2ac23c8be6 Epson projector support (#14841)
* Epson projector support. Version based on external library

* Epson projector support. Version based on external library

* modified epson according to MartinHjelmare review.
Added description of cmode to services.yaml

* renamed EPSON_SCHEMA to epson_schema

* removed method of getting cmode property

* removed unnecessary checks
change name of cmode service

* renamed SERVICE_ATTR_CMODE to SERVICE_SELECT_CMODE
2018-06-13 07:28:59 +02:00
Hate-Usernames
a373793029 pytradfri 5.5.1: Improved 3rd party bulb support (#14887)
* Bump pytradfri version

* Update light component

* Add tests

* lint

* Docstring typos

* Blank line

* lint

* 5.5.1

* Fix tests on py3.5
2018-06-13 07:17:52 +02:00
Paulus Schoutsen
3153b0c8fc Bump frontend to 20180613.0 2018-06-12 21:20:23 -04:00
Ing. Jaroslav Šafka
89d008d1f3 Fix snapcast uuid to be more unique (#14925)
Current uuid is ok when using only 1 snapserver
New uuid is needed when using multiple snapserver

Because the client can connect to more snapservers and
then uuid based on client MAC is not enough
2018-06-12 15:46:53 +02:00
Christoph Gerneth
6755ae2605 Add support for KIWI Door Locks (#14485)
* initial commit for kiwi door locks

bugfixes

improved attribute display

flake8

more style adjustments

* added session handling

flake8

* added requirements_all

reordered imports and flake8

attempt to pelase a very picky linter

also pleasing pylint now :)

* re-try the build

* added kiwi.py to .coveragerc

* reorganized datetime handling and attribute naming

* created pypi package for door lock library

* updated requirements_all.txt

* code review changes

* added async lock state reset for locking state

* refactored lat/lon attribute updates

* initial locked state changed from undefined to locked

* refactored is_locked property check

* handling authentication exception in setup_platform

* added more check in setup_platform

* code review changes: return type in setup_platform

* fixed logging issue

* event handling in main thread

* updated kiwiki-client to version 0.1.1

* renamed alias e to exc
2018-06-12 12:36:02 +02:00
Jason Hu
c18033ba85 Use cv.time_period instead of cv.time_period_str (#14938) 2018-06-12 09:32:13 +02:00
Marcelo Moreira de Mello
cdc5388dc9 Refactored Arlo component and enhanced Arlo API queries and times (#14823)
* start arlo refactoring

* Refactored Arlo Hub to avoid uncessary and duplicated GETs to Arlo API

* Refactored Arlo camera component to avoid duplicate queries

* Added debug and error messages when video is not found

* Transformed Arlo Control Panel to Sync

* Makes linter happy

* Uses total_seconds() for scan_interval

* Added callback and fixed scan_interval issue

* Disable multiple tries and supported custom modes set in Arlo

* Bump PyArlo version to 0.1.4

* Makes lint happy

* Removed ArloHub object and added some tweaks

* Fixed hub_refresh method

* Makes lint happy

* Ajusted async syntax and added callbacks decorators

* Bump PyArlo version to 0.1.6 to include some enhacements

* Refined code
2018-06-12 08:01:26 +02:00
Ong Vairoj
be4776d039 Add more test cases for samsungtv (#14900)
More test cases to cover retry logic added in 58a1c3839
2018-06-12 07:33:21 +02:00
Jason Hu
30111ea417 Upgrade python-nest, add security_state sensor, nest.set_mode service set ETA as well (#14901) 2018-06-12 07:28:16 +02:00
Erik Eriksson
576c806e86 Update mqtt_eventstream.py (#14923)
* Update mqtt_eventstream.py

Remove a line setting an internal state mqtt_eventstream.initialized to True since:
1. No other platform is doing this
2. This will create an annoying entity/item in the user interface which the user will have to explicitly hide

* Update mqtt_eventstream.py
2018-06-11 15:29:04 +02:00
Matt Snyder
1c561eaf0d Add support for multiple Doorbird stations (#13994) 2018-06-10 19:02:44 +02:00
Ben Lebherz
1da30032a0 Add support for the Unitymedia Horizon HD Recorder (#14275)
* added new platform for the Unitymedia Horizon HD Recorder

* improve connection handling of the horizon platform

* remove unneeded parameters and fix spelling in the horizon platform

* abort or raise exception if connection to the device could not be established

* remove channel/source list and SELECT_SOURCE feature

* remove useless type check after cast and use a try block instead

* abort or raise exception if reconnect to device fails

* remove protocol specific code and restructure sending logic accordingly

* fix indentation to be pep8 complaint

* remove unused methods/properties

* fix unnecessary pylint commands and use a return to abert outside of setup_platform

* directly access config values
2018-06-10 15:38:55 +02:00
Nate Clark
d5bbb6ffd2 Add api_host option to Konnected config (#14896) 2018-06-10 13:50:25 +02:00
Dan Klaffenbach
b4e5695bbd Bump to denonavr 0.7.3 (#14907)
Closes #14792

See #14794
2018-06-10 13:00:14 +02:00
Yevgeniy
716ab0433f Added daily and hourly modes to Openweathermap (#14875)
* Added daily and hourly modes

Added wind speed and bearing to forecast

* Fix mixed spaces and tabs

* Fix lint

* Fix pylint

* Revert one attribution, order alphabetically
2018-06-10 12:35:10 +02:00
Fabian Affolter
7d9ef97bda Upgrade pylast to 2.3.0 (#14888) 2018-06-10 11:38:35 +02:00
Fabian Affolter
703b4354e0 Upgrade python-mystrom to 0.4.4 (#14889) 2018-06-10 11:38:23 +02:00
Fabian Affolter
ce0ca7ff90 Upgrade sendgrid to 5.4.0 (#14891) 2018-06-10 11:38:11 +02:00
Fabian Affolter
54e87836f6 Upgrade psutil to 5.4.6 (#14892) 2018-06-10 11:37:58 +02:00
Fabian Affolter
5f4aa6d2ba Upgrade python_opendata_transport to 0.1.3 (#14905) 2018-06-10 11:37:44 +02:00
Fabian Affolter
dc447a75c6 Upgrade pyuptimerobot to 0.0.5 2018-06-10 10:58:45 +02:00
Joakim Sørensen
ce7e9e36dd Add Uptime Robot sensor (#14631)
* Added Uptime Robot sensor

* added newline at the end and corrected doclink

* Added changes form @cdce8p

* Convert to binary_sensor

* updated requirements

* moved to correct dir

* Update uptimerobot.py
2018-06-10 10:28:53 +02:00
Aaron Bach
8aca2e84dc Make RainMachine async (#14879)
* Make RainMachine async

* Updated requirements

* Dispatcher adjustments

* Small verbiage change

* Member-requested changes

* Style consistency

* Updated requirements
2018-06-10 10:23:07 +02:00
Fabian Affolter
f3e55ce330 Allow different identifiers for the CPU temperature (fixes #10104) (#14898) 2018-06-10 08:39:48 +02:00
Ing. Jaroslav Šafka
20caeb5383 Add entity registry support to media_player.snapcast (#14895)
Unique id for client is generated from prefix 'snapcast_client_'
and MAC address

Unique id for group is generated from prefix 'snapcast_group_'
and UUID provided by snapcast library
2018-06-10 08:31:42 +02:00
hanzoh
bc0d0751b9 Add missing mapping of RotaryHandleSensorIP states (#14885) 2018-06-09 16:12:42 +02:00
John Arild Berentsen
5393b073fe Discover Qubino ZMHTDx smart meter switches (#14884) 2018-06-09 15:34:36 +02:00
Ong Vairoj
d7b7370c82 Samsung TV can't turn off after idle period (#14587)
When Samsung TV is idle for a period of time after issued a command,
subsequent 'turn_off' command won't turn off the TV. The issue is seen
in Samsung models with websocket as discussed in #12302.

== Reproducible Steps
1. Turn on TV (either via HA or directly).
2. Issue some commands e.g. volume ups / downs.
3. Wait for ~1 minute.
4. Issue turn_off command via HA. TV won't turn off.
5. Issue subsequent turn off commands won't turn off TV still.
6. However, issue some other commands e.g. volume ups / downs multiple
times in a row and then turn_off will turn off the TV.

== Root Cause
The underlying websocket connection opened by samsungctl get closed
after some idle time. There was no retry mechanism so issued commands
would intermittently fail but the subsequent one would succeed when
`_remote` get recreated. With `turn_off()`, however, there is an
additional call to `self.get_remote().close()` which indirectly caused
new connection to be created and then closed immediately. This causes the
component to stuck in failure mode when turn_off command is repeatly
issued.

== The Fix
Recreate the connection and retry the command if connection is closed
to avoid silent failures due to connection closed. Also set `_remote`
to None after calling close() to put it in correct state.

This fix eliminates intermittent command failure and failure mode in
turn_off().
2018-06-09 09:22:34 -04:00
vandenberghev
5f65f67f1e Removed semicolon 2018-06-09 12:37:06 +02:00
Malte Franken
f242418986 UVC camera platform handling unavailable NVR or cameras better (#14864)
* fixed tests: using correct camera configuration now and error handling tests must be separated out to ensure that the setup_component call is actually executed

* better error handling during setup; raising PlatformNotReady in likely recoverable cases; added tests
2018-06-09 07:22:17 +02:00
Jason Hu
d3d9d9ebf2 Add color_status sensor for Nest Protect (#14868) 2018-06-09 07:16:11 +02:00
Paulus Schoutsen
8ceb57752b Merge pull request #14876 from home-assistant/rc
0.71.0
2018-06-08 18:07:39 -04:00
Paulus Schoutsen
bd1af8c3d8 Version bump to 0.71.0 2018-06-08 16:57:59 -04:00
Paulus Schoutsen
6af995026b Add support for new hass.io panel (#14873) 2018-06-08 16:50:19 -04:00
Paulus Schoutsen
19a30b0ce6 Version bump to 0.71.0b1 2018-06-08 15:04:58 -04:00
Robert Svensson
9a659a5d1d Zone - Hass configuration name is optional (#14449)
* Hass configuration name is optional

* Check explicitly if name is none

* Reverted back to old logic for zones configured in configuration.yaml, where many zones can have the same name

* New test to verify use case of allowing multiple zones having the same name

* Fix too long line
2018-06-08 15:04:42 -04:00
Paulus Schoutsen
1cfd770b95 Use hass iconset (#14185) 2018-06-08 15:04:41 -04:00
Paulus Schoutsen
3fda97eed7 Bump frontend to 20180608.0b0 2018-06-08 15:04:28 -04:00
Anders Melchiorsen
b657cff6ba Add netgear_lte component (#14687)
* Add netgear_lte component

* Improvements after review

* Allow multiple notify targets

* Require default notify target
2018-06-08 07:46:34 +02:00
Mal Curtis
e3fba79126 Disable volume control for Onkyo when unavailable (Closes: #14774) (#14863) 2018-06-08 07:45:21 +02:00
Diogo Gomes
bb0068908d Fix unit conversion (#14730)
* reviewing this code min_temp and max_temp are always present and always in celsius

* revert change (preserve unit conversion)

* revert (due to unit conversion)

* self

* clean

* cleaner
2018-06-07 22:44:07 -04:00
Robert Svensson
0748466ffc Zone - Hass configuration name is optional (#14449)
* Hass configuration name is optional

* Check explicitly if name is none

* Reverted back to old logic for zones configured in configuration.yaml, where many zones can have the same name

* New test to verify use case of allowing multiple zones having the same name

* Fix too long line
2018-06-07 17:06:13 -04:00
Dale Higgs
fe018fd58c Add set_default_level to logger (#14703)
* Add set_default_service to logger

* Fix 2-line lint error

* Add set_default_level to services.yaml

* Add tests for set_default_level

* Remove function and add else when setting default
2018-06-07 17:03:04 -04:00
Steve Edson
10317a0f71 Rename Hive hub friendly name (#14747)
Right now, "Hub Status" is very generic, I didn't know what component it was coming from, and the only way to tell was searching the source code to find the reference.
2018-06-07 16:57:07 -04:00
Alexei Chetroi
87d55834be zha: handle "step_with_on_off" cluster command in LevelListener. (#14756) 2018-06-07 16:56:07 -04:00
Sebastian Muszynski
d4cc806cd5 Fix door/window sensor support of the Xiaomi Aqara LAN protocol V2 (Closes: #14775) (#14777) 2018-06-07 16:55:18 -04:00
Sergiy Maysak
1a7e8c88a3 Wireless tags platform (#13495)
* Initial version of wirelesstags platform support.

* Pinned wirelesstagpy, generated requirements_all.

* Fixed temperature units in imperial units systems, make binary events more tags specific.

* Lowercased tag name during entity_id generation.

* Fixed: tag_id template for tag_binary_events, support of light sensor for homebridge.

* Minor style cleanup.

* Removed state, define_name, icon. Reworked async arm/disarm update. Removed static attrs. Introduced available property. Custom events contains components name now. Cleaned dedundant items from schema definition.

* Removed comment and beep duration from attributes. Minor cleanup of documentation comment.

* Ignoring Wemo switches linked in iOS app.

* Reworked passing data from platform to components using signals.
2018-06-07 16:30:20 -04:00
Paulus Schoutsen
90a51160c4 Don't run unnecessary methods in executor pool (#14853)
* Don't run unnecessary methods in executor pool

* Lint

* Lint 2
2018-06-07 15:31:21 -04:00
Fabian Affolter
50321a29b5 Catch ConnectionError (fixes #14241) (#14748) 2018-06-07 20:25:26 +02:00
Paulus Schoutsen
67d137cfd5 Store config entry id in entity registry (#14851)
* Store config entry id in entity registry

* Lint
2018-06-07 20:23:09 +02:00
Philip Rosenberg-Watt
bb4d1773d3 Add min_temp and max_temp to MQTT climate device (#14690)
* Add min_temp and max_temp to MQTT climate device

* Add unit tests

* Remove blank line

* Fix unit tests & temp return values

* PEP-8 fixes

* Remove unused import
2018-06-07 13:50:12 -04:00
Fabian Affolter
a6c1192bfc Upgrade aiohttp to 3.3.0 (#14766) 2018-06-07 13:49:14 -04:00
Matthew Treinish
d14d2fe588 Add IBM Watson IoT Platform component (#13664)
This commit adds a new history component for the IBM Watson IoT
Platform. The IBM Watson IoT Platform allows for tracking of devices
and analytics on top of the device data. This new component allows
users to have home assistant automatically populate a watson iot
platform board with device data from devices managed by home assistant.
2018-06-07 13:43:51 -04:00
starkillerOG
f696331563 Add general sound mode support (#14729)
* Media player: general sound mode support

* General sound mode support

* White spaces

* Add sound mode support to demo media player

* white space

* remove unnessesary code
2018-06-07 10:57:45 -04:00
Anders Melchiorsen
6b2b92a732 Improvements to LIFX reliability (#14848)
* Improve fault tolerance of LIFX initialization

* Update aiolifx to 0.6.3

* Use list comprehension
2018-06-07 10:06:29 -04:00
Fabian Affolter
83ce9450f7 Upgrade Mastodon.py to 1.3.0 (#14858) 2018-06-07 10:04:58 -04:00
Paulus Schoutsen
0b405c33c4 Update Hue flow title (#14852) 2018-06-07 16:00:42 +02:00
Paulus Schoutsen
bf74cab7af Fix non awaited test (#14854) 2018-06-07 15:58:54 +02:00
Paulus Schoutsen
d8adb4bdb0 Bump frontend to 20180607.0 2018-06-06 22:42:01 -04:00
Sebastian Muszynski
bef15264b7 Ignore the mistaken long_both_click event of the 86sw (Closes: #14802) (#14808) 2018-06-06 19:51:59 +02:00
Roman
6d26915c69 Feature/gearbest library update (Closes: #14813) (#14833) 2018-06-06 11:38:50 +02:00
Paulus Schoutsen
fa2e6ada26 Route themes and translations over websocket (#14828) 2018-06-06 10:12:43 +02:00
Paulus Schoutsen
a6880c452f Migrate entity registry to using websocket (#14830)
* Migrate to using websocket

* Lint
2018-06-06 10:08:36 +02:00
Diogo Gomes
4bccb0d2a1 Merge pull request #14831 from home-assistant/sim-sensor
Limit sensor.simulated to 3 decimals (fixes #14773)
2018-06-05 21:06:11 +01:00
Luc Touraille
103639455c Add Freebox device tracker (#12727)
* Add a device tracker for Freebox routers

* Automatic setup of Freebox device tracker based on discovery

* Make the Freebox device tracker asynchronous
2018-06-05 20:38:50 +02:00
Thomas Krüger
549abd9c7e Improved Fritz!Box thermostat support (#14789) 2018-06-05 20:06:25 +02:00
Fabian Affolter
f1aba5511f Limit to 3 decimals (fixes #14773) 2018-06-05 19:44:41 +02:00
Simon Nørager Sørensen
21d05a8b4d Fixes an issue in Xiaomi TV platform that would some TVs not sleep correctly (#14829) 2018-06-05 19:13:16 +02:00
Mischa Gruber
cb6c869c2f Action parameter doesn't longer have to be the first parameter (#14815)
* Action parameter doesn't longer have to be the first parameter

* Minified code upon suggestion
2018-06-05 18:15:34 +02:00
Hugo Dupras
640e499964 netatmo api is now in pip as pyatmo (#14824)
Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>
2018-06-05 11:55:53 -04:00
Paulus Schoutsen
b3b4f7468d Further cleanup frontend (#14805)
* Remove registering panels

* Remove unused image

* Lint
2018-06-05 10:50:16 -04:00
Paulus Schoutsen
ad9621ebe5 Use hass iconset (#14185) 2018-06-05 10:49:54 -04:00
Sebastian Muszynski
e370d523ec Bump python-miio version (Closes: #13749) (#14796)
* Bump python-miio version

* Fix Xiaomi Power Strip V1 support (Closes: #13749)
2018-06-04 23:50:18 +02:00
vandenberghev
61a41bb8fc Fix issue #14426: [homeassistant.components.sensor] smappee: Error on device update!
https://github.com/home-assistant/home-assistant/issues/14426
2018-06-04 20:08:17 +02:00
vandenberghev
2da6d3c223 Merge branch 'dev' of https://github.com/home-assistant/home-assistant into dev
# Conflicts:
#	homeassistant/components/sensor/smappee.py
2018-06-04 19:44:04 +02:00
Fabian Affolter
816efa02d1 Use pihole module to get data (#14809) 2018-06-04 18:49:26 +02:00
Fabian Affolter
bd1b1a9ff9 Update syntax (#14812) 2018-06-04 14:44:55 +02:00
quthla
1d23f7f900 Allow Kodi live streams to be recognized as paused (#14623) 2018-06-04 12:24:28 +01:00
Sebastian Muszynski
39843a73de Add additional 86sw model identifier of the LAN protocol V2 (#14799) 2018-06-04 07:39:50 +02:00
Diogo Gomes
aec425d1f6 Weather Platform - IPMA (#14716)
* initial commit

* lint

* update with pyipma

* Added test

* Added test

* lint

* missing dep

* address comments

* lint

* make sure list is iterable

* don't bother with list

* mock dependency

* no need to add test requirements

* last correction
2018-06-03 23:01:48 +02:00
Paulus Schoutsen
855ed2b4e4 Version bump to 0.72.0.dev0 2018-06-03 16:54:23 -04:00
Paulus Schoutsen
2dc40fe16e Version bump to 0.71.0b0 2018-06-03 16:53:48 -04:00
Paulus Schoutsen
bf8376ddcb Merge remote-tracking branch 'origin/master' into dev 2018-06-03 16:53:17 -04:00
Mattias Welponer
8f696193f0 Add homematicip_cloud illuminance sensor (#14720)
* Add iluminance sensor and device_class for sensors

* Fix lint
2018-06-03 18:48:51 +02:00
Paulus Schoutsen
70edb2492a Version bump to 20180603.0 2018-06-03 12:29:57 -04:00
quthla
e35d4beb95 Fix media_title empty when title is empty but label is set (#14791) 2018-06-03 09:27:17 -04:00
quthla
919b431a24 Add Kodi OnResume event (#14790) 2018-06-03 09:26:23 -04:00
Jason Woodford
7f59a8ea0c Update total-connect-client to 0.18 for Honeywell Lynx Touch-Wifi support (#14778) 2018-06-03 13:55:49 +02:00
Sebastian Muszynski
1ac3f0da63 Ignore the mistaken long_click event of the 86sw (Closes: #14694) (#14785) 2018-06-03 11:54:03 +02:00
Jason Hu
12e679c14d Assign device class to nest sensors (#14746)
* Assign device class to nest sensors

sensor/nest.NestSensor => /nest.NestSensorDevice,
so that BinarySensor platform do not reference Sensor platform anymore

* Resolve code review comment

* Follow code review comment
2018-06-03 03:54:48 +02:00
Fabian Affolter
28ef94c3fa Update syntax (#14772) 2018-06-02 15:08:10 +02:00
Fabian Affolter
27df4cca6c Upgrade shodan to 1.8.1 (#14760) 2018-06-02 08:34:47 -04:00
Fabian Affolter
a8413249c2 Upgrade sqlalchemy to 1.2.8 (#14765) 2018-06-02 08:34:30 -04:00
Fabian Affolter
f2dacb2570 Upgrade youtube_dl to 2018.06.02 (#14763) 2018-06-02 08:33:48 -04:00
Fabian Affolter
5aaf81f2c9 Upgrade Sphinx to 1.7.5 (#14764) 2018-06-02 08:31:43 -04:00
Fabian Affolter
b86cd325fe Update syntax (#14770) 2018-06-02 08:31:06 -04:00
Fabian Affolter
74b7dabf2d Update syntax (#14768) 2018-06-02 08:30:54 -04:00
Fabian Affolter
1ce4c2092a Update syntax (#14771) 2018-06-02 08:30:07 -04:00
Fabian Affolter
875e05ff38 Remove swagger file (#14762) 2018-06-02 08:29:38 -04:00
Mick Vleeshouwer
fe0e49db4b Update postnl api to 1.0.2 (#14769) 2018-06-02 13:45:48 +02:00
Fabian Affolter
ad86e68c1e Update syntax of platform random (#14767) 2018-06-02 12:00:01 +02:00
Tristan Caulfield
e7985c970b Upgrade directpy to 0.5 (#14750)
* Version Requirement bump

Bump required version to 0.5 to allow component to work with Genie Mini clients using the clientAddr variable.

* Ran script/gen_requirements_all.py as requested.
2018-06-02 09:30:15 +02:00
austinlg96
cfac537f51 Added option to block Osram Lightify individual lights in the same way that groups can be (#14470) 2018-06-02 09:23:51 +02:00
Fabian Affolter
d6e76969cc Tweak about the requirements 2018-06-01 23:33:04 +02:00
Fabian Affolter
77dca8272c Upgrade blockchain to 1.4.4 (#14738) 2018-06-01 19:41:35 +02:00
Fabian Affolter
3b8ee196be Update syntax (#14742) 2018-06-01 19:41:20 +02:00
michaeldavie
4935043f4a Add battery attribute to Sensibo (#14735)
* Added battery attribute

* Simplify current_battery
2018-06-01 19:41:04 +02:00
Matt Schmitt
f5d74e07d5 Add support for outlets in HomeKit (#14628) 2018-06-01 18:04:54 +02:00
Paulus Schoutsen
0a724a5473 Update frontend 2018-06-01 10:52:25 -04:00
Jason Hu
cba8333a13 Change nest to cloud push (#14656)
* Change nest component to Cloud Push

Change sensors.nest, binary_sensors.nest and climate.nest to push mode
nest camera still need poll to update snapshot image
Also change nest component to async

* Flake8 lint

* Fix async_notify_errors, it is not a coroutine

* Fix pylint

* Fix pylint, function name should shall shorter than 32

* Use dispatcher helper instead event bus

* Use async_update_ha_state(True)

* Refactoring load_platform

Move service registration into async_setup_nest(),
 resolve an issue that before the first time configuration done,
 set_mode service should not be registered

* Fix an issue that authorization failure may leave a blocked thread

* Pylinting

* async_nest_update_callback => async_update_state to avoid confusion

* Move signal handler register to async_added_to_hass

* Better handle nest api error

* Remove unnecessary register for binary_sensor

* Remove unused import

* Upgrade to python-nest 4.0.1

Fix a thread race condition issue

* Address my own comments

* Address my own comment
2018-06-01 10:44:58 -04:00
Anders Melchiorsen
fcbc399809 Disallow automation.trigger without entity_id (#14724) 2018-06-01 10:27:12 -04:00
Paulus Schoutsen
f6eb9e79d5 Custom panel (#14708)
* Add support for custom panels in JS

* Allow specifying JS custom panels

* Add trust external option

* Fix tests

* Do I/O outside event loop

* Change config to avoid breaking change
2018-06-01 10:06:17 -04:00
roiff
ab3717af76 Homekit Thermostat: Better support for temperature ranges (#14679)
* Support for obtaining temperature range
* Fallback to Defaults
* Fixed unit conversion
* Added test
2018-06-01 13:49:16 +02:00
Pierre Ståhl
6cd69b413c Bump pyatv to 0.3.10 (#14736)
* Bump pyatv to 0.3.10

* Update requirements_all.txt
2018-06-01 08:41:40 +02:00
Fabian Affolter
de56a0d021 Upgrade shodan to 1.8.0 (#14717) 2018-06-01 08:40:27 +02:00
glenn20
99fdd3e358 Add device_descriptor and device_name to keyboard event (#14642)
* Add device_descriptor and device_name to keyboard event

This allows automations to identify which device has generated the
keypress. This is especially useful for bluetooth remotes to control different
devices.

* Remove line breaks

* Fix
2018-06-01 00:32:09 +02:00
Paulus Schoutsen
9a3107aa66 Merge pull request #14727 from home-assistant/rc
0.70.1
2018-05-31 18:11:34 -04:00
Paulus Schoutsen
d31e01b877 Revert "Remove simplepush.io (#14358)"
This reverts commit 612a37b2dd.
2018-05-31 18:11:15 -04:00
Paulus Schoutsen
f8c8900297 Merge pull request #14728 from home-assistant/reinstate-simplepush
Revert "Remove simplepush.io (#14358)"
2018-05-31 18:09:50 -04:00
Paulus Schoutsen
ed9cf994c2 Revert "Remove simplepush.io (#14358)"
This reverts commit 612a37b2dd.
2018-05-31 17:58:03 -04:00
Paulus Schoutsen
d4a4938fce Version bump to 0.70.1 2018-05-31 17:27:55 -04:00
Paulus Schoutsen
f7f0138cff Bump frontend to 20180531.0 2018-05-31 17:27:44 -04:00
Marius
753ffdaffd Fix Eco mode display on Nest (#14706)
* Fix Eco mode display on Nest

* Fix Hound problems
2018-05-31 17:27:35 -04:00
Otto Winter
40aba3d785 MQTT Cover Fix Assumed State (#14672) 2018-05-31 17:27:35 -04:00
Anders Melchiorsen
64f157a036 Ignore unsupported Sonos favorite lists (#14665) 2018-05-31 17:27:35 -04:00
MizterB
0eddd287c5 Update Hue platform to aiohue 1.5.0, and re-implement logic for duplicate scene names. (#14653) 2018-05-31 17:27:34 -04:00
Marius
f32b50cb80 Fix Eco mode display on Nest (#14706)
* Fix Eco mode display on Nest

* Fix Hound problems
2018-05-31 17:26:59 -04:00
Paulus Schoutsen
a58a566ae8 Bump frontend to 20180531.0 2018-05-31 17:25:35 -04:00
Diogo Gomes
2f1d40e014 Merge pull request #14721 from PhilRW/climate-constants
Change climate default limits to constants
2018-05-31 22:19:25 +01:00
Fabian Affolter
14ee6178f9 Add Flock notification platform (#14533)
* Add Flock notification platform

* Use async syntax and move session and loop
2018-05-31 23:07:50 +02:00
Philip Rosenberg-Watt
753fe8279b Remove deprecated comments 2018-05-31 13:59:26 -06:00
Philip Rosenberg-Watt
cc264f415e Fix PEP-8 issues 2018-05-31 11:32:31 -06:00
Philip Rosenberg-Watt
dae90abb34 Change climate default limits to constants
Min and max temp and humidity are now defined in climate __init__.py
and are available for import in subclasses.
2018-05-31 11:23:04 -06:00
Aaron Bach
60f692c7bb Fixes (and stabilizes) some incorrect zone codes in RainMachine (#14719)
* Fixes (and stabilizes) some incorrect zone codes

* Fixed a misspelling
2018-05-31 18:55:50 +02:00
c727
7094d6d61e Change ACP code_format to None|"Number"|"Any" (#14686) 2018-05-31 14:31:40 +02:00
Paulus Schoutsen
08fc73aa20 Bump to 0.71.0.dev0 2018-05-30 11:19:27 -04:00
Michael Nosthoff
c14e41f431 Netatmo Sensor: Implement device_class (#14634)
added device_class and removed icon for temperature and humidity.
2018-05-30 10:53:35 -04:00
cdce8p
f1f4d80f24 Homekit Bugfixes (#14689)
* Fix async bug
* Fix debounce bug
2018-05-30 12:39:27 +02:00
Paulus Schoutsen
e746b92e0e Fix deprecated code (#14681) 2018-05-29 23:14:58 +02:00
cdce8p
7d2563eb1f Update HAP-python to 2.2.2 (#14674)
* Pass driver to accessory
* Added 'hk_driver' fixture for tests
2018-05-29 22:43:26 +02:00
Aaron Bach
084b3287ab Add sensors and services to RainMachine (#14326)
* Starting to add attributes

* All attributes added to programs

* Basic zone attributes in place

* Added advanced properties for zones

* We shouldn't calculate the MAC with every entity

* Small fixes

* Basic framework for push in play

* I THINK IT'S WORKING

* Some state cleanup

* Restart

* Restart part 2

* Added stub for service schema

* Update

* Added services

* Small service description update

* Lint

* Updated CODEOWNERS

* Moving to async methods

* Fixed coverage test

* Lint

* Removed unnecessary hass reference

* Lint

* Lint

* Round 1 of Owner-requested changes

* Round 2 of Owner-requested changes

* Round 3 of Owner-requested changes

* Round 4 (final for now) of Owner-requested changes

* Hound

* Updated package requirements

* Lint

* Collaborator-requested changes

* Collaborator-requested changes

* More small tweaks

* One more small tweak

* Bumping Travis and Coveralls
2018-05-29 21:02:16 +02:00
Thibault Cohen
4105429639 Add asyncio support for Ebox (#14183)
* Fix Ebox sensor

* Fix #14183 comments

* Update ebox.py

* Update ebox.py

* Continue fixing comments
2018-05-29 10:23:12 -04:00
Robert Svensson
8c93b484c4 deCONZ - Option to load or not to load clip sensors on start (#14480)
* Option to load or not to load clip sensors on start

* Full flow

* Fix config flow and add tests

* Fix attribute dark reporting properly

* Imported and properly configured deCONZ shouldn't need extra input to create config entry
2018-05-29 10:09:53 -04:00
Fabian Affolter
3b38de63ea Allow user-defined sensors (#14613)
* Allow user-defined sensors

* Require element for resources

* Don't use .get()
2018-05-29 10:03:00 -04:00
Alexei Chetroi
eff1d1f14e zha: fix temperature rounding for ZHA temperature sensors. (#14669) 2018-05-29 09:05:07 -04:00
Otto Winter
fcb60d472e MQTT Cover Fix Assumed State (#14672) 2018-05-29 09:03:45 -04:00
Anders Melchiorsen
f2a2f2cca5 Ignore unsupported Sonos favorite lists (#14665) 2018-05-29 10:15:30 +02:00
Paulus Schoutsen
8c7f0669c6 Allow hassio frontend development (#14675)
* Allow hassio frontend development

* Fix tests
2018-05-29 08:51:08 +02:00
Matthew Garrett
d36c7c3de7 Increase Eufy's requirement on lakeside (#14671)
python-lakeside was broken with at least some versions of the Python
protobuf code, so bump the requirement to a fixed version.
2018-05-29 08:42:27 +02:00
Bakkoda
79efb0e607 Update mfi.py (#14667)
Add ability to read door sensor states from the mPort.
2018-05-29 07:51:14 +02:00
Robert Accettura
9bc26e93a4 Add pin pad to alarm panel (#14178)
* Add pin pad to alarm panel

* Add pin pad to alarm panel

* Update regex

* Update regex

* Update regex

* Add pin pad to alarm panel

* Add pin pad to alarm panel

* Add pin pad to alarm panel

* Add pin pad to alarm panel

* Fix typos

* Fix typos

* Fix typos

* Add pin pad to alarm panel

* Fix errors
2018-05-29 07:50:27 +02:00
Andrey
6c3e2021df Give unknown zwave nodes a better name (#14353)
* Give unknown zwave nodes a better name

* Update util.py
2018-05-28 21:49:38 -04:00
Enrico Berndt
07255a29b4 Add tv channel and volume level for philips js API 5 (#14276)
* PhilipsTV API 5: Added tv channel change and setting of volume level.

* set_volume only sets volume via api now and nothing else.
2018-05-28 10:41:51 -04:00
Alexei Chetroi
144bb3492a zha/light: Properly parse currentX and currentY on async_update() (#14605) 2018-05-28 10:32:47 -04:00
cdce8p
6f4dd7b057 Improve Homekit media_player options (#14637)
* Optimize imports

* Optimize name

* Optimize config schema

* Rename mode to feature

* Replace mode with feature_list
2018-05-28 10:26:33 -04:00
David F. Mulcahey
27f3285d17 Force update ZHA electrical sensor (#14649)
* force state update because we have a real reading

* hound

* docstring
2018-05-28 10:22:29 -04:00
MizterB
9a87e62e0e Update Hue platform to aiohue 1.5.0, and re-implement logic for duplicate scene names. (#14653) 2018-05-28 10:21:00 -04:00
koreth
9044a9157f Reduce log churn from Envisalink binary sensors (#14659)
The Envisalink binary sensor was logging events with a relative
timestamp that updated every time it polled, so even when nothing
new was happening, the event log would be full of meaningless
state changes. Modify the sensor code to use an absolute time
which stays stable when there isn't new activity.
2018-05-28 10:19:03 -04:00
Michaël Arnauts
799ae894a8 Remove docker prereqs scripts that only install a package. Add informational message for this. (#14661) 2018-05-28 10:17:01 -04:00
Fabian Affolter
bff1e1ff6c Upgrade python_opendata_transport to 0.1.0 (#14652) 2018-05-28 08:17:10 +02:00
Fabian Affolter
cc2437614b Upgrade youtube_dl to 2018.05.26 (#14654) 2018-05-28 08:16:55 +02:00
Paulus Schoutsen
0700886d1a Merge pull request #14657 from home-assistant/rc
0.70.0
2018-05-27 20:22:19 -04:00
Paulus Schoutsen
cd0e321668 Version bump to 0.70.0 2018-05-27 17:18:53 -04:00
Paulus Schoutsen
94a82ab7dc Allow Hass.io panel dir (#14655) 2018-05-27 17:18:16 -04:00
Paulus Schoutsen
b6e4a7771a Allow Hass.io panel dir (#14655) 2018-05-27 17:17:19 -04:00
Fabian Affolter
13859388c1 Upgrade locationsharinglib to 2.0.7 (#14640) 2018-05-27 20:16:47 +02:00
Fabian Affolter
2f4c5f949b Use constants (#14647) 2018-05-27 20:16:30 +02:00
Fabian Affolter
36e8157268 Upgrade TwitterAPI to 2.5.4 (#14639) 2018-05-27 15:46:58 +02:00
Fabian Affolter
2d88f47795 Upgrade gitterpy to 0.1.7 (#14643) 2018-05-27 15:45:43 +02:00
Jason Hu
5acfe5da68 Upgrade python-nest to 4.0.0 (#14638)
* Upgrade python-nest to 4.0.0

Drop in replace to use nest stream API
Didn't change any logic from HA side

* Update requirements_all.txt
2018-05-27 11:31:05 +02:00
Fabian Affolter
5f9e4ae136 Upgrade luftdaten to 0.2.0 (#14620) 2018-05-27 09:53:53 +02:00
Paulus Schoutsen
a9b0f92afe Version bump to 0.70.0b7 2018-05-26 20:02:54 -04:00
Paulus Schoutsen
07b2728380 Bump frontend to 20180526.4 2018-05-26 20:02:36 -04:00
Paulus Schoutsen
a5e66ce6ba Bump frontend to 20180526.4 2018-05-26 20:02:24 -04:00
David F. Mulcahey
eae9726bec Add electrical measurement sensor to ZHA (#14561)
* Add electrical measurement sensor

* correct state update

* hound fix

* zha: Add metering sensor (#14562)

* Add IlluminanceMeasurementSensor to ZHA (#14563)

* add IlluminanceMeasurementSensor

* address review comment

* Fix whitespace error during merge

* Add electrical measurement sensor

* correct state update

* hound / flake8
2018-05-26 22:50:05 +02:00
guillaume1410
c425afe50e Adding ryobi garage door opener (#14618)
* Initial component for Ryobi cover

* Initial component for Ryobi cover

* Adding Ryobi cover

* Adding Ryobi cover

* Adding Ryobi cover

* Minor changes

* Remove import
2018-05-26 22:46:53 +02:00
Paulus Schoutsen
a5b9e59cee Version bump to 0.70.0b6 2018-05-26 14:30:03 -04:00
Paulus Schoutsen
fb447cab82 Bump frontend to 20180526.3 2018-05-26 14:29:53 -04:00
Paulus Schoutsen
bcde57bff8 Bump frontend to 20180526.3 2018-05-26 14:29:26 -04:00
David Ryan
dfd7ef1fce Add Hydrawise component (#14055)
* Added the Hydrawise component.

* Fixed lint errors.

* Multiple changes due to review comments addressed.

* Simplified boolean test. Passes pylint.

* Need hydrawiser package version 0.1.1.

* Added a docstring to the device_class method.

* Addressed all review comments from MartinHjelmare.

* Changed keys to single quote. Removed unnecessary duplicate method.

* Removed unused imports.

* Changed state to lowercase snakecase.

* Changes & fixes from review comments.
2018-05-26 18:42:52 +02:00
Paulus Schoutsen
6b9addfeea Update release script 2018-05-26 11:54:50 -04:00
Paulus Schoutsen
6c62f7231b Version bump to 0.70.0b5 2018-05-26 11:53:57 -04:00
Paulus Schoutsen
52c21a53b3 Bump frontend to 20180526.2 2018-05-26 11:53:44 -04:00
Paulus Schoutsen
fdb250d86c Bump frontend to 20180526.2 2018-05-26 11:53:36 -04:00
Fabian Affolter
8de56cfc10 Upgrade speedtest-cli to 2.0.2 (#14633) 2018-05-26 17:35:16 +02:00
Mattias Welponer
7ea25cd360 Add homematicip cloud climate platform (#14388)
* Add support for climatic devices

* Update requirements_all

* Change icon to mdi:thermostat

* Update of homematicip-rest-api lib version

* Remove all mode or state relevant things - will come later

* Add current_operation again to see proper status

* Remove STATE_PERFORMANCE import

* Remove trailing whitespace

* Update requirements file
2018-05-26 16:03:53 +02:00
Paulus Schoutsen
c9498d9f09 Version bump to 0.70.0b4 2018-05-26 08:35:18 -04:00
Paulus Schoutsen
2f0435ebd8 No longer use backports for ffmpeg (#14626) 2018-05-26 08:34:56 -04:00
Paulus Schoutsen
19351fc429 Use libsodium18 (#14624) 2018-05-26 08:34:55 -04:00
Paulus Schoutsen
bfc16428da Bump frontend to 20180526.1 2018-05-26 08:34:40 -04:00
Paulus Schoutsen
41fc44b27c Bump frontend to 20180526.1 2018-05-26 08:33:22 -04:00
Max Muth
a55fbd2be7 Add services for adding and removing items to shopping list (#14574) 2018-05-26 13:53:48 +02:00
Marcelo Moreira de Mello
28d6910e56 Added UDP and parallel streams support to Iperf3 (#14629) 2018-05-26 13:43:31 +02:00
Lorenz Schmid
edfc54b2eb Added option to connect via SSL for OpenWRT(luci) device tracker (#14627)
* Added option to connect via HTTPS for OpenWRT(luci) device tracker

* Use string formatting

* Update quotes

* Remove whitespace
2018-05-26 09:51:21 +02:00
cdce8p
6ceafabd78 Extend package support (#14611) 2018-05-25 16:41:50 -04:00
Paulus Schoutsen
48972c7570 No longer use backports for ffmpeg (#14626) 2018-05-25 13:49:45 -04:00
Paulus Schoutsen
bf3ead3359 Use libsodium18 (#14624) 2018-05-25 11:32:45 -04:00
Marius Kotlarz
b4f8d52fb1 Add configurable decimal rounding of display value for CoinMarketCap sensor and upgrade to 5.0.3 (#14437) (#14604) 2018-05-25 15:39:04 +02:00
Matt Schmitt
143be49c66 Add HomeKit support for automations (#14595) 2018-05-25 11:38:48 +02:00
Matt Schmitt
a9f19a16ee Add HomeKit support for media players (#14446) 2018-05-25 11:37:20 +02:00
Nik Klever
d53a8c0823 Adding illumination sensor (#14615)
* Adding illumination sensor

Adding Illumination sensor of 1wire device DS2438 (DEVICE_SENSOR type 26) according to [OWFS API](http://owfs.org/index.php?page=ds2438)

* Correcting typo illumination -> illuminance
2018-05-25 10:29:20 +02:00
bastshoes
6e5c541a00 Add support container status for Glances on RPi3 (#14529)
* Add support container status for Glances on RPi3

Glances on RPi3 return different container status. 
```
"containers": [
        {
            "Status": "Up 2 hours",
            "name": "HASS",
            "io": {
                "iow": 0,
                "time_since_update": 5.1789350509643555,
                "cumulative_ior": 94208,
                "ior": 0,
                "cumulative_iow": 4096
            },
```
This small PR adds support dealing with this differences.

* Making line shorter

* Fixing indentation

* Fix lint error

* Fix ident

* Fix intend
2018-05-25 09:58:53 +02:00
Gregory Benner
2cd127921a Update pyrainbird (#14617) 2018-05-25 06:39:41 +02:00
Paulus Schoutsen
43d2e436b9 Version bump to 0.70.0b3 2018-05-24 14:25:15 -04:00
Paulus Schoutsen
ef35b8d428 Fix hue discovery popping up (#14614)
* Fix hue discovery popping up

* Fix result

* Fix tests
2018-05-24 14:24:58 -04:00
Tom Harris
69e86c29a6 Bump insteonplm version to fix device hanging (#14582)
* Update inteonplm to 0.9.2

* Change to force Travis CI

* Change to force Travis CI
2018-05-24 14:24:58 -04:00
Greg Laabs
a4d45c46e8 Fix ISY moisure sensors showing unknown until a leak is detected (#14496)
* Fix ISY leak sensors always showing UNKNOWN until a leak is detected

Added some logic that handles both moisture sensors and door/window sensors

* Handle edge case of leak sensor status update after ISY reboot

If a leak sensor is unknown, due to a recent reboot of the ISY, the status will get updated to dry upon the first heartbeat. This status update is the only way that a leak sensor's status changes without an accompanying Control event, so we need to watch for it.

* Fixes from overnight testing

State was checking the incorrect parameter, and wasn't calling schedule update

* Remove leftover debug log line

* Remove unnecessary pylint instruction

* Remove access of protected property

We can't cast _.status directly to a bool for some unknown reason (possibly with the VarEvents library), but casting to an int then bool does work.
2018-05-24 14:24:57 -04:00
Paulus Schoutsen
45d1d30a8b Update frontend to 20180524.0 2018-05-24 14:24:37 -04:00
Paulus Schoutsen
fa9b9105a8 Fix hue discovery popping up (#14614)
* Fix hue discovery popping up

* Fix result

* Fix tests
2018-05-24 14:24:14 -04:00
Paulus Schoutsen
4fb4838bde Update frontend to 20180524.0 2018-05-24 13:08:12 -04:00
Robert Beal
3a487e54a2 Upgrade linode-api to 4.1.9b1 (#13863) (#14610) 2018-05-24 17:16:35 +02:00
Marcelo Moreira de Mello
36da82aa8d Add Iperf3 client sensor (#14213) 2018-05-24 09:25:27 +02:00
Aaron Bach
5205354cb7 Adds a device class of 'garage' to MyQ covers (#14602) 2018-05-24 07:58:35 +02:00
Jason Hu
3498234448 Add Nest away binary sensor and eta sensor (#14406) 2018-05-23 21:40:33 +02:00
Charles Garwood
c13ebacce1 Remove nma component (#14594)
* Remove nma component

* Update .coveragerc
2018-05-23 20:36:51 +02:00
Fabian Affolter
ad49942201 Upgrade TwitterAPI to 2.5.3 (#14596) 2018-05-23 16:47:58 +02:00
SchumyHao
82770faad7 Add Xiaomi Aqara Lock support (#14419) 2018-05-22 10:40:11 +02:00
Fabian Affolter
a2f9fdf339 Add new transmission sensor types (#14530) 2018-05-22 10:06:14 +02:00
Malte Franken
a2decdaaa3 NUT sensor enhancements (#14570) (Fixes #14324)
* removed default value from required parameter; raising PlatformNotReady when connection to nut unavailable; output human-readable state name by default

* removed superfluous sensor name part; showing human-readable form and raw value of current status in more info dialog

* introduced a new virtual sensor type based on the raw status value but used to display a human-readable form of the status

* renamed method

* format string instead of concatenation

* revert the change to the device state attributes - only output the human-readable status without the raw value
2018-05-22 09:34:02 +02:00
Julian Knauer
72a1b7ae3f Lagute LW-12 Wifi LED control (#13307)
* Added platform lw12wifi for Lagute LW-12 Wifi Lights

Supported features:
* RGB colors
* Variable brightness
* 29 effects
* Changing transitions speed for animated effects

* Added lw12wifi to the list of omitted files to test

* Added lw12 module as new requirement for lw12wifi platform

* Added configuration example docstring for platform lw12wifi

* Updating code according to review in PR:

* Removed unused imports: enum, socket.
* Unused and not imported feature SUPPORT_FLASH was removed.
* Unused import lw12 in setup_platform method removed.
* Fixed indention for valuptuous.
* Changed check if effect is None.
* Removed personal debug output.
* Blocking function are not async anymore.

* Further improvements to satisfy PR.

* Unused import asyncio removed.
* Fixed: Return value and docstring no match up for `assumed_state`.

* Check if the set effect is supported, otherwise revert to normal light.

* Added describing missing docstrings to all functions.

* Adopted code to work with HS color setting.

* Syntactical change in comment.

* Removed redefinition of DOMAIN.

* Refactored lw12 controller setup: removed requirement for host and port in LW12Wifi class.

* Rewritten supported feature setup to a more static  expression.

* Removed unused rgb_color property

* Fixed typo in comment for set_light_option

* Changed RGB option validation schema

* Removed instance properties as config options

* Removed optional settings to be more inline with code style.

* Removed unused option from config example

* Removal of unused import

* Added property to disable state polling for this entity.

* Raise an exception if an unknown effect was selected.

* Fixed an issue with the check for known effects.

* As we do not need to set a default, use simple accessing by key.

* Log if an unknown effect was selected.

* Added link to future documentation.
2018-05-22 09:25:10 +02:00
Marcelo Moreira de Mello
2753dd0c5e Removed attribute current_time from Raincloudy sensors to avoid being triggered by recorder component (#14584) 2018-05-22 08:19:45 +02:00
Daniel Perna
118c49ecaa Update pyhomematic to 0.1.43 (#14583)
* Update __init__.py

* Update requirements_all.txt
2018-05-22 01:50:08 +02:00
Tom Harris
0d9b3bea10 Bump insteonplm version to fix device hanging (#14582)
* Update inteonplm to 0.9.2

* Change to force Travis CI

* Change to force Travis CI
2018-05-22 01:46:20 +02:00
Greg Laabs
23afdec767 Fix ISY moisure sensors showing unknown until a leak is detected (#14496)
* Fix ISY leak sensors always showing UNKNOWN until a leak is detected

Added some logic that handles both moisture sensors and door/window sensors

* Handle edge case of leak sensor status update after ISY reboot

If a leak sensor is unknown, due to a recent reboot of the ISY, the status will get updated to dry upon the first heartbeat. This status update is the only way that a leak sensor's status changes without an accompanying Control event, so we need to watch for it.

* Fixes from overnight testing

State was checking the incorrect parameter, and wasn't calling schedule update

* Remove leftover debug log line

* Remove unnecessary pylint instruction

* Remove access of protected property

We can't cast _.status directly to a bool for some unknown reason (possibly with the VarEvents library), but casting to an int then bool does work.
2018-05-21 21:00:01 +02:00
Paulus Schoutsen
4671bd95c6 Version bump to 0.70.0b2 2018-05-21 11:10:53 -04:00
Marco Orovecchia
1bc916927c fix nanoleaf aurora lights min and max temperature (#14571)
* fixed nanoleaf aurora lights min and max temperature

* review changes
2018-05-21 11:10:36 -04:00
cdce8p
2f8865d6cb Homekit style cleanup (#14556)
* Style cleanup

* Sorted imports
* Harmonized service calls

* Test improvements

* Small update
2018-05-21 11:10:35 -04:00
Martin Hjelmare
cfdea8d20f Wait for future mysensors gateway ready (#14398)
* Wait for future mysensors gateway ready

* Add an asyncio future that is done when the gateway reports the
  gateway ready message, I_GATEWAY_READY.
* This will make sure that the gateway is ready before home assistant
  fires the home assistant start event. Automations can now send
  messages to the gateway when home assistant is started.
* Use async timeout to wait max 15 seconds for ready gateway.

* Address comments
2018-05-21 11:10:35 -04:00
Marco Orovecchia
6e941af9b2 fix nanoleaf aurora lights min and max temperature (#14571)
* fixed nanoleaf aurora lights min and max temperature

* review changes
2018-05-21 11:02:50 -04:00
Paulus Schoutsen
ba9bb90cf7 Update frontend to 20180521.0 2018-05-21 11:01:47 -04:00
Paulus Schoutsen
2ff61786bc Update frontend to 20180521.0 2018-05-21 11:01:35 -04:00
Russell Cloran
9791c6b21b zha: Bump to zigpy-xbee 0.1.1 (#14566) 2018-05-20 21:57:09 -07:00
David F. Mulcahey
a183043d5d Add IlluminanceMeasurementSensor to ZHA (#14563)
* add IlluminanceMeasurementSensor

* address review comment

* Fix whitespace error during merge
2018-05-20 21:56:41 -07:00
cdce8p
0589379de5 Homekit style cleanup (#14556)
* Style cleanup

* Sorted imports
* Harmonized service calls

* Test improvements

* Small update
2018-05-20 22:25:53 -04:00
damarco
ee7e59fe68 zha: Set default binary_sensor state to false (#14553) 2018-05-20 16:14:18 -07:00
David F. Mulcahey
b489519930 zha: Add metering sensor (#14562) 2018-05-20 16:01:56 -07:00
David F. Mulcahey
4395217031 zha: Don't poll switch devices (#14560) 2018-05-20 16:00:51 -07:00
Marco Orovecchia
c8ad9c4daa Add auto discovery for nanoleaf aurora lights (#14301)
* auto discovery added for nanoleaf aurora lights

* changes requested by review

* visual indentation

* line too long

* hide autocreated config
2018-05-20 20:53:57 +02:00
Oliver
c050eb4100 Pushed to version 0.7.2 of denonavr (#14551) 2018-05-20 09:50:12 +02:00
Martin Hjelmare
c8a53c564a Wait for future mysensors gateway ready (#14398)
* Wait for future mysensors gateway ready

* Add an asyncio future that is done when the gateway reports the
  gateway ready message, I_GATEWAY_READY.
* This will make sure that the gateway is ready before home assistant
  fires the home assistant start event. Automations can now send
  messages to the gateway when home assistant is started.
* Use async timeout to wait max 15 seconds for ready gateway.

* Address comments
2018-05-19 18:33:52 -04:00
Kerwin Bryant
c316d5b0b9 Add support to ignore a xiaomi aqara gateway (#14428) 2018-05-19 22:36:47 +02:00
Fabian Affolter
e88fc33eef Fix sensor name (fixes #14535) (#14541) 2018-05-19 17:14:53 +02:00
Paulus Schoutsen
8854efd685 Version bump to 0.70.0b1 2018-05-19 10:45:18 -04:00
Paulus Schoutsen
b0e850ba5d Bump frontend to 20180519.0 2018-05-19 10:45:03 -04:00
Paulus Schoutsen
74f1f08ab5 Bump frontend to 20180519.0 2018-05-19 10:44:54 -04:00
Greg Dowling
aa51bb6cb9 Bump pyvera version (improve stability of poll loop). (#14540) 2018-05-19 10:49:52 +02:00
Fabian Affolter
8deb462471 Upgrade restrictedpython to 4.0b4 (#14537) 2018-05-19 10:05:02 +02:00
Fabian Affolter
46dc9322a2 Upgrade keyring to 12.2.1 (#14521) 2018-05-19 10:04:42 +02:00
Fabian Affolter
daf8143d01 Upgrade youtube_dl to 2018.05.18 (#14519) 2018-05-19 10:04:20 +02:00
Fabian Affolter
54dfe045b2 Upgrade aiohttp to 3.2.1 (#14517)
* Upgrade aiohttp to 3.2.1

* Upgrade async_timeout to 3.0.0

* Update the order of the requirements
2018-05-19 10:04:00 +02:00
Paulus Schoutsen
f2dfc84d52 Version bump to 0.70.0b0 2018-05-18 19:31:16 -04:00
Paulus Schoutsen
e55f7ebf81 Merge branch 'master' into dev 2018-05-18 19:30:48 -04:00
Paulus Schoutsen
8d06469efe Bump frontend to 20180518.1 2018-05-18 18:15:49 -04:00
Fabian Affolter
c1127133ea Set certifi to >=2018.04.16 (#14536) 2018-05-18 18:14:40 -04:00
Sean Dague
25970027c6 Update mychevy to 0.4.0 (#14372)
After 2 months of being offline, the my.chevy website seems to be
working again. Some data structures changed in the mean time. The new
library will handle multiple cars. This involves a breaking change in
slug urls for devices where these now include the car make, model, and
year in them.

Discovery has to be delayed until after the initial site login to get
the car metadata.
2018-05-18 13:37:43 -04:00
Greg Laabs
d7640e6ec3 Fix some ISY sensors not getting detected as binary sensors (#14497)
Sensors that were defined via sensor_string were not getting properly identified as binary sensors when they had a uom defining them as binary (the other three methods of detecting binary sensors worked though.)
2018-05-18 08:42:09 -07:00
cdce8p
12e76ef7c1 Update HAP-python to 2.1.0 (#14528) 2018-05-18 16:32:57 +02:00
hanzoh
d36996c8f0 Add Homematic IP RotaryHandleSensor support (#14522)
* Add Homematic IP RotaryHandleSensor support

HmIP-SRH was in the RotaryHandleSensor class and threw errors that LOWBAT and ERROR could not be found (they are LOW_BAT and SABOTAGE).

* Revert REQUIREMENTS change
2018-05-18 16:20:30 +02:00
Fabian Affolter
e929f45ab8 Set pytz to >=2018.04 (#14520) 2018-05-18 09:42:41 -04:00
cdce8p
4c328baaa6 Add code to HomeKit lock (#14524) 2018-05-18 13:52:52 +02:00
Fabian Affolter
cc5edf69e3 Show warning if no locations are shared (fixes #14177) (#14511) 2018-05-18 09:04:47 +02:00
Matt Snyder
909f2448ca Flux bug fix (#14476)
* Simplify conditionals.

* Send white_value on service call.

* Remove extra blank line

* Further simplification of conditionals

* Requested changes

* Do not call getRgb if not needed

* Update log message
2018-05-18 08:50:57 +02:00
Diogo Gomes
97076aa3fd Fix probability_threshold in binary_sensor.bayesian (#14512) (Closes: #14362) 2018-05-18 07:48:16 +02:00
Malte Franken
a3777c4ea8 Feedreader configurable update interval and max entries (#14487) 2018-05-18 07:25:08 +02:00
Paulus Schoutsen
1c3293ac85 Update frontend to 20180518.0 (#14510)
* Update frontend to 20180517.0

* Update requirements

* Bump frontend to 20180518.0
2018-05-17 21:29:37 -04:00
thelittlefireman
f06a0ba373 Bump locationsharinglib to 2.0.2 (#14359)
* Bump locationsharinglib to 2.0.2

* Bump locationsharinglib to 2.0.2
2018-05-17 23:06:39 +02:00
Anders Melchiorsen
9afc2634c6 Adjust LimitlessLED properties for running effects (#14481) 2018-05-17 20:54:25 +02:00
Nate Clark
ed3efc8712 Konnected component follow up (#14491)
* make device_discovered synchronous

* small fixes from code review

* use dispatcher to update sensor state

* update switch state based on response from the device

* interpolate entity_id into dispatcher signal

* cleanup lint

* change coroutine to callback
2018-05-17 20:19:05 +02:00
Mike
144524fbbb Update hitron_coda.py (#14506)
missed a typo that wasn't caught with testing since I don't have a Rogers router.
2018-05-17 19:44:01 +02:00
ChristianKuehnel
298d31e42b New Sensor FinTS (#14334) 2018-05-17 02:45:47 +02:00
Paulus Schoutsen
3e7d4fc902 Bump frontend to 20180516.1 2018-05-16 09:39:14 -04:00
Paulus Schoutsen
64223cea72 Update frontend to 20180516.0 2018-05-16 09:01:30 -04:00
Nathan Henrie
1053473111 Add stdout and stderr to debug output for shell_command (#14465) 2018-05-16 13:47:41 +02:00
Matt Schmitt
25dcddfeef Add HomeKit support for fans (#14351) 2018-05-16 13:15:59 +02:00
Ville Skyttä
e20f88c143 Use "Returns" consistently to avoid being treated as section (#14448)
Otherwise, by side effect, results in error D413 by recent pydocstyle.
2018-05-16 10:01:48 +02:00
William Scanlon
1533a68c06 Added option to invert aREST pin switch logic for active low relays (#14467)
* Added option to invert aREST pin switch logic for active low relays

* Fixed line lengths

* Changed naming and set optional invert default value.

* Fixed line length

* Removed default from get
2018-05-16 09:58:49 +02:00
Greg Laabs
5ff5c73e2b "unavailable" Media players should be considered off in Universal player (#14466)
The Universal media player inherits the states of the first child player that is not in some sort of "Off" state (including idle.) It was not considering the "unavailable" state to be off. Now it does.
2018-05-16 08:00:57 +02:00
Anders Melchiorsen
6ba49e12a2 Improve handling of offline Sonos devices (#14479) 2018-05-16 07:35:43 +02:00
nordlead2005
852ce9f990 Added temperature (apparent) high/low, deprecated max/min (#12233) 2018-05-15 21:26:41 +02:00
Paulus Schoutsen
df69680d24 Don't add a url to built-in panels (#14456)
* Don't add a url to built-in panels

* Add url_path back

* Lint

* Frontend bump to 20180515.0

* Fix tests
2018-05-15 14:47:46 -04:00
Gerard
2e7b5dcd19 BMW code cleanup (#14424)
* Some cleanup for BMW sensors

* Changed dict sort

* Updates based on review and Travis
2018-05-15 20:47:32 +02:00
Malte Franken
e49e0b5a13 Make Feedreader component more extendable (#14342)
* moved regular updates definition to own method to be able to override behaviour in subclass

* moved filter by max entries to own method to be able to override behaviour in subclass

* event type used when firing events to the bus now based on variable to be able to override behaviour in subclass

* feed id introduced instead of url for storing meta-data about the feed to be able to fetch the same feed from different configs with different filtering rules applied

* keep the status of the last update; continue processing the entries retrieved even if a recoverable error was detected while fetching the feed

* added test cases for feedreader component

* better explanation around breaking change

* fixing lint issues and hound violations

* fixing lint issue

* using assert_called_once_with instead of assert_called_once to make it compatible with python 3.5
2018-05-15 20:43:26 +02:00
Nate Clark
de50d5d9c1 Add Konnected component with support for discovery, binary sensor and switch (#13670)
* Add Konnected component with support for discovery, binary sensor, and switch

Co-authored-by: Eitan Mosenkis <eitan@mosenkis.net>

* Use more built-in constants from const.py

* Fix switch actuation with low-level trigger

* Quiet logging; Improve schema validation.

* Execute sync request outside of event loop

* Whitespace cleanup

* Cleanup config validation; async device setup

* Update API endpoint for Konnected 2.2.0 changes

* Update async coroutines via @OttoWinter

* Make backwards compatible with Konnected < 2.2.0

* Add constants suggested by @syssi

* Add to CODEOWNERS

* Remove TODO comment
2018-05-15 19:58:00 +02:00
c727
612a37b2dd Remove simplepush.io (#14358) 2018-05-15 16:57:51 +02:00
Diogo Gomes
d47006c98f Optimistic MQTT light (#14401)
* Restores light state, case the light is optimistic

* lint

* hound

* hound

* Added mqtt_json

* hound

* added mqtt_template

* lint

* cleanup

* use ATTR
2018-05-15 12:25:50 +02:00
Sebastian Muszynski
16bf10b1a2 Don't poll the Samsung Family hub camera (#14473) 2018-05-15 08:50:07 +02:00
William Scanlon
710533ae8a Minor Wink fixes (#14468)
* Updated Wink light supported feature to reflect what features a given light support.

* Fix typo in wink climate
2018-05-15 07:53:12 +02:00
Matthew Garrett
11c57f9345 Bump lakeside version (#14471)
This should fix a couple of issues with T1013 bulbs, and also handle
accounts that contain unknown devices.
2018-05-15 07:51:32 +02:00
Martin Hjelmare
7562b4164b Fix key error upon missing node (#14460)
* This is needed after gateway ready message generates an update while
  persistence is off, or while the gateway node hasn't been presented
  yet.
2018-05-14 22:52:44 +02:00
Gregory Benner
cf44b77225 Samsung Family hub camera component (#14458)
* add familyhub.py camera

* fix import and REQUIREMENTS

* add to coveragerc

* fix formatting to make houndci-bot happy

* ran scripts/gen_requirements_all.py

* use CONF_IP_ADDRESS

* Revert "ran scripts/gen_requirements_all.py"

This reverts commit 3a38681d8a.

* fix library name

* add missing docstrings and enable polling

* Sort imports
2018-05-14 22:52:35 +02:00
Matt Schmitt
44e9783c7c Add support for direction to fan template (#14371)
* Initial commit

* Update and add tests
2018-05-14 22:37:49 +02:00
Fabian Affolter
1b5c02ff67 Upgrade pygatt to 3.2.0 (#14447) 2018-05-14 21:52:54 +02:00
Russell Cloran
2f74ffcf81 zha: Fix cluster class check in single-cluster device type (#14303)
zigpy now allows custom devices, which might mean that devices have cluster
objects which are not instances of the default, but may be instances of
sub-classes of the default. This fixes the check for finding single-cluster
device entities to handle sub-classes properly.
2018-05-14 16:50:09 +02:00
Fabian Affolter
954e4796b8 Use ATTR_NAME from const.py (#14450) 2018-05-14 13:05:52 +02:00
Fabian Affolter
fb501282cc Add SpaceAPI support (#14204)
* Add SpaceAPI support

* Changes according PR comments

* Add tests

* Remove print

* Minor changes
2018-05-14 09:13:59 +02:00
Robert Svensson
c06351f2a9 Bump requirement to pydeconz v38 (#14452) 2018-05-14 08:41:17 +02:00
Johann Kellerman
6b9c65c9ce Allow qwikswitch sensors as part of devices (#14454) 2018-05-14 08:40:25 +02:00
Philip Rosenberg-Watt
8ae3caa292 Add priority and cycles to LaMetric (#14414)
* Add priority and cycles to LaMetric

Priority can be "info", "warning" (default), or "critical" and
cycles is the number of times the message is displayed. If cycles
is set to 0 we get a persistent notification that has to be dismissed
manually.

* Fix for schema and style

* Fix for style
2018-05-13 18:04:21 +02:00
Fabian Affolter
391e3196ea Upgrade distro to 1.3.0 (#14436) 2018-05-13 18:01:10 +02:00
Fabian Affolter
cb709931e4 Upgrade youtube_dl to 2018.05.09 (#14438) 2018-05-13 18:00:37 +02:00
Fabian Affolter
a750f8444e Upgrade Sphinx to 1.7.4 (#14439) 2018-05-13 18:00:08 +02:00
Fabian Affolter
a5bff4cd8d Upgrade python-telegram-bot to 10.1.0 (#14441) 2018-05-13 17:59:25 +02:00
Fabian Affolter
e0bc894cbb Upgrade pyota to 2.0.5 (#14442)
* Use constants

* Upgrade pyota to 2.0.5
2018-05-13 17:58:57 +02:00
Fabian Affolter
3ec56d55c5 Upgrade requests_mock to 1.5 (#14444) 2018-05-13 17:58:18 +02:00
Martin Hjelmare
b904a4e770 Remove universal wheel setting (#14445)
* Home assistant should not build a universal wheel since we don't
  support Python 2.
2018-05-13 17:57:52 +02:00
Ville Skyttä
146a9492ec Clean up some Python 3.4 remnants (#14433) 2018-05-13 17:56:42 +02:00
cdce8p
e5d714ef52 Fix fan service description (#14423) 2018-05-13 14:41:42 +02:00
Ville Skyttä
4d63baf705 Invoke pytest instead of py.test per upstream recommendation, #dropthedot (#14434)
http://blog.pytest.org/2016/whats-new-in-pytest-30/
https://twitter.com/hashtag/dropthedot
2018-05-13 12:11:55 +02:00
Ville Skyttä
234bf1f0ea Spelling, grammar etc fixes (#14432)
* Spelling, grammar etc fixes

* s/an api data/data of an api/
2018-05-13 12:09:28 +02:00
Ville Skyttä
843789528e Remove extra quotes from docstrings (#14431) 2018-05-13 11:06:15 +02:00
Krasimir Chariyski
ea2c073612 Add Bulgarian to Google TTS (#14422) 2018-05-12 17:46:00 -04:00
Andrey
d1228d5cf4 Look at registry before pulling zwave config values (#14408)
* Look at registry before deciding on ID for zwave values

* Reuse the new function
2018-05-12 17:45:36 -04:00
Andrey
7aec098a05 Bring back typing check. Meanwhile just for homeassistant/*.py (#14410)
* Bring back typing check. Meanwhile just for homeassistant/.py

* Change follow-imports to silent. Add a few more checks.
2018-05-12 17:44:53 -04:00
Ville Skyttä
70af7e5fad Update pylint to 1.8.4 (#14421) 2018-05-12 22:22:20 +02:00
Daniel Høyer Iversen
99e272fc8d Upgrade PyXiaomiGatewa to 0.9.3 (#14420) (Closes: #14417) 2018-05-12 21:12:53 +02:00
cdce8p
990f476ac9 Homekit test cleanup (#14416) 2018-05-12 17:10:19 +02:00
Paulus Schoutsen
9abc13aaa6 Merge pull request #14413 from home-assistant/rc
0.69.1
2018-05-12 09:35:30 -04:00
Paulus Schoutsen
d17186a8b7 Version bump to 0.69.1 2018-05-12 09:34:28 -04:00
Lukas Barth
6fedad7890 Fix waiting for setup that never happens (#14346) 2018-05-12 09:34:13 -04:00
Sebastian Muszynski
b371bf700f Bump PyXiaomiGateway version (#14412) 2018-05-12 15:09:48 +02:00
damarco
01ce43ec7c Use None as initial state in zha component (#14389)
* Return None if state is unknown

* Use None as initial state
2018-05-12 14:41:44 +02:00
Lukas Barth
b903bbc042 Fix waiting for setup that never happens (#14346) 2018-05-12 10:30:21 +02:00
Martin Hjelmare
304137e7ff Fix name of tox pylint env (#14402) 2018-05-12 10:07:10 +02:00
Matthew Treinish
e80628d45b Bump pycmus version (#14395)
This commit bumps the pycmus version used by the cmus component. There
was a bug in the previous version used, 1.0.0, when running in local
mode. This was caused by a mtreinish/pycmus#1 and also was reported in
the home-assistant forums (but not as an issue):

https://community.home-assistant.io/t/cant-install-cmus-component/7961

Version 0.1.1 of pycmus fixes this issue so it should work properly for
users running cmus and home-assistant on the same machine.
2018-05-12 07:51:48 +02:00
Sebastian Muszynski
d6b81fb345 Xiaomi Aqara: Add new cube model (sensor_cube.aqgl01) (#14393) 2018-05-11 22:40:32 +02:00
Paulus Schoutsen
c5cac04e54 Merge pull request #14392 from home-assistant/rc
0.69
2018-05-11 12:38:08 -04:00
Matt Schmitt
621c653fed Allow HomeKit name to be customized (#14159) 2018-05-11 14:22:45 +02:00
Malte Franken
48d70e520f more detailed error message (#14385) 2018-05-11 12:28:28 +02:00
Robin
528ad56530 Adds facebox (#14356)
* Adds facebox

* Update .coveragerc

* Remove facebox

* Add test of faces attribute

* Add event test

* Adds more tests

* Adds tests to increase coverage

* Rename MOCK_FACES to MOCK_FACE

* Adds STATE_UNKNOWN
2018-05-11 09:57:00 +02:00
Martin Hjelmare
be3b227a87 Make mysensors component async (#13641)
* Make mysensors component async

* Use async dispatcher and discovery.
* Run I/O in executor.
* Make mysensors actuator methods async.
* Upgrade pymysensors to 0.13.0.
* Use async serial gateway.
* Use async TCP gateway.
* Use async mqtt gateway.

* Start gateway before hass start event

* Make sure gateway is started after discovery of persistent devices
  and after corresponding platforms have been loaded.
* Don't wait to start gateway until after hass start.

* Bump pymysensors to 0.14.0
2018-05-11 09:39:18 +02:00
damarco
ef8fc1f201 Update sensor state before adding device (#14357) 2018-05-10 22:32:16 -07:00
Paulus Schoutsen
8c0b45af1e Version bump to 0.69.0 2018-05-10 22:40:04 -04:00
Paulus Schoutsen
3b39ab5b94 Remove domain expiry sensor (#14381) 2018-05-10 22:39:35 -04:00
cdce8p
8fcf085829 Rewritten HomeKit tests (#14377)
* Use pytest fixtures and parametrize
* Use async
2018-05-11 01:21:59 +02:00
Abílio Costa
6843893d9f Add "framerate" parameter to generic camera (#14079)
* add "framerate" parameter to generic camera

* fix lint
2018-05-11 00:22:02 +02:00
damarco
e963fc5acf Add support for pressure sensors (#14361) 2018-05-10 23:55:32 +02:00
Paulus Schoutsen
bc664c276c Bump frontend to 20180510.1 2018-05-10 17:38:41 -04:00
Paulus Schoutsen
f192ef8219 Remove domain expiry sensor (#14381) 2018-05-10 23:13:00 +02:00
damarco
db31cdf075 Fix binary_sensor device_state_attributes (#14375) 2018-05-10 21:28:57 +02:00
Andrey
f168226be9 Update to sensibo 1.0.3 with better error reporting (#14380) 2018-05-10 21:11:02 +02:00
Paulus Schoutsen
ea01b127c2 Add local auth provider (#14365)
* Add local auth provider

* Lint

* Docstring
2018-05-10 14:09:22 -04:00
damarco
6e831138b4 Fix binary_sensor async_update (#14376) 2018-05-10 10:59:23 -07:00
Pascal Vizeli
eb2671f4bb Update .coveragerc (#14368) 2018-05-10 13:18:13 +02:00
cdce8p
8d017b7678 script/lint: Ensure there are files to test with pylint (#14363) 2018-05-10 12:47:04 +02:00
Paulus Schoutsen
5ec7fc7ddb Backend tweaks to make authorization work (#14339)
* Backend tweaks to make authorization work

* Lint

* Add test

* Validate redirect uris

* Fix tests

* Fix tests

* Lint
2018-05-10 10:38:11 +02:00
Teemu R
0f3ec94fba debug++ for multiple volume controls (#14349)
Be less noisy for those who have more volume controls than one, mentioned in #13022.
2018-05-09 13:44:42 +02:00
Fabian Affolter
2c566072f5 Upgrade keyring to 12.2.0 and keyrings.alt to 3.1 (#14355) 2018-05-09 11:31:18 +02:00
Nash Kaminski
cf8562a030 Support control of away mode and hold mode in Venstar component. Correctly detect humidifiers. (#14256)
* Implement support for away mode and hold mode in Venstar component

* Fix Venstar humidifier capability detection

* Add option to configure humidifier control in Venstar component

* style fix: add missing space and resolve pylint issues

* Remove quotes
2018-05-09 11:26:29 +02:00
Mal Curtis
a91c1bc668 Add zone 3 for Onkyo media player (#14295)
* Add zone 3 for Onkyo media player

* CR Updates

* Fix travis lint errors
2018-05-08 22:33:38 -04:00
Paulus Schoutsen
f406fd57ac Version bump to 0.69.0b3 2018-05-08 20:55:35 -04:00
Anders Melchiorsen
2d0e3c1402 Ignore NaN values for influxdb (#14347)
* Ignore NaN values for influxdb

* Catch TypeError
2018-05-08 20:55:12 -04:00
Paulus Schoutsen
01ec4a7afd Bump frontend to 20180509.0 2018-05-08 20:54:49 -04:00
Anders Melchiorsen
d43e6a2888 Ignore NaN values for influxdb (#14347)
* Ignore NaN values for influxdb

* Catch TypeError
2018-05-08 20:54:38 -04:00
Paulus Schoutsen
50cea77887 Bump frontend to 20180509.0 2018-05-08 20:48:46 -04:00
Mario Di Raimondo
6231394614 Waze Travel Time: optional inclusive/exclusive filters (#14000)
* Waze Travel Time: optional inclusive/exclusive filters

Added optional `inc_filter` and `excl_filter' params that allow to refine the reported routes: the first is not always the best/desired. A simple case-insensitive filtering (no regular expression) is used.

* fix line lenght

* fix spaces

* Rename var

* Fix typo

* Fix missing var
2018-05-09 00:35:03 +02:00
Aaron Bach
f516cc7dc6 Adds useful attributes to RainMachine programs and zones (#14087)
* Starting to add attributes

* All attributes added to programs

* Basic zone attributes in place

* Added advanced properties for zones

* Working to move common logic into component + dispatcher

* We shouldn't calculate the MAC with every entity

* Small fixes

* Small adjustments

* Owner-requested changes

* Restart

* Restart part 2

* Added ID attribute to each switch

* Collaborator-requested changes
2018-05-08 18:10:03 -04:00
Evgeniy
9c7523d7b0 Improving icloud device tracker (#14078)
* Improving icloud device tracker

* Adding config validations for new values

* Adding config validations for new values

* Moving icloud specific setup to platform schema. Setting default in platform schema.
2018-05-08 23:42:57 +02:00
Andrey
10505d542a Make sure zwave nodes/entities enter the registry is proper state. (#14251)
* When zwave node's info is parsed remove it and re-add back.

* Delay value entity if not ready

* If node is ready consider it parsed even if manufacturer/product are missing.

* Add annotations
2018-05-08 15:30:28 -04:00
Nick Whyte
e12994a0cd Fix BOM weather '-' value (#14042) 2018-05-08 13:35:55 -04:00
stephanerosi
ff01aa40c9 Add help for conversation/process service (#14323)
* Add help for conversation/process service

* Add logging to debug text received when service is called

* Move conversation to specific folder
2018-05-08 13:24:27 -04:00
Paulus Schoutsen
6199e50e80 Fix Insteon PLM coverage 2018-05-08 11:55:04 -04:00
Tod Schmidt
c664c20165 Snips: Added slot values for siteId and probability (#14315)
* Added solt values for siteId and probability

* Update snips.py

* Update test_snips.py
2018-05-08 11:43:31 -04:00
David Broadfoot
eb551a6d5a Gogogate2 0.1.1 (#14294)
* Gogogate2 - bump version

Uses latest version of library which ensures commands to device are idempotent

* Update requirements_all

* Expose sensor temperature

* update version

* import attribute

* Set temperature

* Remove temperature attribute

Removed temperature attribute until it can be re-implemented as a separate sensor.

* Update ordering

* Fix copy-&-paste issue
2018-05-08 11:42:18 -04:00
m4dmin
4343659742 add 2 devices (#14321)
* add 2 devices

io:RollerShutterUnoIOComponent
io:ExteriorVenetianBlindIOComponent

* add 2 devices

* Update tahoma.py

* Fix hounci-bot violation

* Fixed Travis CI build failure

./homeassistant/components/cover/tahoma.py:83:13: E125 continuation line with same indent as next logical line

* Fixed Travis CI build failure

E125 continuation line with same indent as next logical line

* Fixed Travis CI build failure

E127 continuation line over-indented for visual indent

* Fix indent

* Change check
2018-05-08 13:43:07 +02:00
Mattias Welponer
230bd3929c Add more homematicip cloud components (#14084)
* Add support for shutter contact and motion detector device

* Add support for power switch devices

* Add support for light switch device

* Cleanup binary_switch and light platform

* Update comment
2018-05-08 09:57:51 +02:00
Gerard
ba7333e804 Add sensors for BMW electric cars (#14293)
* Add sensors for electric cars

* Updates based on review of @MartinHjelmare

* Fix Travis error

* Another fix for Travis
2018-05-08 09:52:21 +02:00
Mike
48b13cc865 Update hitron_coda.py to fix login for Shaw modems (#14306)
I have a Hitron modem provided by Shaw communications rather than from Rogers as the Docs specify for this device_tracker but it seems like the api/code is all the same except that the login failed due to the password being passed as "pws" instead of "pwd". Making that one character change allowed HASS to read the connected device details from my Hitron modem. If this difference is actually one that stands between the Rogers-provided Hitron modems and the Shaw-provided variant, I am happy to create another device-tracker file for the Shaw modem. I just figured I would go with the simplest solution first.
2018-05-08 09:26:46 +02:00
Aaron Bach
e7c7b9b2a9 Adds unique ID to Roku for entity registry inclusion (#14325)
* Adds unique ID to Roku for entity registry inclusion

* Owner-requested changes
2018-05-07 13:18:51 -04:00
Paulus Schoutsen
8d24541ffe Version bump to 0.69.0b2 2018-05-07 13:12:54 -04:00
Paulus Schoutsen
b1eb35ee11 Ignore more loading errors (#14331) 2018-05-07 13:12:43 -04:00
Paulus Schoutsen
c7166241f7 Ignore more loading errors (#14331) 2018-05-07 13:12:12 -04:00
Paulus Schoutsen
a4e1615127 Version bump to 0.69.0b1 2018-05-07 10:05:34 -04:00
Javier Gonel
3e5d76efb2 fix(hbmqtt): partial packets breaking hbmqtt (#14329)
This issue was fixed in hbmqtt/issues#95 that was released in hbmqtt 0.9.2
2018-05-07 10:01:23 -04:00
Paulus Schoutsen
6a74fa344d Revert custom component loading logic (#14327)
* Revert custom component loading logic

* Lint

* Fix tests

* Guard for infinite inserts into sys.path
2018-05-07 10:01:22 -04:00
Paulus Schoutsen
c4ec2e3434 Fix module names for custom components (#14317)
* Fix module names for custom components

* Also set __package__ correctly

* bla

* Remove print
2018-05-07 10:01:22 -04:00
cdce8p
c48986a467 Add debounce to move_cover (#14314)
* Add debounce to move_cover

* Fix spelling mistake
2018-05-07 10:01:22 -04:00
Justin Loutsenhizer
ab621808bd Add missing 'sensor' to ABODE_PLATFORMS (#14313)
This fixes missing light, humidity, temperature sensors from abode component.
2018-05-07 10:01:21 -04:00
Paulus Schoutsen
5c88e897af Update netdisco to 1.4.1 2018-05-07 10:01:06 -04:00
Paulus Schoutsen
6318178a8b Update netdisco to 1.4.1 2018-05-07 10:00:54 -04:00
Javier Gonel
a2b8ad50f2 fix(hbmqtt): partial packets breaking hbmqtt (#14329)
This issue was fixed in hbmqtt/issues#95 that was released in hbmqtt 0.9.2
2018-05-07 09:52:33 -04:00
Paulus Schoutsen
5c95c53c6c Revert custom component loading logic (#14327)
* Revert custom component loading logic

* Lint

* Fix tests

* Guard for infinite inserts into sys.path
2018-05-07 11:25:48 +02:00
Jerad Meisner
e60d066514 Converted SABnzbd to a component (#12915)
* Converted SABnzbd to a component

* fixed async issues

* Made sabnzbd scan interval static. More async fixes.

* Sabnzbd component code cleanup

* Skip sensor platform setup if discovery_info is None
2018-05-07 09:35:55 +02:00
cdce8p
91fe6e4e56 Add debounce to move_cover (#14314)
* Add debounce to move_cover

* Fix spelling mistake
2018-05-06 20:55:38 -04:00
Paulus Schoutsen
34727be5ac Fix module names for custom components (#14317)
* Fix module names for custom components

* Also set __package__ correctly

* bla

* Remove print
2018-05-06 20:54:56 -04:00
Justin Loutsenhizer
107769ab81 Add missing 'sensor' to ABODE_PLATFORMS (#14313)
This fixes missing light, humidity, temperature sensors from abode component.
2018-05-06 19:18:26 +02:00
Russell Cloran
63cc179ea2 zha: Bump to zigpy 0.1.0 (#14305) 2018-05-06 11:17:05 +02:00
thepotoo
2bb1a95098 Add unique_id to MQTT switch (#13719) 2018-05-06 08:21:02 +02:00
Paulus Schoutsen
f3411f8db2 Version bump to 0.70.0.dev0 2018-05-05 11:42:32 -04:00
Paulus Schoutsen
1e31af77de Version bump to 0.69.0b0 2018-05-05 11:41:55 -04:00
Paulus Schoutsen
2326312bee Merge branch 'master' into dev 2018-05-05 11:41:29 -04:00
Paulus Schoutsen
83e342daf2 Update frontend to 20180505.0 2018-05-05 11:35:42 -04:00
Paulus Schoutsen
a4b69833d4 Update translations 2018-05-05 11:35:02 -04:00
Tom Harris
64ba2c63c7 Add All-Linking capabilities (#14065)
* Setup all-linking service

* Remove extra line

* Remove linefeed and tab escape chars

* Add services delete_all_link, load_all_link_database and print_all_link_database

* Check if reload is set

* Confirm entity is InsteonPLMEntity before attempting to load or print ALDB

* Debug load and print ALDB

* Debug print aldb

* Debug print_aldb

* Get entity via platform

* Track Insteon entities in component

* Store entity list in hass.data

* Add entity to hass.data

* Add ref to hass in InsteonPLMEntity

* Pass hass correctly to InsteonPLMBinarySensor

* Fix reference to ALDBStatus.PARTIAL

* Print ALDB record as string

* Get ALDB record from memory address

* Reformat ALDB log output

* Add print_im_aldb service

* Remove reference to self in print_aldb_to_log

* Remove reference to self in print_aldb_to_log

* Fix spelling issue with load_all_link_database service

* Bump insteonplm to 0.9.1

* Changes from code review

* Code review changes

* Fix syntax error

* Correct reference to cv.boolean and update requirements

* Update requirements

* Fix flake8 errors

* Reload as boolean test

* Remove hass from entity init
2018-05-05 11:15:20 -04:00
Ron Šmeral
2e8eaf40f7 Onkyo: SUPPORT_VOLUME_STEP (#14299) 2018-05-05 17:06:32 +02:00
Robin
b9e893184a Refactor ImageProcessingFaceEntity (#14296)
* Refactor ImageProcessingFaceEntity

* Replace STATE_UNKNOWN with None
2018-05-05 16:57:53 +02:00
Jason Kingsbury
4d085882d5 Add support for max_volume (#13822)
* onkyo: add support for max volume range

* onkyo: make flake8 happy

* onkyo: fix PEP8 D205 on line 181

* onkyo: use range for max_volume configuration

* onkyo: fix line too long
2018-05-05 10:30:54 -04:00
Jesse Newland
f6e29a6647 Add domain to labels and count state changes to Prometheus (#14253)
* Add domain to labels

* Count state changes
2018-05-05 10:23:01 -04:00
Jesse Newland
1a936220e9 Add alarmdotcom sensor status (#14254)
* bump to match Xorso/pyalarmdotcom#9

* Load additional status attributes

* missed a spot
2018-05-05 10:21:58 -04:00
Robert Svensson
8410b63d9c deCONZ add new device without restart (#14221)
* Add new device without restarting hass

* Remove debug prints

* Fix copy paste error

* Fix comments from balloob
Add tests to verify signalling with new added devices

* Fix hound comments
Add test to verify when new sensor is added

* Fix tests

* Unload entry should unsubscribe all deconz dispatchers

* Make sure mock setup also creates unsub in hass data

* Fix copy paste issue

* Lint
2018-05-05 10:11:00 -04:00
Lukas Barth
af8cd63838 Matrix Chatbot (#13355)
* Add first version of the Matrix bot

* It's a stupid but necessary change…

* Dont list it twice

* All hail the linter!

* More linter-pleasing

* Use the correct user ID

* Add expression commands

* Add tests for new validators

* Fix room alias handling

* Wording

* Defer setup

* Simplify commands

* Handle exceptions

* Update requirements

* Review

* Move login back to constructor

* Fix review comments
2018-05-05 10:00:36 -04:00
cdce8p
95d27bd1fa Sensor device classes (#14282)
* Added light device class, moved device classes to const

* Removed unnecessary icons

* Replace 'lux' with 'lx'

* Fix comment

* Changed device_class name
2018-05-05 09:37:40 -04:00
blackwind
ec3ce4c80d Publish attributes unconditionally (#14179)
* Publish attributes unconditionally

Because the attribute publish command was previously hidden behind `if val:`, falsy values like False and 0.0 weren't being published, thereby making Statestream -- particularly in the case of booleans, where the first True would be retained indefinitely -- a completely worthless indicator of state.

* Change bool test to False to confirm falsy values pass
2018-05-05 09:31:39 -04:00
Nick Whyte
5ade84d75f BOM Weather throttle fix (#14234) 2018-05-05 11:17:27 +02:00
Fabian Affolter
75bf483071 Upgrade astral to 1.6.1 (#14297) 2018-05-05 10:45:09 +02:00
Diogo Gomes
354470469f Fix filter sensor missing window_size argument (#14252)
* missing window_size argument

* test throttle filter configuration
2018-05-05 03:10:08 +02:00
Matt Schmitt
255a85ad02 HomeKit: Support triggered state for alarm_control_panel (#14285) 2018-05-05 00:09:16 +02:00
cdce8p
bb76ba67f3 Homekit: Changed device_class requirement Humidity Sensor (#14277) 2018-05-04 22:48:38 +02:00
Fabian Affolter
7900ba30bf Upgrade holidays to 0.9.5 (#14274) 2018-05-04 17:09:05 +02:00
cdce8p
e37fd5b132 Update HAP-python to 2.0.0 (#14278)
* Fixed async (added 'async_add_job' and 'add_job')

* Driver status

* Use pyhap category constants

* Changed 'set_broker' to 'set_driver'

* Changed loader method names

* Use 'serv.configure_char'

* Use 'self.set_info_service'

* Use 'self.add_preload_service'

* Fix hound issue

* Updated HAP-python to 2.0.0
2018-05-04 16:46:00 +02:00
Fabian Affolter
f98525acbf Upgrade attrs to 18.1.0 (#14281) 2018-05-04 08:58:34 -04:00
Otto Winter
36cf2125ce Issue Template Fix CRLF (#14283) 2018-05-04 13:49:13 +02:00
Boyi C
c80b752d0e fix check config not working after #14211 (#14259) 2018-05-04 12:29:07 +02:00
Anders Melchiorsen
fa0ad7b317 Color fixes for Wink lights (#14263) 2018-05-04 12:28:56 +02:00
Fabian Affolter
b49d98407c Remove feature request 2018-05-04 10:56:35 +02:00
Fabian Affolter
5f8f6666e6 Update issue templates 2018-05-04 10:55:55 +02:00
Fabian Affolter
54ccbbcb64 Update issue templates 2018-05-04 10:54:55 +02:00
Fabian Affolter
a7a3cff0f1 Update issue templates 2018-05-04 10:52:20 +02:00
Fabian Affolter
9859840b9c Update issue templates 2018-05-04 10:48:13 +02:00
cdce8p
8cabec7ac1 Fix ZWave light brightness (#14261)
* Fix ZWave light brightness
* The brightness should always be an integer
* Changed to round
2018-05-03 23:28:03 +02:00
Paulus Schoutsen
15e75b07d8 Allow fetching media player covers via websocket connection (#14233)
Lint
2018-05-03 22:03:26 +02:00
Paulus Schoutsen
58257af289 Add fetching camera thumbnails over websocket (#14231)
* Add fetching camera thumbnails over websocket

* Lint
2018-05-03 22:02:59 +02:00
Erik Eriksson
4ecce2598a Re-enable eliqonline requirement (#14265) 2018-05-03 19:54:37 +02:00
cdce8p
e68b52d50d Demo Sensor - Added device_class support (#14269) 2018-05-03 19:51:36 +02:00
roiff
c9de2f015b HomeKit - Climate: power state on/off support (#14082)
* add power state  support on off
* Added check for current operation mode
* Extended 'set_heat_cool'
* Added tests
2018-05-03 18:22:43 +02:00
giangvo
ef4498ec27 Issue/add template fans (#12027)
* add template fan

* add-template: address PR comments

* add-template: remove unused import

* add-template: revert async_track_state_change change

* add-template: use yield from

* Revert "add-template: use yield from"

This reverts commit 1e053714a7.

* add-template: use yield

* add-template: remove unused import

* add-template: remove async_add_job usages

* use components

* add-template: use async/await

* add-template: fix style

* add-template: remove str()

* address pr comments

* fix style
2018-05-02 17:45:31 -04:00
Diogo Gomes
c851dfa2c7 Restores switch state, case the switch is optimistic (#14151)
* Add restore_state to optimistic switch

* no need to schedule update

* test added

* lint

* new async syntax

* lint
2018-05-02 17:29:07 -04:00
Mark Coombes
64b9fbd8d9 Add prereqs for HomeKit Controller (#14172) 2018-05-02 16:28:43 -04:00
Andrey
f72d568374 Add unique_id to zwave node entity (#14201)
* Add unique_id to zwave node entity

* Wait 30s before adding zwave node if its unique_id is not ready

* Use only node_id in unique_id. Update name, manufacturer, and product attributes on node update.
2018-05-02 16:10:26 -04:00
Per Osbäck
351e8921fa python_openzwave update config service (#12060)
* update python-openzwave to 4.1.0

* add service which updates the configuration files from github

* 0.4.3
2018-05-02 15:06:09 -04:00
Mick Vleeshouwer
b66be59598 Add PostNL sensor (Dutch Postal Services) (#12366)
* Add basic PostNL sensor (WIP)

* Update PostNL sensor

* Bump version

* Small updates to PostNL package based on feedback

* Remove unused import

* Pass api to sensor

* Refactor based on feedback

* Update based on feedback

* Fix feedback

* Clean up

* Bugfiix

* Bugfix

* SCAN_INTERVAL fix

* Remove unused import

* Refactor for new wrapper implementation

* Update postnl package requirement

* Change throttle logic

* Update package version

* Add new line

* Minor changes

* Change refresh time to 30 minutes

* Update requirements_all.txt
2018-05-02 14:37:41 -04:00
Otto Winter
14c7fa8882 WUnderground unique ids (#13311)
* WUnderground unique_id

* Remove async_generate_entity_id

* Lint

* Address comment
2018-05-02 14:23:07 -04:00
Mathieu Velten
ce98dfe395 Add support for tracking devices on Netgear access points (#13331)
* Netgear: add support for tracking devices on access points

* Netgear: add SSL support and autodetection
2018-05-02 09:38:24 -04:00
Anders Melchiorsen
bf056b6f01 Fix Hue color state for missing xy (#14230) 2018-05-02 09:25:08 -04:00
Sebastian Muszynski
8b13658d3b Improve config schema of the blackbird component (#14007)
* Import moved, return values removed and redundant log message removed

* Improve config schema of the blackbird component

* Tests updated

* Handle updated

* Schema fixed
2018-05-02 09:21:50 -04:00
Diogo Gomes
e968b1a0f4 UPnP code cleanup (#14235)
* missing async calls

* lint

* cleanup
2018-05-02 09:15:30 -04:00
Mohamad Tarbin
6453ea4e61 Add Social Blade Sensor (#14060)
* Adding Dominion Energy Sensor

* Update : remove white spacves and set the update time to be daily

* Update : update spacing as per hound suggestions, Move imports

* Update :  Fix  Travis CI build errors

* Update Documentations on method levels

* Update Documentations on method levels

* Update Documentations on method levels

* Add Exception Handeling if login failed, add PLATFORM_SCHEMA

* Add Exception Handeling if login failed, add PLATFORM_SCHEMA

* Add Exception Handeling if login failed, add PLATFORM_SCHEMA

* Update dominionenergy.py

* Adding Selenium to requirements_all.txt

* Checking the username/password while setup

* Checking the username/password while setup

* removing extra white space

* Update : Adding the Platform only if credentials works

* Update : Add PlatformNotReady exception

* Update : Add PlatformNotReady exception

* Update .coveragerc

* Remove change

* Adding USCIS component

* Adding Line after the class DOC

* Update : Extract USCIS logic code to Component

* Update : Extract USCIS logic code to Component

* Adding CURRENT_STATUS

* Change Error handling, remove date from attributes

* Update the Version for USCIS

* Add Social Blade Sensor

* Update class documentation

* Update coverage and requirements_all

* Update : houndci error with intent

* Update : Add coverage

* Update uscis.py

* Add comments

* Add comments

* Delete dominionenergy.py

* Update requirements_all.txt

* Update .coveragerc

* Update .coveragerc

* Update .coveragerc

* Update : update after code review

* Fix remaining issues
2018-05-01 22:27:20 +02:00
Matt Snyder
c2d00be91e Allow independent control of white level on flux_led component (#13985)
* Allow independent control of white level on flux_led component.

Also preserve brightness on color change.

* Limit white value support to RGBW mode.

* Requested changes.

* Correct liniting issues

* Formatting
2018-05-01 15:38:45 -04:00
Otto Winter
e4655a7e63 Add MQTT Sensor device_class (#14033)
* Add MQTT Sensor device_class

* Add test
2018-05-01 15:38:08 -04:00
Aaron Bach
7a05471912 Converts RainMachine to hub model (part 2) (#14225)
* Converts RainMachine to hub model (part 2)

* Small style adjustments for consistency

* Moving MAC calculation to one-time call in component

* Removing unneeded attribute

* Bumping Travis

* Lint
2018-05-01 15:36:43 -04:00
escoand
8d5c3a2b91 add volumio discovery (#14220)
* add volumio discovery

* add missing library

* Update volumio.py
2018-05-01 15:20:38 -04:00
corneyl
2f0fc0934f Buienradar improvements: continuous sensors and unique ID's (#13249)
* Force update continuous sensors when new measurement available.

* Added unique ID's based on coordinates, sensor type and client name.

* Fixed over-indentation (hound review)

* Revert "Added unique ID's based on coordinates, sensor type and client name."

This reverts commit 3345e67a15.

* Fix lint errors.

* Re-added unique ID's based on location.

* Removed wrong error logging.

* Removed creating UUID from unique id

* Lint
2018-05-01 15:06:41 -04:00
Paulus Schoutsen
83d300fd11 Custom component loading cleanup (#14211)
* Clean up custom component loading

* Fix some tests

* Fix some stuff

* Make imports work again

* Fix tests

* Remove debug print

* Lint
2018-05-01 20:57:30 +02:00
Ville Skyttä
5d96751168 panasonic_viera: Provide unique_id from SSDP UDN, if available (#13541) 2018-05-01 14:54:06 -04:00
NovapaX
38560cda1c Allow to set a desired update interval for camera_proxy_stream view (#13350)
* allow to set a desired update interval for camera_proxy_stream view

* lint

* refactor into a seperate method.
Keep the handle_async_mjpeg_stream method to be overridden by platforms
so they can keep proxying the direct streams from the camera

* change descriptions

* consolidate

* lint

* travis

* async/await and force min stream interval for fallback stream.

* guard clause. Let the method raise error on interval.

* is is not =

* what to except when you're excepting

* raise ValueError, remove unnecessary 500 response
2018-05-01 14:49:33 -04:00
blackwind
bf53cbe08d Support setting explicit mute value for Panasonic Viera TV (#13954)
* Use module's methods instead of API calls

* Use module's methods instead of API calls for media commands
2018-05-01 14:41:36 -04:00
Ruben
b00f771541 Add more parameters for DSMR sensor (#13967)
* Add more parameters for DSMR component

* Add suiting icon for power failure

* Add suiting icon for swells & sags

* Fix tab indentation -> spaces

* Fix too long lines (PEP8)
2018-05-01 14:40:48 -04:00
Otto Winter
9bc8f6649b Template Sensor add device_class support (#14034)
* Template Sensor Device Class Support

* Lint

* Add tests
2018-05-01 14:32:44 -04:00
Fabian Affolter
b0cccbfd9f Upgrade mypy to 0.590 (#14207) 2018-05-01 14:14:28 -04:00
Simon Hörrle
e78497789b Change the divisor for total consumption output (#14215)
According to my observations, the "switch_energy" value displayed by Pyfritzhome is the sum of Wh over the last week since measurement.
As a result, the correct divisor for representing output as kWh would be 1000 instead of 10000.
2018-05-01 14:13:35 -04:00
Paulus Schoutsen
d82693b460 Allow easy extension of websocket API (#14186)
* Allow easy extension of websocket API

* Lint

* Move panel test to frontend

* Register websocket commands

* Simplify test

* Lint
2018-05-01 13:35:23 -04:00
Paulus Schoutsen
cdd45e7878 Foundation for users (#13968)
* Add initial user foundation to Home Assistant

* Address comments

* Address comments

* Allow non-ascii passwords

* One more utf-8 hmac compare digest

* Add new line
2018-05-01 18:20:41 +02:00
sander76
b994c10d7f HomematicIP cloud: Add logic to check accesspoint connection state (#14203)
* Add logic to check accesspoint connection state

* lint

* changes as per @balloobs comments.

* pylint fix
2018-05-01 11:01:13 -04:00
Russell Cloran
9d4d1c8233 zha: Clean up binary_sensor listener registration/state updates (#14197)
- Instead of registering listeners in the entity __init__, do it in
   async_added_to_hass to avoid errors updating an entity which isn't fully
   set up yet
 - Change from schedule_update_ha_state to async_schedule_update_ha_state
2018-05-01 08:55:25 -04:00
Diogo Gomes
a4e0c9c251 Fixes #14169 (Upgrade pyupnp-async to 0.1.0.2) (#14210)
* Fixes #14169 (upstream version bump)

* bump pyupnp-async version
2018-05-01 08:51:47 -04:00
Philipp Schmitt
626d6df545 Update CODEOWNERS (#14214) 2018-05-01 10:14:33 +02:00
Paulus Schoutsen
12dff5baa8 Add room hint support to Google Assistant cloud (#14180) 2018-04-30 21:05:29 +02:00
Paulus Schoutsen
d1460de89b Merge pull request #14199 from home-assistant/rc
0.68.1
2018-04-30 14:04:29 -04:00
Paulus Schoutsen
c23cc0e827 Disable eliqonline requirement (#14156)
* Disable eliqonline requirement

* Disable pylint import error
2018-04-30 13:46:47 -04:00
Paulus Schoutsen
c704ceaeb7 Version bump to 0.68.1 2018-04-30 13:37:12 -04:00
Paulus Schoutsen
daeccfe764 Fix poorly formatted automations (#14196) 2018-04-30 13:36:56 -04:00
Otto Winter
7f1b591fbb Improve chromecast disconnection logic (#14190)
* Attempt Cast Fix

* Cleanup
2018-04-30 13:36:55 -04:00
Paulus Schoutsen
aba143ac9f Do not sync entities with an empty name (#14181) 2018-04-30 13:36:55 -04:00
cdce8p
03c34804bc Added CONF_IP_ADDRESS to HomeKit (#14163) 2018-04-30 13:36:54 -04:00
Matthew Garrett
f2a17a5462 Fix Python 3.6 compatibility for HomeKit controller (#14160)
Python 3.6's http client passes an additional argument to _send_output,
so add that to the function definition.
2018-04-30 13:36:54 -04:00
Anders Melchiorsen
b5bae17c66 Revert Hue color state to be xy-based (#14154) 2018-04-30 13:36:54 -04:00
Anders Melchiorsen
52a48b3ac9 Improve precision of Hue color state (#14113) 2018-04-30 13:36:53 -04:00
Anders Melchiorsen
a06f61034c Fix color setting of tplink lights (#14108) 2018-04-30 13:36:53 -04:00
mvn23
6e0a3abf66 Fix TypeError on round(self.humidity) (fixes #13116) (#14174)
* Fix TypeError on round(self.humidity)

Some weather platforms postpone the first data fetch for a while on init. As a result round(self.humidity is called before it is assigned a value, producing an error. This is a fix for that.

* Rewrite to avoid false negative evaluation

As per the suggestion from @OttoWinter, rewrite to avoid matching e.g. 0.0 as false.
2018-04-30 13:27:45 -04:00
Mahesh Subramaniya
eceece866d Updating darksky default update interval to 5 mins (#14195)
With Darksky allowing only 1000 API requests per day, 2 minutes retry seems to be bit closer to running over the limit and actually it did for 5 days in my account. Hence proposing a change to 5 minutes to keep the API happy and also it doesn't hurt to check the weather for every 5 mins than 2 mins someone lives in Jupiter :-P
2018-04-30 11:48:51 -04:00
Paulus Schoutsen
853a16938b Fix poorly formatted automations (#14196) 2018-04-30 09:56:42 -04:00
Paulus Schoutsen
5dcad89a0d Do not sync entities with an empty name (#14181) 2018-04-30 09:18:18 -04:00
cdce8p
46c260fd85 Added CONF_IP_ADDRESS to HomeKit (#14163) 2018-04-30 08:58:17 -04:00
Otto Winter
76c9c0179b Improve chromecast disconnection logic (#14190)
* Attempt Cast Fix

* Cleanup
2018-04-30 08:46:44 -04:00
Fabian Affolter
d7eced95fa Upgrade numpy to 1.14.3 (#14187) 2018-04-30 09:28:00 +02:00
Russell Cloran
02a12a0bb4 zha: Support remotes/buttons (#12528) 2018-04-29 23:31:27 -07:00
Anders Melchiorsen
30d987f59f Revert Hue color state to be xy-based (#14154) 2018-04-30 00:49:19 +02:00
Jens Østergaard Nielsen
aa8bd37143 Added update_interval to maxcube (#14143) 2018-04-29 20:57:57 +02:00
Paulus Schoutsen
4c0024fd97 Another coverage fix 2018-04-29 14:15:39 -04:00
Paulus Schoutsen
74320306a1 Add mitemp_bt to coverage 2018-04-29 14:08:33 -04:00
Hate-Usernames
113bdc493a Allow transitioning to colour temp for tradfri (#14157) 2018-04-29 16:54:44 +01:00
escoand
8e7f500f28 Add precipitation to OpenWeatherMap forecast (#13971)
* add initial precipitation support

* move attr to component

* remove blank line

* add forecast attributes to platform and update demo

* add tests

* break long lines

* calc lower temp correctly

* move all new attributes to component

* convert temp low only when existing
2018-04-29 17:50:49 +02:00
Fabian Affolter
d352dee9b7 Upgrade netdisco to 1.4.0 (#14152) 2018-04-29 16:21:46 +02:00
Kane610
3fd4987baf deCONZ allow unloading of config entry (#14115)
* Working but incomplete

* Remove events on unload

* Add unload test

* Fix failing sensor test

* Improve unload test

* Move DeconzEvent to init

* Fix visual under-indentation
2018-04-29 10:16:20 -04:00
Matthew Garrett
ef48a7ca2c Fix Python 3.6 compatibility for HomeKit controller (#14160)
Python 3.6's http client passes an additional argument to _send_output,
so add that to the function definition.
2018-04-29 09:46:36 +02:00
Paulus Schoutsen
fd038b6de9 Disable eliqonline requirement (#14156)
* Disable eliqonline requirement

* Disable pylint import error
2018-04-28 20:15:00 -04:00
Otto Winter
a4bf421044 Convert more files to async/await syntax (#14142)
* Move more files to async/await syntax

* Attempt Work around pylint bug

Using lazytox :P
2018-04-28 19:26:20 -04:00
Otto Winter
a0b14c2913 Light mqtt_json: Add HS color support (#14029)
* Light mqtt_json HS color support

* Lint

* Catch float ValueError
2018-04-29 00:33:10 +02:00
engrbm87
44ddc6ba62 deluge-components-update (#14016) 2018-04-29 00:16:22 +02:00
Gabe
07f94eaa92 Fixed datetime values (#14153) 2018-04-29 00:12:40 +02:00
Fabian Affolter
4205dc0f7c Upgrade psutil to 5.4.5 (#14135) 2018-04-28 23:17:38 +02:00
Matt Schmitt
2091f86e25 Clean up HomeKit accessory information characteristics (#14114)
* Update accessory information characteristics
* Add firmware revision characteristic
2018-04-28 23:17:30 +02:00
Fabian Affolter
84f163252a Upgrade youtube_dl to 2018.04.25 (#14136) 2018-04-28 23:17:10 +02:00
Fabian Affolter
9a9161477f Upgrade python-telegram-bot to 10.0.2 (#14144) 2018-04-28 23:16:51 +02:00
Fabian Affolter
449085313b Upgrade tapsaff to 0.2.0 (#14137) 2018-04-28 23:16:34 +02:00
Fabian Affolter
95f2ad2299 Upgrade sqlalchemy to 1.2.7 (#14138) 2018-04-28 23:16:01 +02:00
Fabian Affolter
7bdd4dd960 Upgrade pylast to 2.2.0 (#14139) 2018-04-28 23:15:32 +02:00
Anders Melchiorsen
e6d4501ee3 Fix color setting of tplink lights (#14108) 2018-04-28 17:12:11 -04:00
Paulus Schoutsen
93fe61bf13 System log: make firing event optional (#14102)
* Syste log: make firing event optional

* Add test

* Lint

* Doc string
2018-04-28 17:09:38 -04:00
Charles Garwood
b352b761f3 Bump pyvizio to 0.0.3 (#14147)
* Bumping pyvizio version

* Bump pyvizio version
2018-04-28 21:05:27 +02:00
Marcus
8d87b9fed5 Logitech Pop support for emulated_hue component (#12833)
* Update hue_api.py

add dummy group handler for logitech-pop

* Update __init__.py

add HueGroupView for logitech pop

* Update __init__.py

removed whitespace on blankline

* fix line limit and space

* fix indents

* fix more docstring and formatting issues.

* fix more whitespace issues

* Fix pylint issue
2018-04-28 20:39:21 +02:00
Fabian Affolter
ea5c336ab4 Upgrade restrictedpython to 4.0b3 (#14140) 2018-04-28 19:21:37 +02:00
Maciej Bieniek
c78e8eb578 Add support for light sensors with 'lx' unit to HomeKit (#14131)
* add support for light sensors with lx unit

* add test for light sensor with 'lx' unit
2018-04-28 17:14:34 +02:00
Aaron Bach
8bc497ba1d Move RainMachine to component/hub model (#14085)
* Moves RainMachine to component/hub model

* Updated requirements

* Updated coverage

* Hound violations

* Collaborator-requested changes

* Small formatting updates

* Removed references to remote API

* Collaborator-requested changes

* Collaborator-requested changes

* Fixed attribution
2018-04-28 15:46:58 +02:00
Fabian Affolter
1d41321f8f Upgrade colorlog to 3.1.4 (#14132) 2018-04-28 14:03:09 +02:00
ratcash
00706ad90c Support Xiaomi Mijia Bluetooth Wireless Temperature and Humidity Sensor (#13955) 2018-04-28 13:35:51 +02:00
Colin O'Dell
2749ca4ef4 Update QNAP lib to 0.2.6; handle null temps gracefully (#14117)
There's one particular QNAP model which sometimes return empty/null temperatures
for certain disks. This commit ensures that this model can be integrated with HASS
without causing KeyErrors or other exceptions - if this edge case is hit, the
sensor will simply show `0` instead.
2018-04-28 12:39:45 +02:00
Sebastian Muszynski
58ae8d91f9 Fix the optional friendly name of the Yeelight (Closes: #14088) (#14110) 2018-04-28 12:35:19 +02:00
Paulus Schoutsen
9d34e8c266 Merge pull request #14124 from home-assistant/rc
0.68
2018-04-27 21:44:39 -04:00
Matthew Garrett
7da1d75707 Change Eufy brightness handling (#14111)
Eufy device state isn't reported if the bulb is off, so avoid stamping on
the previous values if the bulb isn't going to give us useful information.
In addition, improve handling of bulb turn on if we aren't provided with a
brightness - this should avoid the bulb tending to end up with a brightness of
1 after power cycling.
2018-04-27 16:41:06 -04:00
Matthew Garrett
7e39a5c4d5 Change Eufy brightness handling (#14111)
Eufy device state isn't reported if the bulb is off, so avoid stamping on
the previous values if the bulb isn't going to give us useful information.
In addition, improve handling of bulb turn on if we aren't provided with a
brightness - this should avoid the bulb tending to end up with a brightness of
1 after power cycling.
2018-04-27 16:39:06 -04:00
Paulus Schoutsen
9fb2bf72f9 Version bump to 0.68.0 2018-04-27 15:35:20 -04:00
GotoCode
c42c668815 Updated list of AWS regions for Amazon Polly (#14097)
Fixes #14052
2018-04-27 15:34:57 -04:00
Daniel Høyer Iversen
9d0251cfeb Fix timezone issue when calculating min/max values in tibber #14009 (#14080)
* fix timezone issue in tibber #14009

* remove debug print
2018-04-27 15:34:57 -04:00
Daniel Høyer Iversen
403a546bdc Upgrade broadlink lib (#14074) 2018-04-27 15:34:57 -04:00
Anders Melchiorsen
0b350993b5 Improve precision of Hue color state (#14113) 2018-04-27 13:18:58 +02:00
Otto Winter
9d1f9fe204 Improve MQTT topic validation (#14099)
* Improve MQTT topic validation

* Fix test

* Improve length check
2018-04-27 13:15:45 +02:00
Kane610
4b06392442 Zone component config entry support (#14059)
* Initial commit

* Add error handling to config flow
Change unique identifyer to name
Clean up hound comments

* Ensure hass home zone is created with correct entity id
Fix failing tests

* Fix rest of tests

* Move zone tests to zone folder
Create config flow tests

* Add possibility to unload entry

* Use hass.data instead of globas

* Don't calculate configures zones every loop iteration

* No need to know about home zone during setup of entry

* Only use name as title

* Don't cache hass home zone

* Add new tests for setup and setup entry

* Break out functionality from init to zone.py

* Make hass home zone be created directly

* Make sure that config flow doesn't override hass home zone

* A newline was missing in const

* Configured zones shall not be imported
Removed config flow import functionality
Improved tests
2018-04-26 17:59:22 -04:00
Paulus Schoutsen
833508fbbb Version bump to 0.68.0b2 2018-04-26 16:39:42 -04:00
Paulus Schoutsen
1b71ce32e4 Bump frontend to 20180426 2018-04-26 16:39:27 -04:00
Paulus Schoutsen
f5de2b9e5b Bump frontend to 20180426 2018-04-26 16:39:14 -04:00
Robin
3e18078700 Adds update file_path service to local_file camera (#13976)
* WIP: Add update_file service to local_file camera

* Add event on update

* Update local_file.py

* Update services.yaml

* Fix indent

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update local_file.py

* Update test_local_file.py

* Update local_file.py

* Adds file_path to device_state_attributes

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update local_file.py

* Update test_local_file.py

* fixed test_update_file_path

* Update local_file.py

* Update test_local_file.py

* Update test_local_file.py

* Update services.yaml

* Update local_file.py

* Update local_file.py

* Update test_local_file.py

* Update local_file.py
2018-04-26 15:01:58 -04:00
GotoCode
ff7b51259e Updated list of AWS regions for Amazon Polly (#14097)
Fixes #14052
2018-04-26 19:35:28 +02:00
Daniel Perna
47e143d5a1 Update pyhomematic to 0.1.42 (#14095)
* Updated pyhomematic to 0.1.42

* Updated pyhomematic to 0.1.42
2018-04-26 19:30:28 +02:00
Daniel Høyer Iversen
d7f7735490 Fix timezone issue when calculating min/max values in tibber #14009 (#14080)
* fix timezone issue in tibber #14009

* remove debug print
2018-04-26 09:49:35 +02:00
Mattias Welponer
8c2dedab52 Re-implement HomematicIP cloud to async (#13468)
* Recode to async version of homematicip-rest-api

* Remove blank line

* Cleanup of access point status class

* Fix to loong line

* Fix import errors

* Bugfix missing wait the _retry_task for sleep command

* Update comment

* Updates after review

* Small updates of logging and property name

* Fix DOMAIN and revert back to lowercase snakecase strings

* Fix intention and tripple double quotes

* Fix travis build

* Remove unnecessary state attributes

* Fix optional name in configuration

* Further reduction of state attributes
2018-04-25 15:57:44 -04:00
Anders Melchiorsen
241a0793bb Add Sonos device attribute with grouping information (#13553) 2018-04-25 20:31:42 +02:00
c727
a94864c86f Modify weather components for "new" frontend card (#14076)
* Enable weather condition for all forecasts (OWM)

* Remove entity_picture from BR

* Remove summary texts from Dark Sky

* Update test_darksky.py
2018-04-25 12:37:57 +02:00
Mitko Masarliev
f23f9465d3 New sensor domain expiry (#14067)
* domain expiry

* domain expiry

* domain expiry

* scan interval

* change host to domain
2018-04-25 12:33:47 +02:00
Thijs de Jong
558b659f7c Add devices to Tahoma (#14075) 2018-04-25 07:09:45 +02:00
Kerwin Bryant
0a0d34d394 Support new Xiaomi Aqara device model names and LAN protocol 2.0 (#13540) 2018-04-25 07:05:00 +02:00
Paulus Schoutsen
c49751542f Version bump to 0.68.0b1 2018-04-24 23:19:33 -04:00
Mark Coombes
2e3a27e418 Update device classes for contact sensor HomeKit (#14051) 2018-04-24 23:19:16 -04:00
Matthew Garrett
7566bb5aed Handle HomeKit configuration failure more cleanly (#14041)
* Handle HomeKit configuration failure more cleanly

Add support for handling cases where HomeKit configuration fails, and give
the user more information about what to do.

* Don't consume the exception for a homekit.UnknownError

If we get an UnknownError then we should alert the user but also still
generate the backtrace so there's actually something for them to file in
a bug report.
2018-04-24 23:19:16 -04:00
Otto Winter
fc1f6ee0f0 Revert cast platform polling mode (#14027) 2018-04-24 23:19:16 -04:00
Matt Schmitt
cb839eff0f HomeKit Alarm Control Panel Code Exception Fix (#14025)
* Catch exception for KeyError
* Use get and added test
2018-04-24 23:19:15 -04:00
Paulus Schoutsen
2bc87bfcf0 Order the output of the automation editor (#14019)
* Order the output of the automation editor

* Lint
2018-04-24 23:19:15 -04:00
Johann Kellerman
44be80145b Qwikswitch binary sensors (#14008) 2018-04-24 23:19:15 -04:00
Paulus Schoutsen
8cb1e17ad8 Bump frontend to 20180425.0 2018-04-24 23:18:46 -04:00
Paulus Schoutsen
75fffb6a86 Bump frontend to 20180425.0 2018-04-24 23:18:28 -04:00
stephanerosi
4e97954bbe Remove excessive debugging in webostv module (#14056) 2018-04-24 22:45:57 -04:00
Daniel Høyer Iversen
18137733f9 Upgrade broadlink lib (#14074) 2018-04-24 22:45:16 -04:00
thelittlefireman
ca29224846 Bump locationsharinglib to 1.2.2 (#14070)
* Bump locationsharinglib to 1.2.2

* Bump locationsharinglib to 1.2.2
2018-04-24 18:46:17 +02:00
John Mihalic
31554e8368 Bump pyEight version to update API & reduce connection issues (#14058) 2018-04-23 22:43:59 +02:00
Paulus Schoutsen
5ed73fecd3 Order the output of the automation editor (#14019)
* Order the output of the automation editor

* Lint
2018-04-23 13:47:06 -04:00
Kane610
8a10fcd985 deCONZ use forward entry setup (#13990)
* Use forward entry setup with light platform

* Move sensor to forward entry setup

* Use forward entry setup with binary sensors

* Use forward entry setup with scene platform

* Remove import of unused functionality

* Move deconz setup in to setup entry
Create initial negative tests for setup entry

* Fix hound comment

* Improved tests

* Add test for scene platform

* Add test for binary sensor platform

* Add test for light platform

* Add test for light platform

* Add test for sensor platform

* Fix hound comment

* More asserts on sensor types
2018-04-23 12:00:16 -04:00
Mark Coombes
5fe4053021 Update device classes for contact sensor HomeKit (#14051) 2018-04-23 13:52:39 +02:00
Matthew Garrett
e4cb3af76d Handle HomeKit configuration failure more cleanly (#14041)
* Handle HomeKit configuration failure more cleanly

Add support for handling cases where HomeKit configuration fails, and give
the user more information about what to do.

* Don't consume the exception for a homekit.UnknownError

If we get an UnknownError then we should alert the user but also still
generate the backtrace so there's actually something for them to file in
a bug report.
2018-04-22 16:38:01 -04:00
Otto Winter
7f634c6ed0 Revert cast platform polling mode (#14027) 2018-04-22 16:32:15 -04:00
Paulus Schoutsen
5d3471269a Show a notification when a config entry is discovered (#14022)
* Show a notification when a config entry is discovered

* update comment

* Inline functions

* Lint
2018-04-22 21:00:24 +02:00
Stijn Tintel
1fbc650871 device_tracker.ubus: catch ConnectionError (#14045)
When an OpenWrt device monitored via ubus is offline, this causes the
log to be flooded with several exceptions. Avoid this by catching
requests.exceptions.ConnectionError in addition to
requests.exceptions.Timeout.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2018-04-22 12:55:45 +02:00
David Broadfoot
86374ad809 bump gogogate2 version (#14044)
* bump gogogate2 version

* Update - requirements_all
2018-04-22 12:54:48 +02:00
Ryan Bahm
c2bee496e2 Add Accuracy to Google Location Sharing (#14039)
* Update locationsharinglib to 1.2.1 and add accuracy.

* Change indents to match HA style
2018-04-22 08:42:18 +02:00
Matt Schmitt
51f55bddb7 HomeKit Alarm Control Panel Code Exception Fix (#14025)
* Catch exception for KeyError
* Use get and added test
2018-04-21 16:16:46 +02:00
Daniel Høyer Iversen
4c23a61853 upgrade rfxtrx lib, dimming support for Lighting3 (#14026) 2018-04-21 10:54:11 +02:00
Jon Maddox
f12ff6f297 Expose the condition code on condition sensors (#14011)
* expose the condition code on condition sensors

* 💄

* like thisss duh

* add test for condition_code

* It’s a string
2018-04-21 10:20:33 +02:00
Aaron Bach
cb490780c9 Pollen.com: Added attributes on top 3 allergens (#14018) 2018-04-21 10:16:52 +02:00
Johann Kellerman
6ccb83584e Qwikswitch binary sensors (#14008) 2018-04-21 08:34:42 +02:00
Paulus Schoutsen
2b53729708 Version bump to 0.68.0b0 2018-04-20 10:58:43 -04:00
Paulus Schoutsen
a566804f7f Merge branch 'dev' into rc 2018-04-20 10:58:25 -04:00
Paulus Schoutsen
2a5fac3b9d Add sensor device classes (#14010) 2018-04-20 15:38:27 +02:00
Rohan Kapoor
8459b241a2 Upgrade pylutron-caseta to 0.5.0 to reestablish connections (#14013)
* Upgrade pylutron-caseta to 0.5.0 to reestablish connections

* Upgrade pylutron-caseta to 0.5.0 in requirements_all.txt
2018-04-20 15:35:56 +02:00
Daniel Høyer Iversen
825f94f47f Tibber available (#13865)
* Tibber available

* Tibber available

* Tibber

* Tibber
2018-04-20 11:45:11 +02:00
Sebastian Muszynski
8ef2abfca7 Log an error instead of raising an exception (#14006) 2018-04-20 08:45:28 +02:00
ChristianKuehnel
2372419d42 Upgraded miflora library to version 0.4.0 (#14005) 2018-04-20 08:43:44 +02:00
Paulus Schoutsen
27f3081b74 Update frontend to 20180420.0 2018-04-19 22:16:48 -04:00
Paulus Schoutsen
13e72f48a8 Disable ebox requirement (#14003)
* Disable ebox requirement

* Lint
2018-04-19 14:06:49 -04:00
Pascal Hahn
9fcbe68fac Add Homematic HmIP-SWO-PR weather sensor support (#13904) 2018-04-19 12:48:21 +02:00
Sebastian Muszynski
0999129f48 Useless code removed (#13996) 2018-04-19 11:42:40 +02:00
Viorel Stirbu
3180c8b0fb Add support for Sensirion SHT31 temperature/humidity sensor (#12952) 2018-04-19 11:37:30 +02:00
koolsb
37cd63ea5a Add blackbird media player component (#13549) 2018-04-19 11:35:38 +02:00
koolsb
3dc70436f1 Add additional receiver for Onkyo zone 2 (#13551) 2018-04-19 11:31:50 +02:00
Sebastian Muszynski
674682e88f Support for multiple MAX!Cube LAN gateways added (#13517) 2018-04-19 09:11:38 +02:00
thelittlefireman
ba7fccba34 Bump locationsharinglib to 1.2.1 (#13980)
* Bump locationsharinglib to 1.2.1

*  Bump locationsharinglib to 1.2.1
2018-04-18 15:59:48 -04:00
Adam Mills
ccba858ae1 Fix for Lokalise backend misinterpretation of keys (#13986)
The Lokalise server has a bug that the internal portion of key
references was misinterpreted as a symfony key, and was getting auto
converted by the convert placeholders feature. Since we don't use this
we're turning it off to work around the bug.
2018-04-18 15:58:47 -04:00
Paulus Schoutsen
b0a3d084fb Version bump to 20180418.0 2018-04-18 15:58:14 -04:00
NovapaX
45eb611007 renaming icons (#13982)
* renaming icons

* remove mdi:robot-vacuum

* fix other vacuums
2018-04-18 15:46:44 -04:00
Michael Wei
0eb3e49880 Alexa thermostat fails to properly parse 'value' field for climate (#13958)
* Fix thermostat payload issue

* fix test payload

* style issue

* handle both string and value object
2018-04-18 14:19:05 -04:00
Kane610
c5cb28d41f deCONZ migrate setup fully to config entry (#13679)
* Initial working config entry with discovery

* No need for else

* Make sure that imported config doesnt exist as a config entry

* Improve checks to make sure there is only instance of deconz

* Fix tests and add new tests

* Follow upstream changes
Fix case when discovery started ongoing config entry and user completes setup  from other path it was possible to complete discovered config entry as well

* Add test to make sure link doesn't bypass any check for only allowing one config entry

* Dont use len to determine an empty sequence

* Cleanup

* Allways get bridgeid to use as unique identifier for bridge
2018-04-18 10:27:44 -04:00
Ben Randall
7d43ad6a37 Colorlog windows fix (#13929)
* Fix colorlog on windows

Modified the way logging is initialized to fix two things.
1. If the import of `colorlog` fails the logs will still be formatted
   using the expected HASS log format.
2. Ensure that `logging.basicConfig` is called AFTER `colorlog` is
   imported so that the default handler generated will be writing to the
   wrapped stream generated when `colorama` is initialized.  This allows
   colored logging to work on Windows.

Added support for a `--log-no-color` command line switch in the event
that someone just wants to disable colored log output entirely.

* Fix line lengths

* Switch default value
2018-04-18 10:18:44 -04:00
Nick Whyte
b589dbf26c Support basic covers with open/close/stop services HomeKit (#13819)
* Support basic covers with open/close/stop services
* Support optional stop
* Tests
2018-04-18 14:39:58 +02:00
Sebastian Muszynski
23b97b9105 Params of the send command can be a list now (#13905) 2018-04-18 14:38:44 +02:00
stephanerosi
f11d4319d2 Fix typo an coding style (#13970) 2018-04-18 12:43:55 +02:00
Mister Wil
4ba58d0760 Bump skybellpy version to 0.1.2 (#13974) 2018-04-18 10:10:32 +02:00
Paulus Schoutsen
2cb9e2dc7c Merge pull request #13975 from home-assistant/rc
0.67.1
2018-04-17 23:19:45 -04:00
Paulus Schoutsen
c076dbe7e4 Revert "Upgrade pyqwikswitch to 0.71 (#13920)"
This reverts commit 6fa60c464b.
2018-04-17 22:59:36 -04:00
Paulus Schoutsen
e7aea5c571 Version bump to 0.67.1 2018-04-17 22:37:40 -04:00
Aaron Bach
24ec8c545b Bumped pypollencom to 1.1.2 (#13959)
* Bumped pypollencom to 1.1.2

* Updated requirements_all.txt
2018-04-17 22:37:25 -04:00
Thibault Cohen
6c456ade6a Update pyfido to 2.1.1 (#13947) 2018-04-17 22:37:24 -04:00
Thibault Cohen
e9b997de3e Update pyhydroquebec to 2.2.2 (#13946) 2018-04-17 22:37:24 -04:00
Paulus Schoutsen
53506821d4 Upgrade somecomfort to 0.5.2 (#13940) 2018-04-17 22:37:23 -04:00
Johann Kellerman
6fa60c464b Upgrade pyqwikswitch to 0.71 (#13920) 2018-04-17 22:36:07 -04:00
Sebastian Muszynski
fadff1855f Import operation modes from air humidifier (#13908) 2018-04-17 22:34:40 -04:00
Daniel Høyer Iversen
652063537b Fix call to parent broadlink switch (#13906)
* Broadlink switch, fixes issue #13799

* slugify
2018-04-17 22:34:40 -04:00
Sebastian Muszynski
bcd8a69dfc Missing property decorator added (#13889) 2018-04-17 22:34:40 -04:00
Paulus Schoutsen
663aeb11dc Fix race condition for component loaded before listening (#13887)
* Fix race condition for component loaded before listening

* async/await syntax
2018-04-17 22:34:39 -04:00
Kyle Niewiada
727ab956cf Fix #13846 Double underscore in bluetooth address (#13884) 2018-04-17 22:34:39 -04:00
Paulus Schoutsen
26c76e3399 Prevent vesync doing I/O in event loop (#13862) 2018-04-17 22:34:39 -04:00
Kane610
0adb240fd6 Fix so it is possible to ignore discovered config entry handlers (#13741)
* Fix so it is possible to ignore discovered config entry handlers

* Improve efficiency
2018-04-17 22:34:38 -04:00
David Broadfoot
e836674a30 Fix Gogogate2 'available' attribute (#13728)
* Fixed bug -  unable to set base readaonly property

* PR fixes

* Added line
2018-04-17 22:34:38 -04:00
Aaron Bach
65b8f9764a Bumped pypollencom to 1.1.2 (#13959)
* Bumped pypollencom to 1.1.2

* Updated requirements_all.txt
2018-04-17 20:03:22 +02:00
Kane610
1a9ea11665 Bump deCONZ requirement to v36 (#13960) 2018-04-17 20:00:53 +02:00
Daniel Høyer Iversen
08f545d67b Fix call to parent broadlink switch (#13906)
* Broadlink switch, fixes issue #13799

* slugify
2018-04-17 17:40:52 +02:00
ChristianKuehnel
e472436b84 Add services for bmw_connected_drive (#13497)
* implemented services for bmw remote services

* added vin to attributes of tracker
* moved component to new package
* added service description

* fixed static analysis warnings

* implemented first set of code reviews

* removed locking related services

* fixed static analysis warnings

* removed excess blank lines

* refactoring of setup() to resolve warning
"Cell variable bimmer defined in loop (cell-var-from-loop)"

* added missing docstring

* added service to update all vehicles from the server

* implemented changes requested in code review

* added check if invalid vin is entered
2018-04-17 17:37:00 +02:00
Paulus Schoutsen
783e9a5f8c Update frontend to 20180417 2018-04-17 10:17:58 -04:00
Tod Schmidt
f4b1a8e42d Added web view for TTS to get url (#13882)
* Added web view for to get url

* Added web view for TTS to get url

* Added web view for TTS to get url

* Added web view for TTS to get url

* Fixed test

* added auth

* Update __init__.py
2018-04-17 15:24:54 +02:00
Dmitry Avramenko
3b44f91395 Added FB messenger broadcast api to notify.facebook component (#12459)
* Added ability to use FB messenger broadcast api. use 'BROADCAST' keyword for first target in the facebook notifiy component to enable.

* Added ability to use FB messenger broadcast api. use 'BROADCAST' keyword for first target in the facebook notifiy component to enable.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Added ability for broadcast messaging for facebook messenger notify platform.

* Update facebook.py

* Update facebook.py

* Update facebook.py

* Update facebook.py
2018-04-17 14:23:41 +02:00
Fabian Affolter
cff3bed1f0 Upgrade youtube_dl to 2018.04.16 (#13937) 2018-04-17 13:32:44 +02:00
Fabian Affolter
9fe43714c6 Upgrade aiohttp to 3.1.3 (#13938) 2018-04-17 13:32:16 +02:00
Robin
569f5c111f Adds SigFox sensor (#13731)
* Create sigfox.py

* Create test_sigfox.py

* Update .coveragerc

* Fix lints

* Fix logger message string

* More lints

* Address reviewer comments

* edit exception handling

* Update sigfox.py

* Update sigfox.py

* Update sigfox.py

* Update sigfox.py
2018-04-17 13:08:32 +02:00
Heiko Thiery
9487bd455a Add AVM fritzbox smarthome component (#10688)
* initial commit

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix failed flake8 tests

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add fritzhome files to .coveragerc

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix wrong module import

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove too general exception

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* incorporate review comments

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove blank line

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix wrong import

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix issue with operations

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* incorporate review comments

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove unused attributes

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* adapt to supported_features

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* change checking of kwargs to canonical way

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove unused self._state

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Don't overwrite the platform domain

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Remove parenthesis from import without line break

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Do not pass hass to the components on init

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Remove check for available in current_operation

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Remove redundant logging message

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Add blank line between standard and hass imports

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Use states from base climate component

Also add the new state STATE_MANUAL to the base.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add reconnect when access failed

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add device specific attributes

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* group the imports from the same module

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* change domain data to fritz instance

This let us use the fritz instance to reconnect from platform without accessing
protected attributes.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix typo

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* rename platform from fritzhome to fritzbox

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Add device_state_attributes

Add attributes to have compatiblity to fritzdect.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add support for multiple fritzboxes

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix pylint issues

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fixed pyfritzhome version

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix import

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix component name in requirements_all.txt

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* upgrade pyfritzhome to 0.3.7

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* rename platform/component also in .coveragerc

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* use DEFAULT_HOST when no host is in dict

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add config schema for dict

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove check

The check since since the config scheme takes case.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add check for empty devices

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* use standard attribute from base class

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove STATE_MANUAL from operation list

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove set DEFAULT_HOST

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* don't pass hass to the SwitchDevice

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove unsed DEFAULT_HOST

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* refactored device attributes

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add info output if no fritzbox is configured

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* small fixes according review comment

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove unneeded default value

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove non required code from try..except block

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* line break for line that is too long

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove too many empty lines

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2018-04-17 12:40:36 +02:00
karlkar
f2d4dd25f0 Update of python-mpd2 (#13921) 2018-04-17 11:55:35 +02:00
stephanerosi
998d8c1771 Implement play media to set a channel based on (by priority): (#13934)
- exact channel number
 - exact channel name
 - similar channel name temp
2018-04-17 11:50:26 +02:00
Sebastian Muszynski
add0afe31a Xiaomi MiIO Device Tracker: Unused variable removed (#13948)
* Unused variable removed and pinning added to be in sync with all xiaomi_miio components

* requirements_all.txt updated
2018-04-17 11:45:19 +02:00
Paulus Schoutsen
534aa0e4b5 Add data entry flow helper (#13935)
* Extract data entry flows HTTP views into helper

* Remove use of domain

* Lint

* Fix tests

* Update doc
2018-04-17 11:44:32 +02:00
Paulus Schoutsen
6e9669c18d Upgrade somecomfort to 0.5.2 (#13940) 2018-04-17 05:24:20 +02:00
Diogo Gomes
8fdeebc50d Cleanup on exit (#13918)
* Cleanup on exit

* lint

* version bump

* pymediaroom version bump

* address @kellerza comment

* avoid None in the _name
2018-04-16 22:21:39 -04:00
Thibault Cohen
d0d61d1b5f Update pyfido to 2.1.1 (#13947) 2018-04-16 22:16:28 -04:00
Fabian Affolter
e8ad36feb6 Upgrade alpha_vantage to 2.0.0 (#13943) 2018-04-16 22:16:12 -04:00
Thibault Cohen
9da239178c Update pyhydroquebec to 2.2.2 (#13946) 2018-04-17 02:52:56 +02:00
Fabien Piuzzi
acdba7a27c Updated foobot_async package version (#13942)
Fix #13886
2018-04-16 21:35:24 +02:00
Khole
e0c5b44994 Hive R3 update (#13357)
* Rebase

* Update version number to 0.2.14

* Remove Blank Line

* Added period to docstring

* Update Tox Fix

* Removed Lines
2018-04-16 21:00:13 +02:00
Lincoln Kirchoff
595600dea5 Add support for new platform: climate.modbus (#12224)
* Added support for a new platform: climate.modbus

* Made changes based on code review.

* Made changes based on code review

* Made changes that were recommended in the pull request review.

* Fixed spacing line 144

* Added docstrings for the added helper functions.

* Fixed set_temperature() function to use a variable local to the function for the target temp.

* Fixed lint formatting error

* Modified logic when checking the target temperature, as well as fixing the setup_platform function
2018-04-16 20:31:25 +02:00
Paxy
ad212d8dd4 Broadlink Sensor - switch to connection-less mode (#13761)
* Broadlink Sensor - switch to connection-less mode

Solved the issue with broadlink sensor that occurs when short connection loss with RM2/3 is present on poor WiFi networks.

* Update broadlink.py

* Update broadlink.py

* Update broadlink.py

* Update broadlink.py

* Update broadlink.py

* Update broadlink.py

* Update broadlink.py
2018-04-16 12:06:41 +02:00
Marco
86709427b6 Fixed Capsman data not being used (#13917) 2018-04-16 09:54:57 +02:00
stephanerosi
36a663adeb Add extra attributes for device scanner, Nmap and Unifi (IP, SSID, etc.) (#13673)
* Start of development

* Add extra attributes from unifi scanner

* Store IP of the device in the state attributes with nmap

* Allow not defining get_extra_attributes method in derived classes
2018-04-16 08:20:58 +02:00
Johann Kellerman
517fb2e983 Upgrade pyqwikswitch to 0.71 (#13920) 2018-04-15 22:19:15 +02:00
Benedict Aas
9677bc081e Add more math functions to templates (#13915)
We make `sin`, `cos`, `tan`, and `sqrt` functions, and the `pi`, `tau`,
and `e` constants available in templates.
2018-04-15 18:51:45 +02:00
Josh Anderson
c69f37500a Restore typeerror check for units sans energy tracking (#13824) 2018-04-15 15:25:30 +02:00
escoand
cd8935cbd2 Fritzbox netmonitor name (#13903)
* Addd name to netmonitor

* import conf_name
2018-04-15 15:20:37 +02:00
Sebastian Muszynski
2f26b0084f Import operation modes from air humidifier (#13908) 2018-04-15 15:19:28 +02:00
Kyle Niewiada
2bff03836b Fix #13846 Double underscore in bluetooth address (#13884) 2018-04-15 13:59:10 +02:00
Matthew Garrett
390086bb7e Eufy colour bulb updates (#13895)
* Fix up Eufy handling of colour lights

The Eufy colour lights have separate colour and temperature modes, and give
much less light output when in colour mode. Brightness is also handled in
a slightly confusing way, which means that state must be maintained in
order to avoid switching the light between modes by accident. Add some
additional handling for that.

* Bump the lakeside version

This version has important bugfixes for colour bulbs.

* Hound fixes
2018-04-15 09:54:02 +02:00
Pascal Vizeli
c018071218 Revert "Update yweather.py" (#13900)
* Revert "Add unique_id for BMW ConnectedDrive (#13888)"

This reverts commit 9014e26845.

* Revert "Added snips service descriptions (#13883)"

This reverts commit 1c4da0c4a6.

* Revert "Fix race condition for component loaded before listening (#13887)"

This reverts commit bba997e484.

* Revert "Missing property decorator added (#13889)"

This reverts commit bf98b793c5.

* Revert "Update frontend to 20180414.0"

This reverts commit 1617fbea4c.

* Revert "Further untangle data entry flow (#13855)"

This reverts commit 4d44c0feff.

* Revert "add support for Kodi discovery (#13790)"

This reverts commit 5a5dad689b.

* Revert "Update yweather.py (#13851)"

This reverts commit c3388d63a1.
2018-04-15 09:50:44 +02:00
Gerard
9014e26845 Add unique_id for BMW ConnectedDrive (#13888)
* Add unique_id for BMW ConnectedDrive

* Changed some comments
2018-04-15 05:15:52 +02:00
Tod Schmidt
1c4da0c4a6 Added snips service descriptions (#13883)
* Added snips service descriptions.

* Added snips service descriptions.
2018-04-15 00:07:55 +02:00
Paulus Schoutsen
bba997e484 Fix race condition for component loaded before listening (#13887)
* Fix race condition for component loaded before listening

* async/await syntax
2018-04-14 17:58:45 -04:00
Sebastian Muszynski
bf98b793c5 Missing property decorator added (#13889) 2018-04-14 23:53:35 +02:00
Paulus Schoutsen
1617fbea4c Update frontend to 20180414.0 2018-04-14 14:41:21 -04:00
Paulus Schoutsen
4d44c0feff Further untangle data entry flow (#13855)
* Further untangle data entry flow

* Fix test

* Remove helper class
2018-04-14 14:38:24 -04:00
escoand
5a5dad689b add support for Kodi discovery (#13790)
* add support for Kodi discovery

* remove "too many blank lines"

* register service only once

* optimize "workflow"
2018-04-14 08:31:12 -04:00
TheCellMC
c3388d63a1 Update yweather.py (#13851)
* Update yweather.py

* Update yweather.py

* Update yweather.py

* Update yweather.py
2018-04-14 10:32:44 +02:00
Paulus Schoutsen
ee6acadae2 Prevent vesync doing I/O in event loop (#13862) 2018-04-14 10:31:03 +02:00
dersger
80a3220b88 Avoid unnecessary cast state updates (#13770)
* Avoid unnecessary cast state updates

* Add test

* Fixed bad syntax

* Fixed imports

* Fixed test
2018-04-13 22:22:02 -04:00
Mohamad Tarbin
99ded8a0a6 Adding USCIS component (#13764)
* Adding USCIS component

* Adding Line after the class DOC

* Update : Extract USCIS logic code to Component

* Update : Extract USCIS logic code to Component

* Adding CURRENT_STATUS

* Change Error handling, remove date from attributes

* Update the Version for USCIS

* Update uscis.py
2018-04-13 21:54:23 -04:00
geekofweek
c6c166645d bump python-ecobee-api version to 0.0.18 (#13854)
* bump python-ecobee-api version to 0.0.18

* Update requirements_all.txt
2018-04-13 21:36:46 -04:00
Paulus Schoutsen
0daf38d18c Version bump to 0.68.0.dev0 2018-04-13 18:02:51 -04:00
Paulus Schoutsen
5ec30ce1e6 Merge branch 'master' into dev 2018-04-13 18:02:15 -04:00
Paulus Schoutsen
fb91b05051 Merge pull request #13856 from home-assistant/rc
0.67.0
2018-04-13 17:59:39 -04:00
Paulus Schoutsen
c36c2be372 Version bump to 0.67.0 2018-04-13 16:52:50 -04:00
Paulus Schoutsen
598f093bf0 Add authentication to error log endpoint (#13836) 2018-04-13 16:52:22 -04:00
stephanerosi
b9306a5e52 Channel up/down for LiveTV and next/previous for other apps (#13829) 2018-04-13 16:52:21 -04:00
Matthew Garrett
ac2298189e Add support for controlling homekit lights and switches (#13346)
* Add support for controlling homekit lights and switches

This adds support for controlling lights and switches that expose a HomeKit
control interface, avoiding the requirement to implement protocol-specific
components.

* Comment out the homekit requirement

This needs to build native code, so leave it commented for now

* Review updates

* Make HomeKit auto-discovery optional

Add an "enable" argument to the discovery component and add a list of
optional devices types (currently just HomeKit) to discover

* Further review comments

* Update requirements_all.txt

* Fix houndci complaints

* Further review updates

* Final review fixup

* Lint fixups

* Fix discovery tests

* Further review updates
2018-04-13 19:25:35 +02:00
Paulus Schoutsen
60508f7215 Extract config flow to own module (#13840)
* Extract config flow to own module

* Lint

* fix lint

* fix typo

* ConfigFlowHandler -> FlowHandler

* Rename to data_entry_flow
2018-04-13 10:14:53 -04:00
Diogo Gomes
ddd2003629 initialize queue before filtering (#13842) 2018-04-13 14:25:03 +02:00
Paulus Schoutsen
20ababec3e Add authentication to error log endpoint (#13836) 2018-04-13 13:32:05 +02:00
Mark Coombes
d3b261a25d Add support for deCONZ daylight sensor (#13479)
* Add support for deCONZ daylight sensor

Bump pydeconz to 34

* Remove 'daylight' reason from async u
2018-04-13 08:58:57 +02:00
Fabian Affolter
3906250c9e Update example (fixes #13834) (#13839) 2018-04-13 08:50:58 +02:00
Diogo Gomes
22a1b99e57 UPnP async (#13666)
* moved from miniupnpc to pyupnp-async

* update requirements

* Tests added

* hound

* update requirements_test_all.txt

* update gen_requirements_all.py

* addresses @pvizeli requested changes

* address review comments
2018-04-13 00:22:52 +02:00
Mister Wil
62dc737ea3 Abode better events (#13809)
* Push abodepy version to 0.13.0

* Bump to 0.13.1. Now uses a cache to store the generated UUID.

* Reorganize to not be a dumb dumb.
2018-04-12 22:27:23 +02:00
Mark Coombes
993866a314 Support Garage Doors in HomeKit (#13796) 2018-04-12 18:08:48 +02:00
xTCx
51bdd06d1f Clicksend: Added support for multiple recipients (#13812)
* Clicksend: Added support for multiple recipients

* Removed whitespace
2018-04-12 16:13:31 +02:00
stephanerosi
d2804b0a27 Channel up/down for LiveTV and next/previous for other apps (#13829) 2018-04-12 15:44:56 +02:00
Yonsm
c863b9614c Support CO2/PM2.5/Light sensors in HomeKit (#13804)
* Support co2/light/air sensor in HomeKit
* Add tests
* Added tests
* changed device_class lux to light
2018-04-12 15:01:41 +02:00
Paulus Schoutsen
f47572d3c0 Allow platform unloading (#13784)
* Allow platform unloading

* Add tests

* Add last test
2018-04-12 14:28:54 +02:00
Paulus Schoutsen
9bd29589d5 Version bump to 0.67.0b1 2018-04-12 08:22:07 -04:00
Marco Orovecchia
f29904f1b5 Rename from aurora light to nanoleaf_aurora (#13831) 2018-04-12 08:21:52 -04:00
Anders Melchiorsen
234495ed05 Fix too green color conversion (#13828)
* Prepare test

* Fix too green color conversion

* Fix remaining tests
2018-04-12 08:21:52 -04:00
Adam Mills
09dbd94467 iglo hs color fix (#13808) 2018-04-12 08:21:51 -04:00
Paulus Schoutsen
bd58a0de7d Remove vendor lookup for mac addresses (#13788)
* Remove vendor lookup for mac addresses

* Fix tests
2018-04-12 08:21:51 -04:00
cdce8p
dd7e6edf61 HomeKit type_cover fix (#13832)
* Removed char_position_state
* Changed service call
2018-04-12 13:19:21 +02:00
Marco Orovecchia
b752ca3bef Rename from aurora light to nanoleaf_aurora (#13831) 2018-04-12 09:24:07 +02:00
Anders Melchiorsen
9c1bc18def Fix too green color conversion (#13828)
* Prepare test

* Fix too green color conversion

* Fix remaining tests
2018-04-11 20:58:57 -04:00
cdce8p
2a5751c09d Homekit refactor (#13707) 2018-04-11 22:24:14 +02:00
Matthew Garrett
8d48164f25 Add support for Eufy bulbs and switches (#13773)
* Add support for Eufy bulbs and switches

Add support for driving bulbs and switches from the Eufy range.

* Fix hound checks

* Satisfy pylint

* Handle review comments

* Review updates and test fixes

* PyLint is a bit too aggressive
2018-04-10 21:38:23 -04:00
Daniel Perna
b2695e498d Update pyhomematic to 0.1.41 (#13814)
* Update requirements_all.txt

* Update __init__.py
2018-04-10 23:33:56 +02:00
Daniel Høyer Iversen
16a1a4e0b1 Tibber lib update (#13811) 2018-04-10 22:12:55 +02:00
Wojtek
191e32f6cf Update yweather.py (#13802)
Map clear-night string to 31 value.
2018-04-10 21:11:45 +02:00
Toby Gray
978a79d369 device_tracker.ubus: Handle devices not running DHCP (#13579) 2018-04-10 20:38:36 +02:00
Adam Mills
cf88d8a1b9 iglo hs color fix (#13808) 2018-04-10 14:11:00 -04:00
Russell Cloran
2707d35a86 Update bellows to 0.5.2 (#13800) 2018-04-10 00:12:22 -07:00
Michael Kutý
7ea776dff4 Fix bad metrics format for short metrics. (#13778) 2018-04-10 08:20:47 +02:00
Johann Kellerman
bd93f10d3c script/lazytox: Ensure Flake8 passes for tests/ (#13794) 2018-04-09 21:24:50 -04:00
citruz
c8a464d8f9 Updated beacontools to 1.2.3 (#13792) 2018-04-09 21:24:18 -04:00
Paulus Schoutsen
5ac52b74e0 Remove vendor lookup for mac addresses (#13788)
* Remove vendor lookup for mac addresses

* Fix tests
2018-04-09 21:21:26 -04:00
Johann Kellerman
7595401dcb Qwikswitch Entity Register (#13791)
* Entity Register

* feedback
2018-04-10 01:24:06 +02:00
cdce8p
ae4e792651 Improved upgradeability HomeKit security_systems (#13783) 2018-04-09 22:57:10 +02:00
Sean Wilson
2b86059fd0 Add missing DISCHRG state (#13787)
* Add missing ups.status states.

* Add missing DISCHRG state.
2018-04-09 19:38:57 +02:00
Tod Schmidt
e593117ab6 Snips sounds (#13746)
* Added feedback sound configuration

* Added feedback sound configuration

* Cleaned up feedback off

* Cleaned up whitespace

* Moved feedback pus to helper funx

* Async

* Used async_mock_service for tests

* Lint
2018-04-09 11:46:27 -04:00
Phil Kates
c61611d2b4 Add Homekit locks support (#13625)
* homekit: Add locks support
* Improved upgradeability
2018-04-09 16:23:49 +02:00
Paulus Schoutsen
73de749411 Use config entry to setup platforms (#13752)
* Use config entry to setup platforms

* Rename to async_forward_entry

* Add tests

* Catch if platform not exists for entry
2018-04-09 10:09:08 -04:00
Yonsm
cb51553c2d Support binary_sensor and device_tracker in HomeKit (#13735)
* Support binary_sensor and device_tracker for HomeKit
* Add test for get_accessory and binary sensor
* Test service.display_name and char_detected.display_name
* Split test to improve speed
2018-04-09 15:32:28 +02:00
Erik Eriksson
8beb9c2b28 Only flag media position as updated when it really has (#13737) 2018-04-09 00:12:46 -04:00
Sebastian Muszynski
70649dfe22 Device type mapping introduced to avoid breaking change (#13765) 2018-04-08 22:00:47 +02:00
Johann Kellerman
b01dceaff2 Qwikswitch sensors (#13622) 2018-04-08 21:59:19 +02:00
Robin
ef16c53e46 Check valid file on get_size (#13756)
Addresses https://github.com/home-assistant/home-assistant/issues/13754
2018-04-08 11:32:49 +02:00
Paulus Schoutsen
40d7857f3b Prepare entity component for config entries (#13730)
* Prepare entity component for config entries

* Return in time
2018-04-07 23:04:50 -04:00
Otto Winter
81b1d08d35 Add MQTT Sensor unique_id (#13318)
* Add MQTT Sensor unique_id

* Add test

* Update comment
2018-04-07 22:32:09 -04:00
Fabian Affolter
99f4509c2b Upgrade netdisco to 1.3.1 (#13744) 2018-04-07 17:19:55 -04:00
Kane610
f915a1c809 Fix so it is possible to ignore discovered config entry handlers (#13741)
* Fix so it is possible to ignore discovered config entry handlers

* Improve efficiency
2018-04-07 17:18:49 -04:00
dangyuluo
6cd599b7df Throw an error when invalid device_mode is given (#13739)
* Throw an error when invalid device_mode is given

* Fix lint issue, typo and error msg

* Fix error msg
2018-04-07 21:47:56 +02:00
Fabian Affolter
435b49fb96 Reset permission (#13743) 2018-04-07 19:11:48 +02:00
Diogo Gomes
3084ac1625 Update CODEOWNERS (sensor.filter, sensor.upnp) (#13736) 2018-04-07 13:44:08 +02:00
shred86
2bf17cba8e Brightness conversion for Abode dimmers (#13711)
With AbodePy 0.12.3, dimmers will now work but a conversion of the brightness is required. Additionally, when a brightness value of 100 is sent to Abode, 99 is returned causing AbodePy to throw an error so this component will send 99 instead of 100.

Keeps the brightness value sent and returned from the device response consistent. However, during initialization and when a device refresh is received, Abode can return 100 thus we'll convert that case back to 99.
2018-04-07 11:15:35 +02:00
Fabian Affolter
ca3cc27e40 Upgrade sqlalchemy to 1.2.6 (#13733) 2018-04-07 10:41:35 +02:00
Fabian Affolter
fbb8a54c39 Upgrade aiohttp to 3.1.2 (#13732) 2018-04-07 10:40:34 +02:00
thrawnarn
b0fd2342db Bluesound bugfix status 595 and await (#13727)
* 595 fix

* Await fixes and last 595 fix

* Lint

* Made internal exception class

* Fix lint issue
2018-04-07 10:09:09 +02:00
David Broadfoot
58f3690ef6 Fix Gogogate2 'available' attribute (#13728)
* Fixed bug -  unable to set base readaonly property

* PR fixes

* Added line
2018-04-07 05:48:53 +02:00
Diogo Gomes
286476f0d6 Initialise filter_sensor with historical values (#13075)
* Initialise filter with historical values
Added get_last_state_changes()

* fix test

* Major changes to accommodate history + time_SMA

# Conflicts:
#	homeassistant/components/sensor/filter.py

* hail the hound!

* lint fixed

* less debug

* ups

* get state from the proper entity

* sensible default

* No defaults in get_last_state_changes

* list_reverseiterator instead of list

* prev_state to state

* Initialise filter with historical values
Added get_last_state_changes()

* fix test

* Major changes to accommodate history + time_SMA

# Conflicts:
#	homeassistant/components/sensor/filter.py

* hail the hound!

* lint fixed

* less debug

* ups

* get state from the proper entity

* sensible default

* No defaults in get_last_state_changes

* list_reverseiterator instead of list

* prev_state to state

* update

* added window_unit

* replace isinstance with window_unit
2018-04-06 21:59:55 -04:00
Henrik Nicolaisen
fdf93d1829 added support for smappee water sensors (#12831)
* added support for smappee water sensors

* fixed lint error and wrong location_id

* fixed lint error

* Use string formatting
2018-04-06 23:14:31 +02:00
cdce8p
262ea14e5a Add timeout / debounce (for brightness and others) (#13534)
* Add async timeout feature

* Decorator for setter methods to limit service calls to HA
* Changed to async
* Use async_call_later
* Use lastargs, async_add_job

* Use dict for lastargs

* Updated tests to stop patch
2018-04-06 23:11:53 +02:00
Juggels
c77d013f43 Allow use of date_string in service call (#13256)
* Allow use of date_string in service call

* Add stricter validation, fix descriptions
2018-04-06 22:23:40 +02:00
cgtobi
48fe2d18e8 Add option to ignore availability in google calendar events (#13714) 2018-04-06 21:48:50 +02:00
Fabian Affolter
3394916a68 Update docstrings (#13720) 2018-04-06 18:06:47 +02:00
Paulus Schoutsen
9ae6a3402c Version bump to 0.67.0b0 2018-04-06 10:26:08 -04:00
cdce8p
85487612d5 Update Homekit to 1.1.9 (#13716)
* Version bump to HAP-python==1.1.9

* Updated types and tests
2018-04-06 10:20:59 -04:00
David Broadfoot
bd51143ac1 Added gogogate2 cover (#13467)
* Added gogogate2 cover

* Hound fixes

* PR feedback

* Hound comments

* Bump gogogate2 version

* Update requirements all

* Add device_class and features

* Fix lint issues

* Again lint

* Fix imports

* Fix end of file
2018-04-06 15:53:00 +02:00
Marco Orovecchia
0a25d30ba6 Add support for Nanoleaf Aurora Light Panels (#13456)
* Added support for Nanoleaf Aurora Light Panels

* aurora light module - fixed lint errors

* aurora light module - use SUPPORT_COLOR instead of SUPPORT_RGB_COLOR

* nanoleaf aurora light - support_hs_color instead of rgb

* review comments from armills implemented

* nanoleaf aurora lights - put attributes into constructor (pylint)
2018-04-06 09:34:56 -04:00
Philipp Schmitt
bddfe24753 Fix #10175 (#13713) 2018-04-06 11:21:04 +02:00
Timmo
1d7ecc22f9 Added ENTITY_ID_FORMAT import and set entity_id in __init__ (#13642) 2018-04-06 10:59:09 +02:00
jmtatsch
703eea0c93 Enable autodiscovery for mqtt cameras (#13697)
* Enable autodiscovery for mqtt cameras, BREAKING CHANGE: homogenisation topic->state_topic

* fix line too long

* fix topic->state_topic in test

* image shall not be the state of entity
2018-04-06 00:11:38 -04:00
Mister Wil
b70b23ef83 Update AbodePy version to 0.12.3 (#13709) 2018-04-06 00:10:07 -04:00
Adam Mills
1a9727c75a Send XY color for non-osram hue bulbs (#13665)
* Send XY color for Philips hue bulbs

* Review fixes

* Comment tweaks
2018-04-05 20:17:18 -04:00
ikucuze
e6006e9beb Tahoma switches (#13636)
* Added the ability to switch Tahoma Garage door relay.

Those are special switches that can only be pushed.
Their state is always OFF, they react to the turn_on action, perform it, but stay OFF

* fixing indents and so on

* CI fix
2018-04-05 18:56:09 +02:00
PlanetJ
4008bf5611 Adding configration to disable ip address as a requirement Fixes: #13399 (#13692)
* Adding configration to disable ip address as a requirement Fixes: #13399

* Remove whitespace
2018-04-05 18:45:09 +02:00
tadly
edcb242b6d Add media type separation for video/movie (#13612)
* added media type separation for video/movie

* updated all media_player components to reflect new media type
2018-04-05 18:44:38 +02:00
Robin
0081764ddc Remove unused CONF_WATCHERS (#13678)
`CONF_WATCHERS` was from an earlier version, now unused
2018-04-05 18:07:42 +02:00
Niklas Morberg
bb5484edac Support color temperature in Homekit (#13658)
* Add support for color temperature
* Add test for color temp
2018-04-05 18:06:23 +02:00
shuaiger
63820a78d9 Fix asuswrt ap mode failure (#13693)
* fix asuswrt ap mode failure

When using ap mode, asuswrt device_tracker does dont work properly as ip can not be retrieved from wl command. This version fixed the issue.

* save 1 line code

* another 2 lines saved

* typo correction
2018-04-05 18:00:40 +02:00
Tom Harris
61a3b4ffdb Bump insteonplm to 0.8.6 to fix sensor message handling (#13691) 2018-04-05 17:59:32 +02:00
Johann Kellerman
1b3c3494e8 Coverage & Codeowners (#13700) 2018-04-05 17:58:55 +02:00
Daniel Perna
b2d37f5257 Update ha-philips_js to 0.0.3 (#13702)
* Update requirements_all.txt

* Update philips_js.py
2018-04-05 17:54:17 +02:00
cdce8p
206e38a2ab Update HAP-python to 1.1.8 (#13563)
* Bump version to HAP-python==1.1.8
* Required changes for version change
* Small bugfix lights
2018-04-05 13:20:20 +02:00
John Arild Berentsen
fe56844a3a Bugfix: Zwave Print_node to logfile instead of console (#13302)
* Print to logfile instead of console

* Review changes

* Typo
2018-04-05 11:14:15 +02:00
cdce8p
692b2644c7 Minor style changes, cleanup (#13654)
* Minor style changes, cleanup
* Change 'self._entity.id' to 'self.entity_id'
* Use const 'STATE_OFF'
* Added CATEGORY constants
* Removed *args from accessory types
* Changed 'self._hass' to 'self.hass'
* Added log debug msg (for added lights)
2018-04-05 00:52:25 +02:00
cdce8p
f263a931f7 Bugfixes HomeKit covers, lights (#13689)
* covers -> current_position attribute
* lights -> hue and saturation attribute
2018-04-05 00:46:27 +02:00
Sebastian Muszynski
301077ded9 Xiaomi MiIO Light: White Philips Candle Light support (#13682) 2018-04-05 00:42:00 +02:00
Ville Skyttä
415af5e257 Spelling fixes (#13681) 2018-04-04 23:30:02 +02:00
Oleg
9ce02d2717 Added headers configuration variable to notify.rest component (#13674)
* Added headers configuration variable to notify.rest component

* Fix code style
2018-04-04 16:35:33 +02:00
stephanerosi
4b2fdd243a Channel up and down for webostv (#13624) 2018-04-04 15:37:14 +02:00
mountainsandcode
032d6963d8 Add regex functions as templating helpers (#13631)
* Add regex functions as templating helpers

* Add regex functions as templating helpers - Style fixed

* Templating filters, third time lucky?
2018-04-04 15:34:01 +02:00
Paulus Schoutsen
13bda2669e Bump frontend to 20180404.0 2018-04-03 16:49:13 -07:00
Adam Mills
568c6c16fa Add missing service docs for hs_color (#13667) 2018-04-03 16:05:06 -07:00
Paulus Schoutsen
92bd932679 Always enable config entries & remove config_entry_example (#13663) 2018-04-03 23:23:21 +02:00
Kevin Raddatz
bfb49c2e58 Update plex.py (#13659)
fixed IndexError on line 131
2018-04-03 18:28:42 +02:00
Fabian Affolter
89f5a938c7 Upgrade youtube_dl to 2018.04.03 (#13647) 2018-04-03 18:27:08 +02:00
Sebastian Muszynski
9ce4755f8a Xiaomi Mi WiFi Repeater 2 integration as device tracker (#13521)
* Xiaomi Mi WiFi Repeater 2 integration as device tracker

* Unused import removed

* python-miio version pinned

* Missing period added
2018-04-02 19:45:12 +02:00
Fabian Affolter
b342c43b09 Add Switzerland (#13630)
* Add Switzerland

* remove space
2018-04-02 14:02:06 +02:00
Fabian Affolter
95e98925d1 Upgrade py-cpuinfo to 4.0.0 (#13629) 2018-04-02 11:58:22 +02:00
Wolfgang Malgadey
53f08e313f changed PyTado version (#13626) 2018-04-02 10:36:38 +02:00
Niklas Wagner
9fb73c1bab Hue mireds value is actually 153 not 154 (#13601) 2018-04-02 09:45:38 +02:00
Paulus Schoutsen
98e4d514a5 Merge branch 'rc' into dev 2018-04-01 11:48:45 -07:00
Paulus Schoutsen
79eb75f26f Merge pull request #13620 from home-assistant/rc
0.66.1
2018-04-01 11:45:40 -07:00
Paulus Schoutsen
ff960c0c7a Version bump to 0.66.1 2018-04-01 11:26:54 -07:00
Martin Hjelmare
52d2139904 Fix mysensors sensor type lookup (#13574)
* Always return a safe default.
2018-04-01 11:26:33 -07:00
cdce8p
e687ca781f Add pincode fallback (#13587)
* Add pincode log statement

* Moved msg to show_setup_msg
2018-04-01 11:26:18 -07:00
Adam Mills
ff72c5e456 Fix mqtt_json color commands (#13617) 2018-04-01 11:25:51 -07:00
Adam Mills
be43c3bcfe Fix mqtt_json color commands (#13617) 2018-04-01 14:12:55 -04:00
Lewis Juggins
4ad0152a44 Bugfix for tradfri to correctly execute Command. (#13618) 2018-04-01 18:42:47 +01:00
Paulus Schoutsen
eb763764b3 Fix Hue error logging (#13616) 2018-04-01 09:03:01 -07:00
cdce8p
cd96d7b2ec Add pincode fallback (#13587)
* Add pincode log statement

* Moved msg to show_setup_msg
2018-04-01 08:38:29 -07:00
Chris Jones
dee47d50ec Use 0/1 for raspberry pi cover GPIO writes rather than true/false (#13610)
* Use 0/1 for GPIO writes rather than true/false

GPIO pins don't appear to respond to true/false writes, and this is reflected in code elsewhere. For example, in `\components\switch\rpio_gpio.py` the following code is used:

```
    def turn_on(self, **kwargs):
        """Turn the device on."""
        rpi_gpio.write_output(self._port, 0 if self._invert_logic else 1)
        self._state = True
        self.schedule_update_ha_state()
```

This code works. Hence this PR uses 0/1 in the raspberry pi GPIO cover, instead of true/false.

* Update rpi_gpio.py
2018-04-01 08:37:03 -07:00
Martin Hjelmare
c8f2810fac Make mysensors updates and platform setup async (#13603)
* Use async updates but keep methods that interact with mysensors
  gateway thread, eg turn_on and turn_off, non async.
* Use Python 3.5 async syntax.
2018-04-01 08:36:26 -07:00
Paulus Schoutsen
ff9f500c51 Unflake folder watcher test (#13569)
* Unflake folder watcher test

* Fix tests

* Lint
2018-04-01 08:30:14 -07:00
Lewis Juggins
0c0e0c36af Re-add group polling as a fallback for observation (#13613) 2018-04-01 07:50:48 -07:00
Zhao
a8fdd76f44 Fix IMAP email message_data (#13606) 2018-04-01 12:17:26 +02:00
Daniel Høyer Iversen
45ef34ff81 Broadlink (#13585)
* Update broadlink lib

* Update broadlink lib

* requirements
2018-04-01 10:09:16 +02:00
Paulus Schoutsen
343d1384a3 Merge remote-tracking branch 'origin/rc' into dev 2018-03-31 18:13:10 -07:00
Paulus Schoutsen
9f0f7394fb Version bump frontend done right 2018-03-31 18:02:43 -07:00
Martin Hjelmare
5fce2e2b47 Fix mysensors update callback (#13602)
* Add callback annotation to mysensors dispatch callback.
2018-03-31 17:45:50 -07:00
Paulus Schoutsen
8fbef5b002 Version bump to 0.66.1b0 2018-03-31 17:44:01 -07:00
Paulus Schoutsen
3e082b5ce6 Bump frontend to 20180401.0 2018-03-31 17:43:41 -07:00
Frederik Bolding
7c99567b65 Added support for requesting RSSI values from Bluetooth devices (#12458)
* Added support for requesting RSSI values from Bluetooth devices

* Moved Bluetooth RSSI code to separate library and imported it

* Cleaned up tuple issues

* Changed concatination of mac addresses

* Changed string formatting to use new style

* Ran gen_requirements_all.py
2018-03-31 23:22:54 +02:00
Fabian Affolter
7b3d17bae4 Add mastodon (#13441)
* Add mastodon

* Move login

* Revert "Move login"

This reverts commit 2c8446f629.
2018-03-31 23:20:58 +02:00
Thibault Cohen
12affa1469 Upgrade pyhydroquebec 2.2.1 (#13586) 2018-03-31 23:16:47 +02:00
Andrew
477f7ec01e Added switch component to Amcrest IP Camera. (#12992)
* Added switch component to Amcrest IP Camera.

* Fixes to new switch component after review

* Removed redundant branching, as well as requirement declaration.

* Changes to requirements after rerunning generation script

* Minor changes
2018-03-31 23:15:25 +02:00
Myrddyn
7bf8d4ab12 Added Waze travel time sensor (#12387)
* Added Waze travel time sensor

* Update according PR comments and simplification
2018-03-31 23:01:07 +02:00
Rene Nulsch
3b4faa74a0 Remove MercedesME component (#13538) 2018-03-31 15:10:56 +02:00
Daniel Høyer Iversen
2518587534 xiaomi lib upgrade (#13577) 2018-03-31 15:08:35 +02:00
Daniel Høyer Iversen
273a43be02 rfxtrx lib 0.22.0 (#13576) 2018-03-31 15:08:04 +02:00
Martin Hjelmare
72fb64695e Fix mysensors sensor type lookup (#13574)
* Always return a safe default.
2018-03-31 15:07:29 +02:00
Tod Schmidt
bf44dc422c Added HassOpenCover and HassCloseCover intents (#13372)
* Added intents to cover

* Added test for cover intents

* Style fixes

* Reverted reversions

* Async fixes

* Woof

* Added conditional loading

* Added conditional loading

* Added conditional loading

* Moved tests, fixed logic

* Moved tests, fixed logic

* Pylint

* Pylint

* Refactored componenet registration

* Refactored componenet registration

* Lint
2018-03-30 17:22:48 -07:00
PhracturedBlue
bf58945680 Fixes #12758. Try other cameras even if one fails to initialize (#13276) 2018-03-30 15:48:31 -07:00
Paulus Schoutsen
0cfc7256ac Merge branch 'rc' into dev 2018-03-30 14:47:39 -07:00
Paulus Schoutsen
0d62f472cb Merge pull request #13554 from home-assistant/rc
0.66.0
2018-03-30 14:42:50 -07:00
Joe Lu
ad5a11ba3d Add support for Canary Flex (#13280)
Add support for Canary Flex
2018-03-30 23:38:29 +02:00
Paulus Schoutsen
4dea55b29c Version bump to 0.66.0 2018-03-30 14:11:32 -07:00
dramamoose
0f2cfe7f27 Fix FLUX_LED error when no color is set (#13527)
* Handle turn_on situation when no color is set

As is, an error gets thrown when turn_on is called without an HS value. By adding an if statement, we only try to set RGB if an HS value is applied.

* Fix Whitespace Issues

* Made Requested Changes
2018-03-30 14:10:56 -07:00
Johann Kellerman
9fc8a8f679 Check whitelisted paths #13107 (#13154) 2018-03-30 14:10:55 -07:00
dramamoose
f40efe0110 Fix FLUX_LED error when no color is set (#13527)
* Handle turn_on situation when no color is set

As is, an error gets thrown when turn_on is called without an HS value. By adding an if statement, we only try to set RGB if an HS value is applied.

* Fix Whitespace Issues

* Made Requested Changes
2018-03-30 14:10:25 -07:00
Jonas Skoogh
c361b0c450 Check_config: Handle numbers correctly when printing config (#13377) 2018-03-30 22:50:08 +02:00
Michaël Arnauts
0f24fea6bb Google Maps location sharing device tracker (#12301)
* Google Maps location sharing device tracker.

* Use ConfigType and change debug logging to _LOGGER.debug()

* Update to locationsharinglib 0.3.0

* Remove unneeded lines.

* Use hass.config.path for config file location.

* Fixed remarks

* Return boolean in setup_scanner
2018-03-30 22:47:20 +02:00
Ville Skyttä
0911166c9c Update pylint to 1.8.3 (#13544) 2018-03-30 21:34:16 +02:00
Beat
8fad97a47a Add FreeDNS component (#13526)
* Add FreeDNS component

* Implement review changes in FreeDNS component

* Implement review changes in FreeDNS component

* Implement review changes in FreeDNS component
2018-03-30 21:33:30 +02:00
Sebastian Muszynski
9cfcd38c1e Xiaomi MiIO Switch: Support for the Xiaomi Chuangmi Plug V3 (#13271)
* Device support of the Xiaomi Chuangmi Plug V3 added

* Refactoring.

* Additional attributes added.

* New miio device class used
2018-03-30 21:02:02 +02:00
ChristianKuehnel
979a8f8772 Fix BMW device tracker toggling state if vehicle tracking is disabled (#12999)
* if tracking is disabled, the position is not set in the device tracker.

This fixes an issue with a toggling vehicle state.

* removed useless attributes
2018-03-30 18:12:57 +02:00
Andrey
6314aabc6f Remove andrey-git from requirements monitoring (#13547) 2018-03-30 15:16:29 +02:00
Kane610
931bceefd9 deCONZ config entry (#13402)
* Try config entries

* Testing

* Working flow

* Config entry text strings

* Removed manual inputs for config flow

* Support unloading of config entry

* Bump requirement to v33

* Fix comments from test

* Make sure that only one deCONZ instance can be set up

* Hass doesn't support unloading platforms yet

* Modify get_api_key to be testable

* Fix hound comments

* Add test dependency

* Add test for no key

* Bump requirement to v35
Add pydeconz to list of test components

* Don't have a check in async_setup that domain exists in hass.data
2018-03-30 00:34:26 -07:00
Paulus Schoutsen
78f3e01854 Fix version bump script 2018-03-30 00:25:47 -07:00
Albert Lee
5801d78017 Implement thermostat support for Alexa (#13340)
* Implement thermostat support for Alexa

* util.temperature: Support interval conversions

* Use climate.ATTR_OPERATION_MODE for Alexa thermostat mode

* Switch coroutines to async/await

* Log all Alexa error events
2018-03-29 23:49:08 -07:00
Paulus Schoutsen
184f2be83e Convert Hue to always use config entries (#13034) 2018-03-29 20:15:40 -07:00
Paulus Schoutsen
1ae8b6ee08 Fix requirements 2018-03-29 20:02:21 -07:00
Andy Castille
170763ef2f Allow for overriding the DoorBird push notification URL in configuration (#13268)
* Allow for overriding the DoorBird push notification URL in configuration

* rename override config key
2018-03-29 20:00:26 -07:00
Johann Kellerman
507c658fe9 Check whitelisted paths #13107 (#13154) 2018-03-29 19:57:19 -07:00
Frederik Bolding
3e5462ebff Added file path validity checks to file sensor (#12505)
* Added file validity checks to file sensor

* Patched out 'is_allowed_path' for file sensor tests
2018-03-29 19:47:49 -07:00
Åskar Andersson
8617177ff1 Update rflink to 0.0.37 (#12603)
* Update requirements_all.txt

* Update rflink.py
2018-03-29 19:45:25 -07:00
Robin
df78eecc1b Adds folder_watcher component (#12918)
* Create watchdog_file_watcher.py

* Rename watchdog_file_watcher.py to folder_watcher.py

* Address a number of issues

* Adds filter

* Adds pattern matching

* Adds create_event_handler()

* Update folder_watcher.py

* Adds run_setup()

* Remove stop_watching()

* Adds shutdown()

* Update config to allow patterns on each folder

* Update to patterns from filters

* Adds watchdog

* Fix indents on schema

* Update folder_watcher.py

* Create test_file_watcher.py

* Fix lints

* Add test_invalid_path()

* Adds folder_watcher

* Update test_file_watcher.py

* Update folder_watcher.py

* Simplify config

* Adapt for new config

* Run observer.schedule() on EVENT_HOMEASSISTANT_START

* Amend Watcher removing entity and tidying startup

* Tidy config

* Rename process to on_any_event for consistency

* Rename on_any_event back to process

Using `on_any_event` resulted in 2 events being fired

* Update folder_watcher.py

* Fix return False on setup

* Update test_file_watcher.py

* Update folder_watcher.py

* Adds watchdog

* Undo adding watchdog

* Update test_file_watcher.py

* Update test_file_watcher.py

* Update test_file_watcher.py

* Update test_file_watcher.py

* Update test_file_watcher.py

* Add event

* Update test_file_watcher.py

* Update .coveragerc

* Update test_file_watcher.py

* Update test_file_watcher.py

* debug + join

* test event

* lint

* lint

* Rename test_file_watcher.py to test_folder_watcher.py

* hound

* Tidy test

* Further refine test

* Adds to test_all

* Fix test for py35

* Change test again

* Update test_folder_watcher.py

* Fix test

* Add watchdog to test

* Update folder_watcher.py

* add watchdog

* Update folder_watcher.py
2018-03-29 18:10:20 -07:00
Paulus Schoutsen
5908b55bba Fix merge conflict 2018-03-29 18:01:47 -07:00
Paulus Schoutsen
e5d76c53fb Merge remote-tracking branch 'origin/rc' into dev 2018-03-29 17:23:11 -07:00
Paulus Schoutsen
f26aff4885 Version bump to 0.66.0b3 2018-03-29 17:21:48 -07:00
Johann Kellerman
32b0712089 Don't add Falsy items to list #13412 (#13536) 2018-03-29 17:21:28 -07:00
Sebastian Muszynski
867010240a Construct version pinned (#13528)
* Construct added to the requirements

* requirements_all.txt updated
2018-03-29 17:21:28 -07:00
cdce8p
0428559f69 HomeKit: Fix setting light brightness (#13518)
* Added test
2018-03-29 17:21:28 -07:00
Tom Harris
dfd15900c7 Fix Insteon Leak Sensor (#13515)
* update leak sensor

* Fix error when insteon state type is unknown

* Bump insteon version to 0.8.3

* Update requirements all and test

* Fix requirements conflicts due to lack of commit sync

* Requirements sync

* Rerun script/gen_requirements_all.py

* Try requirements update again

* Update requirements
2018-03-29 17:21:27 -07:00
Martin Hjelmare
e993d095cb Fix mysensors light supported features (#13512)
* Different types of light should have different supported features.
2018-03-29 17:21:27 -07:00
Sebastian Muszynski
26fb3d7faa python-miio version bumped (Closes: 13449) (#13511) 2018-03-29 17:21:26 -07:00
cdce8p
b0073b437f Homekit: Fix security systems (#13499)
* Fix alarm_code=None
* Added test
2018-03-29 17:21:26 -07:00
cdce8p
e04b01daad Validate basic customize entries (#13478)
* Added schema to validate customize dictionary

* Added test
2018-03-29 17:21:25 -07:00
cdce8p
020669fc60 Homekit: Bugfix Thermostat Fahrenheit support (#13477)
* Bugfix thermostat temperature conversion
* util -> temperature_to_homekit
* util -> temperature_to_states
* util -> convert_to_float
* Added tests, deleted log msg
2018-03-29 17:21:25 -07:00
Philip Rosenberg-Watt
d897a07d0b Fix Google Calendar caching when offline (#13375)
* Fix Google Calendar caching when offline

Events from Google Calendar were not firing under the following
circumstances:

1. Start ha as normal with Google Calendar configured as per
   instructions.
2. ha loses network connectivity to Google
3. ha attempts update of Google Calendar
4. calendar/google component throws uncaught Exception causing update
   method to not return
5. (cached) Google Calendar event does not fire, remains "Off"

Catching the Exception and returning False from the update() method
causes the correct behavior (i.e., the calendar component firing the
event as scheduled using cached data).

* Add requirements

* Revert code cleanup

* Remove explicit return value from update()

* Revert "Remove explicit return value from update()"

This reverts commit 7cd77708af.

* Use MockDependency decorator

No need to whitelist google-python-api-client for a single unit test at
this point.
2018-03-29 17:21:24 -07:00
Johann Kellerman
a6b63b669e Don't add Falsy items to list #13412 (#13536) 2018-03-29 17:13:08 -07:00
Sebastian Muszynski
ab9b915731 Construct version pinned (#13528)
* Construct added to the requirements

* requirements_all.txt updated
2018-03-29 17:12:11 -07:00
Martin Hjelmare
0a0b33af03 Fix mysensors light supported features (#13512)
* Different types of light should have different supported features.
2018-03-29 17:10:56 -07:00
Tom Harris
f391cbae27 Fix Insteon Leak Sensor (#13515)
* update leak sensor

* Fix error when insteon state type is unknown

* Bump insteon version to 0.8.3

* Update requirements all and test

* Fix requirements conflicts due to lack of commit sync

* Requirements sync

* Rerun script/gen_requirements_all.py

* Try requirements update again

* Update requirements
2018-03-29 17:10:27 -07:00
Paulus Schoutsen
27865f58f1 Bump frontend to 20180330.0 2018-03-29 17:00:16 -07:00
Johann Kellerman
3fdb0002a7 Qwikswitch async refactor & sensor (#13509) 2018-03-29 23:29:46 +02:00
NovapaX
298e6eeef1 Tradfri - unique_id's and color_temp support for rgb-bulbs (#13531)
* unique_ids for tradfri lights and groups

* set color temperature on CWS bulb
Cannot set_color_temp on color bulb, needs conversion from mired to hsb

* make travis happy

* change condition so we ensure color bulbs are included, change comments.
2018-03-29 21:39:56 +02:00
cdce8p
cea2de5eb5 HomeKit: Fix setting light brightness (#13518)
* Added test
2018-03-29 18:35:57 +02:00
Fabian Affolter
3b537f6e2a Fix typos and update link (fixes #13520) (#13529) 2018-03-29 10:40:41 +02:00
Sebastian Muszynski
ef7fd9f380 python-miio version bumped (Closes: 13449) (#13511) 2018-03-28 15:55:05 -07:00
Lewis Juggins
b3b7cf3fa7 Update tradfri v5 (#11187)
* First pass to support simplified colour management in tradfri

* Fix lint

* Fix lint

* Update imports

* Prioritise brightness for transition

* Fix bug

* None check

* Bracket

* Import

* Fix bugs

* Change colour logic

* Denormalise colour

* Lint

* Fix bug

* Fix bugs, expose rgb conversion

* Fix bug

* Fix bug

* Fix bug

* Improve XY

* Improve XY

* async/wait for tradfri.

* Bump requirement

* Formatting.

* Remove comma

* Line length, shadowing

* Switch to new HS colour system, using native data from tradfri gateway.

* Lint.

* Brightness bug.

* Remove guard.

* Temp workaround for bug.

* Temp workaround for bug.

* Temp workaround for bug.

* Safety.

* Switch logic.

* Integrate latest

* Fixes.

* Fixes.

* Mired validation.

* Set bounds.

* Transition time.

* Transition time.

* Transition time.

* Fix brightness values.
2018-03-28 15:50:09 -07:00
Fabian Affolter
45ff15bc85 Upgrade aiohttp to 3.1.1 (#13510) 2018-03-28 12:45:24 +02:00
Mikael Svensson
bdb4d754ae Adds template function state_attr to get attribute from a state (#13378)
* Adds template function state_attr to get attribute from a state
Refactored is_state_attr to use new function
Adds tests for state_attr

* Fixes line too long and test bug

* Fixes pylint error

* Fixes tests and D401 lint error
2018-03-28 00:04:18 -07:00
Fabian Affolter
00c6df54b2 Upgrade slacker to 0.9.65 (#13496) 2018-03-28 08:27:56 +02:00
cdce8p
2bebfec3a6 Homekit: Fix security systems (#13499)
* Fix alarm_code=None
* Added test
2018-03-27 23:39:25 +02:00
Sebastian Muszynski
264be67787 New service added to control the power mode of the yeelight (#13267)
* New service added to control the power mode of the yeelight

* Debug output removed.

* Strict validation of the available power modes

* Service description added

* Service parameter name fixed
2018-03-27 20:29:18 +02:00
Fabian Affolter
06aded1a4d Upgrade python-mystrom to 0.4.2 (#13485) 2018-03-27 13:09:01 +02:00
cdce8p
9eda04b787 Homekit: Bugfix Thermostat Fahrenheit support (#13477)
* Bugfix thermostat temperature conversion
* util -> temperature_to_homekit
* util -> temperature_to_states
* util -> convert_to_float
* Added tests, deleted log msg
2018-03-27 11:31:18 +02:00
cdce8p
8a0facb747 Validate basic customize entries (#13478)
* Added schema to validate customize dictionary

* Added test
2018-03-26 19:50:29 -07:00
Philip Rosenberg-Watt
81cf0dacfe Fix Google Calendar caching when offline (#13375)
* Fix Google Calendar caching when offline

Events from Google Calendar were not firing under the following
circumstances:

1. Start ha as normal with Google Calendar configured as per
   instructions.
2. ha loses network connectivity to Google
3. ha attempts update of Google Calendar
4. calendar/google component throws uncaught Exception causing update
   method to not return
5. (cached) Google Calendar event does not fire, remains "Off"

Catching the Exception and returning False from the update() method
causes the correct behavior (i.e., the calendar component firing the
event as scheduled using cached data).

* Add requirements

* Revert code cleanup

* Remove explicit return value from update()

* Revert "Remove explicit return value from update()"

This reverts commit 7cd77708af.

* Use MockDependency decorator

No need to whitelist google-python-api-client for a single unit test at
this point.
2018-03-26 18:10:22 -07:00
Paulus Schoutsen
e1d2d201c8 Merge branch 'rc' into dev 2018-03-26 16:24:48 -07:00
Paulus Schoutsen
3639a4470c Use twine for release 2018-03-26 16:16:42 -07:00
Paulus Schoutsen
94d9aa0c5f Bump version to 0.66.0.b2 2018-03-26 16:10:03 -07:00
Paulus Schoutsen
a06eea444a version should contain just 'b' not 'beta' (#13476) 2018-03-26 16:09:18 -07:00
Paulus Schoutsen
ce3a5972c7 Upgrade aiohue and fix race condition (#13475)
* Bump aiohue to 1.3

* Store bridge in hass.data before setting up platform

* Fix tests
2018-03-26 16:09:18 -07:00
Fabian Affolter
f48ce3d437 Fix ID (fixes #13444) (#13471) 2018-03-26 16:09:17 -07:00
Paulus Schoutsen
dfe3219f3f Hue: Convert XY to HS color if HS not present (#13465)
* Hue: Convert XY to HS color if HS not present

* Revert change to test

* Address comments

* Lint
2018-03-26 16:09:17 -07:00
Fabian Affolter
254256c08f Fix ID (fixes #13444) (#13471) 2018-03-26 16:08:44 -07:00
Paulus Schoutsen
f1d37fc849 Upgrade aiohue and fix race condition (#13475)
* Bump aiohue to 1.3

* Store bridge in hass.data before setting up platform

* Fix tests
2018-03-26 16:07:22 -07:00
Paulus Schoutsen
08bcf84170 version should contain just 'b' not 'beta' (#13476) 2018-03-26 14:55:09 -07:00
Paulus Schoutsen
24e0bb198a Hue: Convert XY to HS color if HS not present (#13465)
* Hue: Convert XY to HS color if HS not present

* Revert change to test

* Address comments

* Lint
2018-03-26 14:00:56 -07:00
phileaton
263dbe5d81 Update total_connect_client to 0.17 for Honeywell L5100-WiFi Support (#13473)
* Update total_connect_client to 0.17

* Delete tqdm.1
2018-03-26 21:32:38 +02:00
Anders Melchiorsen
3e6f4d0e5a [RFC] Update issue template (#12989)
* Update issue template

* Any release
2018-03-26 21:21:18 +02:00
c727
181e68b027 Add more info to issue template (#12955)
* Update ISSUE_TEMPLATE.md

* Minumum supported version is Python 3.5.3

* typo

* Feedback

* Feedback

* Address comments
2018-03-26 19:22:05 +02:00
Lindsay Ward
2e3ec121d1 Update yeelightsunflower to 0.0.10 (#13448)
* Update yeelightsunflower to 0.0.10

* Update yeelightsunflower platform to 0.0.10
2018-03-26 18:27:53 +02:00
Dan Nixon
a6e455a070 Make Telnet Switch value template optional (#13433)
When no statis command is defined a value template does nothing so
should not have to be provided.
2018-03-26 18:22:21 +02:00
Paulus Schoutsen
a08e5efe53 Merge branch 'rc' into dev 2018-03-25 18:25:25 -07:00
Paulus Schoutsen
a507ed0af8 Version bump to 0.66.0.beta1 2018-03-25 18:24:16 -07:00
Beat
068b037944 Fix encoding errors in mikrotik device tracker (#13464) 2018-03-25 18:23:32 -07:00
Cedric Van Goethem
38d2702e3c Add extra check for ESSID field in case there's a wired connection (#13459) 2018-03-25 18:23:32 -07:00
Paulus Schoutsen
93b9ec0b0f Add version bump script (#13447)
* Add version bump script

* Lint
2018-03-25 18:23:31 -07:00
Anders Melchiorsen
22cefc7e64 Improve detection of entity names in templates (#13432)
* Improve detection of entity names in templates

* Only test variables
2018-03-25 18:23:31 -07:00
cdce8p
60f6109cbf HomeKit: Bugfix & improved logging (#13431)
* Bugfix & improved logging

* Removed logging statements

* Removed logging test
2018-03-25 18:23:30 -07:00
a-andre
24d299e266 Hyperion: fix typo (#13429) 2018-03-25 18:23:30 -07:00
Anders Melchiorsen
444805df10 LimitlessLED hs_color fixes (#13425) 2018-03-25 18:23:30 -07:00
Anders Melchiorsen
a08293cff7 Log invalid templates in script delays (#13423)
* Log invalid templates in script delays

* Abort on error

* Remove unused import
2018-03-25 18:23:29 -07:00
Patrick Hofmann
0d48a8eec6 Security fix & lock for HomeMatic (#11980)
* HomeMatic KeyMatic device become a real lock component

* Adds supported features to lock component.

Locks may are capable to open the door latch.
If component is support it, the SUPPORT_OPENING bitmask can be supplied in the supported_features property.

* hound improvements.

* Travis improvements.

* Improvements from review process

* Simplifies is_locked method

* Adds an openable lock in the lock demo component

* removes blank line

* Adds test for openable demo lock and lint and reviewer improvements.

* adds new line...

* Comment end with a period.

* Additional blank line.

* Mock service based testing, lint fixes

* Update description
2018-03-25 18:23:29 -07:00
Paulus Schoutsen
8a204fd15b Bump frontend to 20180326.0 2018-03-25 18:10:59 -07:00
a-andre
1887bac37e Hyperion: fix typo (#13429) 2018-03-25 18:07:26 -07:00
Paulus Schoutsen
d6af26b589 Add version bump script (#13447)
* Add version bump script

* Lint
2018-03-25 18:04:20 -07:00
Cedric Van Goethem
a5ae77ab93 Add extra check for ESSID field in case there's a wired connection (#13459) 2018-03-25 18:03:23 -07:00
Beat
8ab5978db3 Fix encoding errors in mikrotik device tracker (#13464) 2018-03-25 18:02:21 -07:00
Johann Kellerman
3e3f710b12 Qwikswitch async & updates (#12641) 2018-03-25 23:32:13 +02:00
Patrick Hofmann
6d20a84f0e Security fix & lock for HomeMatic (#11980)
* HomeMatic KeyMatic device become a real lock component

* Adds supported features to lock component.

Locks may are capable to open the door latch.
If component is support it, the SUPPORT_OPENING bitmask can be supplied in the supported_features property.

* hound improvements.

* Travis improvements.

* Improvements from review process

* Simplifies is_locked method

* Adds an openable lock in the lock demo component

* removes blank line

* Adds test for openable demo lock and lint and reviewer improvements.

* adds new line...

* Comment end with a period.

* Additional blank line.

* Mock service based testing, lint fixes

* Update description
2018-03-25 23:25:28 +02:00
Fabian Affolter
b996632965 Upgrade aiohttp to 3.1.0 (#13451) 2018-03-25 14:25:00 +02:00
Fabian Affolter
eaf81150ea Upgrade keyring to 12.0.0 and keyrings.alt to 3.0 (#13452) 2018-03-25 14:23:53 +02:00
cdce8p
7db37a3834 HomeKit: Bugfix & improved logging (#13431)
* Bugfix & improved logging

* Removed logging statements

* Removed logging test
2018-03-25 12:53:15 +02:00
Anders Melchiorsen
55daea5169 Improve detection of entity names in templates (#13432)
* Improve detection of entity names in templates

* Only test variables
2018-03-25 12:51:11 +02:00
Anders Melchiorsen
594a5b7d29 LimitlessLED hs_color fixes (#13425) 2018-03-25 00:47:10 -07:00
Alan Tse
3a765692e7 Fixing odometer to display km (#13427) 2018-03-25 00:46:47 -07:00
Marc Forth
2d2e8034d6 Removed the google home warning from emulated_hue (#13436)
* Removed the google home warning from emulated_hue

* Update test_init.py

* Update test_init.py
2018-03-25 00:45:25 -07:00
Teemu R
f3ccbda054 Bump songpal version, fixes lots of issues mentioned in #13022 (#13440) 2018-03-25 08:24:03 +02:00
Anders Melchiorsen
7166d53e2b Log invalid templates in script delays (#13423)
* Log invalid templates in script delays

* Abort on error

* Remove unused import
2018-03-25 01:12:26 +01:00
Sebastian Muszynski
e36f27d6fd Xiaomi MiIO Fan: Xiaomi Air Humidifier integration (#12627)
* Device support for the Xiaomi Air Humidifier.

* Requirements updated.

* "continuation line under-indented for visual indent" fixed.

* Make hound happy.

* Inadvertently added light.xiaomi_miio component removed from PR.

* Service descriptions added.

* One of the pylint errors fixed.

* Redundancy removed.

* pylint: disable=no-self-use added. The method signature is important here.

* Pylint fixed.

* Use a unique data key per domain.

* Review incorporated.

* Map of available attributes added.

* Pylint fixed.
Attribute "volume" added.

* Don't use the support flag bit mask as model identifier.
Determine support features and attributes at the constructor.
Use starred expressions at dicts instead of copies.

* Blank line removed.

* Use Async / await syntax.

* Make hound happy.

* Xiaomi Air Humidifier CA support added.

* Duplicate method removed.

* Air Purifier V3 support added.

* Don't abuse the system property supported_features anymore.

* python-miio version bumped.

* Clean-up.

* Additional supported features refactoring completed.

* Additional supported features renamed properly.

* Unique id added.

* Device unavailable handling improved.

* Refactoring.

* Missed const updated.

* Incomplete Air Humidifier CA support fixed.

* Review incorporated

* The Air Humidifier CA supports the operation mode "auto" - the standard version doesn't

* Attributes are part of the common set already

* Revert "Attributes are part of the common set already"

This reverts commit 40b443eba0.

* Comment added

* Service description of the set_dry_{on,off} service added

* Typo fixed
2018-03-24 23:04:43 +01:00
Colin O'Dell
11930d5f20 QNAP updates (#13435)
* Add @colinodell to CODEOWNERS for qnap sensor

* Bump qnapstats library to 0.2.5

This release adds better error handling for sharenames with no folder
2018-03-24 22:13:12 +01:00
Colin O'Dell
df35159cb4 Add code owner for Manual Alarm with MQTT Control (#13438) 2018-03-24 21:33:49 +01:00
ChristianKuehnel
4d52875229 Update to new "b2vapi" of BMW ConnectedDrive (#13305)
* updated to new "b2vapi" of bimmer_connected

* updated requirements_all.txt

* updated 2 more vehicle names after rebase

* cleanup of import statements

* found one more broken name...

* removed unused constant

* cleanup of import statements 2
2018-03-24 12:16:49 +01:00
Fabian Affolter
8bd5f66c57 Upgrade mypy to 0.580 (#13420) 2018-03-23 23:50:32 +01:00
Franck Nijhof
872b6cf16b Updates default Pilight port number (#13419) 2018-03-23 23:22:33 +01:00
Paulus Schoutsen
8e14e803cb Fix release script 2018-03-23 14:27:21 -07:00
Paulus Schoutsen
101b39300b Version bump to 0.66.0.beta0 2018-03-23 14:17:36 -07:00
Paulus Schoutsen
b159484a79 Version bump to 0.67.0.dev0 2018-03-23 14:16:17 -07:00
Paulus Schoutsen
725e1ddfc1 Update translations 2018-03-23 14:15:44 -07:00
Paulus Schoutsen
a17e60208d Update translations 2018-03-23 14:15:31 -07:00
Otto Winter
6a625bdb37 Cast Integration Cleanup (#13275)
* Cast Integration Cleanup

* Fix long line

* Fixes and logging

* Fix tests

* Lint

* Report unknown state with None

* Lint

* Switch to async_add_job

Gets rid of those pesky "Setup of platform cast is taking over 10 seconds." messages.

* Re-introduce PlatformNotReady

* Add tests

* Remove unnecessary checks

* Test PlatformNotReady

* Fix async in sync context

* Blocking update

It's not using async anyway

* Upgrade pychromecast to 2.1.0

* Make reviewing easier

I like "protected" access, but I like reviewing more :)

* Make reviewing even easier :)

* Comment tests
2018-03-23 14:02:52 -07:00
Matt Hamrick
630734ca15 Switched values to downcase. (#13406) 2018-03-23 13:54:36 -07:00
cdce8p
7fd687f59c Fix current_cover_position (#13135) 2018-03-23 13:54:19 -07:00
Paulus Schoutsen
4bd6776443 Google assistant sync (#13392)
* Add Google Assistant Sync API

* Update const.py

* Async/await
2018-03-23 12:13:52 -07:00
Sebastian Muszynski
2532d67b9a Add send sticker service to telegram bot (#13387)
* Add send sticker service to telegram bot

* A caption is not supported
2018-03-23 19:16:57 +01:00
Mattias Welponer
df8596e896 Cleanup homematicip_cloud (#13356)
* Cleanup and proposed changes from MartinHjelmare

* Removed coroutine decorator from async_added_to_hass

* Added blank line

* Fix of component url

* Fix of component url

* Fix url of the sensor component
2018-03-23 11:05:02 -07:00
Adam Mills
2497dd5e33 Hue: Use the currently active color mode (#13376)
* Hue: Use the currently active color mode

* Round hue/sat colors before reporting to API

* .gitignore cache fix
2018-03-23 11:01:40 -07:00
cdce8p
553920780f Added default return value for HS_Color (#13395) 2018-03-23 10:22:48 -07:00
Jerad Meisner
8852e52601 Switched to async/await. Bumped pyxeoma version (#13404) 2018-03-23 10:22:01 -07:00
Martin Hjelmare
23165cbd1a Enhance mysensors binary sensor device classes (#13367) 2018-03-23 18:11:53 +01:00
Philip Rosenberg-Watt
23f06b0040 Cache LaMetric devices for offline use (#13379)
If the connection to the LaMetric server fails, we should still be able
to send notifications to known and reachable devices.
2018-03-23 18:10:52 +01:00
Anders Melchiorsen
5ec6f25d4e Fix Sonos playing Sveriges Radio (#13401) 2018-03-23 18:09:17 +01:00
cgtobi
79c9d3ba10 Fix incorrect unit of measurement for precip_intensity. (#13415) 2018-03-23 18:08:16 +01:00
Martin Hjelmare
ba7178dc0c Enhance mysensors sensor units and icons (#13365) 2018-03-23 18:06:07 +01:00
Erik Eriksson
2c7bc6eaf8 Support setting icon when configuring MQTT entity (#13304) 2018-03-23 11:30:44 +01:00
Gerard
c50b00226c Avoid breaking change for BMW ConnectedDrive sensors in #12591 (#13380) 2018-03-23 07:32:33 +01:00
Paulus Schoutsen
fb1fafefab Include all config flow translations with backend translations (#13394) 2018-03-22 12:21:33 -07:00
Jeroen ter Heerdt
98620d8ce8 Fixing Egardia 'home armed' state not shown correctly. (#13335)
* Fixing Egardia 'home armed' state not shown correctly.

* Updating requirements_all.

* Adding DEPEDENCY list to Egardia components.

* updating requirements_all
2018-03-22 10:53:52 -07:00
Paulus Schoutsen
d385e9645d Merge remote-tracking branch 'origin/master' into dev 2018-03-22 10:20:35 -07:00
cgtobi
e9cdbe5d8c Add language parameter to darksky sensor (#13297) 2018-03-22 13:34:02 +01:00
Paulus Schoutsen
6e75c5427c Update frontend to 20180322.0 2018-03-21 21:22:16 -07:00
Diogo Gomes
1676df6a5f Mediaroom async (#13321)
* Initial commit on new asyncio based version

* Async version

* Lint

* updated to lasted pymediaroom version

* bump version

* optimistic state updates

* bump version

* Moved class import to method import

* async schedule and name correction

* Addresses @balloob comments

* missed fixes

* no unique_id for configuration based STB

* hound

* handle 2 mediaroom platforms
2018-03-21 18:06:41 -07:00
Martin Hjelmare
17cbd0f3c9 Add watt to mysensors switch attributes (#13370) 2018-03-21 23:55:49 +01:00
Martin Hjelmare
2d7d8848cb Fix mysensors RGBW (#13364)
Tuple doesn't have append method.
2018-03-21 23:48:50 +01:00
Thomas Svedberg
3939460814 Add the possibility to filter on line(s) in Västtrafik Public Transport sensor (#13317)
* Add the possibility to filter on line(s) in Västtrafik Public Transport sensor

Add a config entry "lines" to be able to filter departures on line(s) for the
vasttrafik sensor.

* Change log level to debug if no departures found.

* Remove extra None argument from dict().get() calls as it is already the default.

* Ensure "lines" is a list of strings. Also fix an indentation error.

* Correct to long line
2018-03-21 15:21:51 -07:00
maxclaey
36bc7f8175 Configuration options for IFTTT alarm control panel (#13352)
* Improvements

* Use optimistic instead of await callback

* Fix default value for optimistic
2018-03-21 12:29:58 -07:00
maxclaey
0396725fe9 Homekit Bugfix: Use get instead of indexing (#13353)
Fixes bug for alarm_control_panel if not code is required.
2018-03-21 19:06:46 +01:00
Paulus Schoutsen
c3974e540b Merge pull request #13369 from home-assistant/release-0-65-6
0.65.6
2018-03-21 10:59:58 -07:00
Scott Reston
74c249e57d Fix retrieval of track URL into medi_content_id (#13333)
'current.item' was returning blank.
2018-03-21 10:44:53 -07:00
Paulus Schoutsen
da4e630f54 Fix tests 2018-03-21 10:38:06 -07:00
Paulus Schoutsen
ffbafa687a Do not include unavailable entities in Google Assistant SYNC (#13358) 2018-03-21 10:14:56 -07:00
Anders Melchiorsen
7718f70c5f Fix Sonos radio stations with ampersand (#13293) 2018-03-21 10:14:56 -07:00
Anders Melchiorsen
0de2681783 Fix Sonos join/unjoin in scripts (#13248) 2018-03-21 10:14:55 -07:00
Paulus Schoutsen
7e08e8bd51 Tado: don't reference unset hass var (#13237)
Tado: don't reference unset hass var
2018-03-21 10:14:54 -07:00
PhracturedBlue
2388d62755 More robust MJPEG parser. Fixes #13138. (#13226)
* More robust MJPEG parser. Fixes ##13138.

* Reimplement image extraction from mjpeg without ascy generator to support python 3.5
2018-03-21 10:14:54 -07:00
Paulus Schoutsen
fab958d789 Version bump to 0.65.6 2018-03-21 10:14:28 -07:00
Anders Melchiorsen
f8127a3902 Add a polling fallback for Sonos (#13310)
* Prepare for poll

* Add a polling fallback for Sonos
2018-03-20 19:27:07 -07:00
Martin Hjelmare
3426487277 Fix mysensors light turn on hs color (#13349) 2018-03-20 18:26:56 -07:00
Paulus Schoutsen
cfb0b00c0c Do not include unavailable entities in Google Assistant SYNC (#13358) 2018-03-20 18:09:34 -07:00
Anders Melchiorsen
852eef8046 Fix Sonos radio stations with ampersand (#13293) 2018-03-20 18:05:03 -07:00
Daniel Perna
05c9c57500 Update pyhomematic to 0.1.40 (#13354)
* Update __init__.py

* Update requirements_all.txt
2018-03-20 20:32:59 +01:00
John Arild Berentsen
5c4529d044 Bugfix: Zwave set_config_parameter failed when config list contained int (#13301)
* Cast list and bool options to STR

* Add button options to STR

* Add TYPE_BUTTON to value types

* Adjust comparison

* Remove Logging

* Remove Empty line

* Update tests

* Update tests

* Mistake
2018-03-20 14:04:24 +01:00
Daniel Høyer Iversen
3fa080a795 Add min and max price as attribute for Tibber sensor (#13313) 2018-03-20 08:46:10 +01:00
Sergio Viudes
0977be1842 Added switch for DoorBird second relay (#13339) 2018-03-20 08:43:31 +01:00
Johann Kellerman
4270bc7abb Perform check_config service in current process (#13017)
* Perform check_config service in current process

* feedback
2018-03-19 14:20:04 -07:00
Ryan McLean
a04c6d5830 Plex unavailable client cleanup (#13156)
* Added timestamp for when device was marked unavailable

* protect time 1st marked

* client removal, no errors

* Optional removal interval added

* Linting error fix

* Implemented guard to prevent indentation
Removed vars in favour of inline calcs

* Using hass.add_job() for cleanup

* Lint

* Revert removal interval to 600sec

* Changed datetime to hass implementation

* Forgot to include one of the references to dt
2018-03-19 14:15:21 -07:00
Per Osbäck
f287955422 zha: catch the exception from bellows if a device isn't available. (#13314)
* catch the exception from bellows if a device isn't available.

* fix import of zigpy exception

* fix lint import
2018-03-19 14:12:53 -07:00
Qxlkdr
2bc7e58780 Add trafikverket_weatherstation sensor platform (#12115)
* Create trafikverket_weatherstation.py

Created PR 12111 but due to permission issue I'm creating a new fork and PR.

* Added dot

Added dot to the first (second) row of the file, after the description.

* Corrections based on feedback

Done:
- Run flake8 before this commit
- Fixed invalid variables
- Shortened the xml variable/query via if statement (air_vs_road)
- Moved imports if update() to top of the file
- Imported CONF_API_KEY and CONF_TYPE
- Updated documentation (api_key): home-assistant/home-assistant.github.io#4562

Actions left:
- Error handling
- Request timeout
- Add sensor (file) to .coveragerc

* Multiple corrections

Done:
- Executed pylint and flake8 tests before commit
- Fixed import order
- Implemented request timeout
- Used variable air_vs_road in the return as well

Actions left:
- Error handling
- Add sensor (file) to .coveragerc

* Error handling

Done:
- Error handling for network
- Error handling for JSON response

* Added trafikverket_weatherstation.py

Added trafikverket_weatherstation.py in correct order.

* Road as default

Changed if statement to check for 'road' which means it will always defaulting to 'air' in other cases. Even if it will only accept 'air' and 'road' from the PLATFORM_SCHEMA.

* Updated variable names

Updated variable names to be more understandable as requested by @MartinHjelmare

* Standard Libraries

Grouped Standard Libraries

* Return None

Changed return None to only return as suggested.
2018-03-19 21:38:07 +01:00
Otto Winter
947218d51c pytest 3.4.0 cache gitignore (#13308) 2018-03-19 10:47:10 +01:00
Diogo Gomes
49683181d1 Superfluous None (#13326) 2018-03-18 20:42:23 -07:00
Adam Mills
89c7c80e42 Use hue/sat as internal light color interface (#11288)
* Accept and report both xy and RGB color for lights

* Fix demo light supported_features

* Add new XY color util functions

* Always make color changes available as xy and RGB

* Always expose color as RGB and XY

* Consolidate color supported_features

* Test fixes

* Additional test fix

* Use hue/sat as the hass core color interface

* Tests updates

* Assume MQTT RGB devices need full RGB brightness

* Convert new platforms

* More migration

* Use float for HS API

* Fix backwards conversion for KNX lights

* Adjust limitless min saturation for new scale
2018-03-18 15:00:29 -07:00
nielstron
6b059489a6 Adding a discoverable Samsung Syncthru Printer sensor platform (#13134)
* Added a simple component to support the BLNET

Adds a component based on pyblnet, that hooks up the blnet to home assistant

* Adds support for custimzation of blnet sensor devices

* Setting up blnet as a platfrom

* Updated use of state_attributes

Now the friendly_name (and for digital values the mode) is set in the state_attributes whereas the name is defined as "blnet_(analog|digital)_{sensornumber}" so you can reliably add them to groups.

* Added support for the SyncThru printer web service

* Added pysyncthru to the requirements

* Changed to Dependencis, import inside setup_platform

* Switch back to REQUIREMENTS

Looks like DEPENDENCIES is not meant for python packages but for other HA components

* Fixed access to _attributes

* Final fix

* Several Bugfixes

When the printer goes offline, the last state will be kept.
Also now checks if the printer is reachable upon setup

* Register syncthru as discoverable

* Included possible conditions to monitor

* Split the printer sensor in several seperate sensor entities

* Fixed bug at sensor creation, pep8 conform

* Bugfix

* Bugfix

* Removed Blnet components

* Fixed unused import

* Renamed discoverable to samsung_printer

* Removed unused Attribute _friendly_name

* Inserted missing space

* Pinned requirements and added to coveragerc

* Reduced redundancy by condensing into multiple sub-classes

* Fixed indentation

* Fixed super constructor calls

* Fixed super constructor calls

* Fixed format

* Resolving style issues and using name instead of friendly_name

* Pinned pysyncthru in requirements_all, having trouble with friendly_name

* Iterating over dictionary instead of dict.keys()

* ran gen_reqirements_all.py

* Fixed flake 8 issues

* Added a simple component to support the BLNET

Adds a component based on pyblnet, that hooks up the blnet to home assistant

* Implemented requested changes

* raised dependecies to pysyncthru version that has timeouts

* Raised required version for full timeout support

* Adds support for custimzation of blnet sensor devices

* Setting up blnet as a platfrom

* Updated use of state_attributes

Now the friendly_name (and for digital values the mode) is set in the state_attributes whereas the name is defined as "blnet_(analog|digital)_{sensornumber}" so you can reliably add them to groups.

* Added support for the SyncThru printer web service

* Added pysyncthru to the requirements

* Removed Blnet components

* Pinned requirements and added to coveragerc

* Fixed indentation

* Fixed format

* Pinned pysyncthru in requirements_all, having trouble with friendly_name

* ran gen_reqirements_all.py

* Updated requirements_all

* Renamed sensor objects, removed passing of hass entity

* Removed merge artifacts

* Reset syncthru to newest state

* Updated requirements_all

* switched to using the newest version of pysyncthru

* Sorted coveragerc
2018-03-18 09:26:33 -07:00
Erik Eriksson
1cbf9792d7 Support MQTT Lock discovery (#13303) 2018-03-18 09:26:07 -07:00
Kevin Raddatz
437ffc8337 Update plex.py (#12157)
* Update plex.py

show information about media depending if it is a movie or an episode
set time_between_scans to 10 s to match with plex media_player component

* Update plex.py

lint

* Update plex.py

linting

* Update plex.py

linting

* Update plex.py

linting

* Update plex.py

added catch  for tracks and everything else
if no release year is given, instead of () it now show nothing

* Update plex.py

Remove the album year to match with the Plex UI

* Update README.rst

* Update README.rst

* Update plex.py

reformat code to make it more readable
recorded tv shows might not have episode numbers assigned -> check before adding to title

* Update plex.py

cleanup excessive whitespace

* Update plex.py

cleanup excessive whitespace
2018-03-18 09:25:25 -07:00
Igor Bernstein
9cb3c9034f Zigbee fan (#12289)
* wip: initial control

* fix initial state

* cosmetic cleanup

* doc typo

* lint

* fixes

* fix unknown bug

* Lint
2018-03-18 09:17:56 -07:00
uchagani
1dcc51cbdf Add ecobee fan mode (#12732)
* add ability to set fan on

* add tests and change "not on" status to "auto"

* hound fix

* more hounds

* I don't understand new lines

* fix linting errors

* more linting fixes

* change method signature

* lint fixes

* hopefully last lint fix

* correct temp ranges according to ecobee API docs

* update dependency to latest version

* update tests with values from new temp logic

* fix linting issue

* more linting fixes

* add SUPPORT_FAN_MODE to capabilities

* add fan_list to attributes.
restore current fan state to OFF if fan is not running.
change target high/low temps from null to target temp when not in auto mode.
change target temp from null to high/low temp when in auto mode
change mode attribute to climate_mode for consistency with other lists.

* remove unused import

* simplify logic

* lint fixes

* revert change for target temps
2018-03-18 09:02:07 -07:00
maxclaey
022d8fb816 Support for security systems controlled by IFTTT (#12975)
* Add IFTTT alarm control panel

* Update .coveragerc

* Add support for code

* Bugfix

* Fix logging problem

* Pin requirements

* Update requirements_all.txt

* Fix lint errors

* Use ifttt component as a dependency instead of interacting with ifttt manually
Take into account review comments

* No default value for code

* Take into account review comments

* Provide a "push_alarm_state" service to change the state from IFTTT

* Add service description

* Fix @balloob review comments. Thanks!

* Fix service description name
2018-03-18 09:00:08 -07:00
Diogo Gomes
1e17b2fd63 Added Time based SMA to Filter Sensor (#13104)
* Added Time based SMA

* move "now" to _filter_state()

* Addressed comments

* fix long line

* type and name

* # pylint: disable=redefined-builtin

* added test
2018-03-18 08:58:52 -07:00
Mattias Welponer
b45dad507a Add initial support fo HomematicIP components (#12761)
* Add initial support fo HomematicIP components

* Fix module import

* Update reqirments file as well

* Added HomematicIP files

* Update to homematicip

* Code cleanup based on highligted issues

* Update of reqiremnets file as well

* Fix dispatcher usage

* Rename homematicip to homematicip_cloud
2018-03-18 08:57:53 -07:00
Fabian Affolter
8ed3024026 Upgrade async_timeout to 2.0.1 (#13290) 2018-03-17 17:37:31 -07:00
cburgess
d042b3d7d1 Update to latest python-nest (#12590)
Due to an upstream bug some devices will be assigned a where_id that is not
visible in the nest API. As a result we can't get a friendly name for the
where_id.

A workaround has been released for python-nest in version 3.7.0. Update the
home assistant requirements to python-nest==3.7.0 to work around this issue.

References:
https://nestdevelopers.io/t/missing-where-name-from-some-devices/1202
https://github.com/jkoelker/python-nest/issues/127
https://github.com/jkoelker/python-nest/pull/128

Fixes #12589
Fixes #12950
Fixes #13074
2018-03-17 17:35:16 -07:00
Pascal Vizeli
4d3743f3f7 Delete .gitmodules (#13295) 2018-03-17 19:08:52 +01:00
cgtobi
181eca4b45 Upgrade python-forecastio to 1.4.0 (#13282)
* Upgrade python-forecastio to 1.4.0

* Upgrade python-forecastio to 1.4.0 for sensor as well.
2018-03-17 17:43:07 +01:00
Fabian Affolter
dbc59ad1a7 Upgrade python-telegram-bot to 10.0.1 (#13294) 2018-03-17 17:41:10 +01:00
Fabian Affolter
82f59ba984 Upgrade numpy to 1.14.2 (#13291) 2018-03-17 17:40:31 +01:00
Fabian Affolter
d35077271d Upgrade TwitterAPI to 2.5.0 (#13287) 2018-03-17 17:40:03 +01:00
Fabian Affolter
aec61b7c86 Upgrade sqlalchemy to 1.2.5 (#13292) 2018-03-17 17:39:24 +01:00
Fabian Affolter
e01a0f91d6 Upgrade aiohttp_cors to 0.7.0 (#13289) 2018-03-17 17:37:53 +01:00
Fabian Affolter
8fed405da7 Upgrade aiohttp to 3.0.9 (#13288) 2018-03-17 17:37:09 +01:00
Otto Winter
3442b6741d Fix WUnderground duplicate entity ids (#13285)
* Fix WUnderground duplicate entity ids

* Entity Namespace
2018-03-17 13:14:53 +01:00
Otto Winter
f5093b474a Python 3.5 async with (#13283) 2018-03-17 12:27:21 +01:00
thrawnarn
05676ba18b Changed to async/await (#13246)
* Changed to async/await

* Hound fixes

* Lint fixes

* Changed sleep
2018-03-17 12:14:01 +01:00
Sebastian Muszynski
66c6f9cdd6 Unused xiaomi miio sensor method removed (#13281)
* Unused method removed.

* remove unused import
2018-03-17 11:51:40 +01:00
Paulus Schoutsen
5a9013cda5 Refactor Hue: phue -> aiohue (#13043)
* phue -> aiohue

* Clean up

* Fix config

* Address comments

* Typo

* Fix rebase error

* Mark light as unavailable when bridge is disconnected

* Tests

* Make Throttle work with double delay and async

* Rework update logic

* Don't resolve host to IP

* Clarify comment

* No longer do unnecessary updates

* Add more doc

* Another comment update

* Wrap up tests

* Lint

* Fix tests

* PyLint does not like mix 'n match async and coroutine

* Lint

* Update aiohue to 1.2

* Lint

* Fix await MagicMock
2018-03-16 20:27:05 -07:00
Paulus Schoutsen
d78e75db66 Bump frontend to 20180316.0 2018-03-16 15:39:30 -07:00
Sebastian Muszynski
d04ba3f86d Xiaomi MiIO Sensor: Xiaomi Air Quality Monitor (PM2.5) integration (#13264)
* Xiaomi MiIO Sensor: Xiaomi Air Quality Monitor (PM2.5) integration.

* Missing newline added.

* Use a unique data key per domain.

* turn_{on,off} service moved to __init__.py.

* All sensors group added.

* Sensor is a ToggleEntity now.

* is_on property added.

* Use Async / await syntax.

* Make hound happy.

* Unique id added.

* Turn on/off service removed from abstract sensor.

* Turn on/off methods removed.
Device unavailable handling improved.

* Unused import removed.

* Sensor migrated back to an entity.

* Rebased and requirements updated.
2018-03-16 22:13:04 +01:00
Sebastian Muszynski
ed6cd0ccfa Xiaomi MiIO Remote: Unique id added (#13266)
* Unique id added.

* Provide the exception as "ex"
2018-03-16 21:15:23 +01:00
Jens Timmerman
88d2a6ab80 Fix guide link in CONTRIBUTING.md (#13272) 2018-03-16 21:13:32 +01:00
Sebastian Muszynski
fe7012549e Xiaomi MiIO light: Philips Eyecare Smart Lamp 2 integration (#12883)
* Xiaomi Philips Eyecare Smart Lamp 2 support added.

* Blank lines removed.

* Pylint errors fixed.

* Abstract light introduced.

* Smart night light mode renamed.

* Use the conventional power on/off methods again.

* Eyecare mode service added.

* Eyecare mode attribute added.

* Name of the ambient light entity fixed.

* Reuse of the same local variable name within the same scope fixed.

* Use Async / await syntax.

* Missed method fixed.

* Make hound happy.

* Don't abuse the system property supported_features anymore.

* Make hound happy.

* Wrong hanging indentation fixed.
Unnecessary parens after 'return' keyword fixed.

* Refactoring.

* Additional supported features bit mask removed as long as the differences of the supported devices are simple.

* Support for Xiaomi Philips Zhirui Smart LED Bulb E14 Candle Lamp added.

* Docstrings updated.
Refactoring.

* Unique id added.

* Filter service calls. Dummy methods removed.

* Device available handling improved.

* super() used for calling the parent class

* Self removed from super().
2018-03-16 20:59:18 +01:00
Sebastian Muszynski
f013619e69 Xiaomi MiIO Switch: Power Strip support improved (#12917)
* Xiaomi MiIO Switch: Power Strip support improved.

* New service descriptions added.

* Make hound happy.

* Pylint fixed.

* Use Async / await syntax.

* Missed method fixed.

* Make hound happy.

* Don't abuse the system property supported_features anymore.

* Check the correct method.

* Refactoring.

* Make hound happy.

* pythion-miio version bumped.

* Clean-up.

* Unique id added.

* Filter service calls.
Device unavailable handling improved.
2018-03-16 19:58:03 +01:00
Teemu R
78144bc6de Use the first, not the last volume controller when multiple are available on songpal (#13222)
* use the first, not the last volume controller

* Do not mutate the list but simply pick the first by index
2018-03-16 12:14:21 +01:00
cdce8p
f6ae2d338d Homekit: Use util functions for unit conversion (#13253)
* Updated to util/color for conversion
* Updated temperature sensor to use util/temperature conversion
2018-03-16 11:38:44 +01:00
BioSehnsucht
99f7e2bd97 Added Stride notification component (#13221)
* Added Stride notification component

* Fix trailing whitespace in Stride notify

* More whitespace fixes and rogue comment for Stride notify

* More whitespace fixing for Stride notify

* Correcting hanging indents for Stride notify
2018-03-15 20:36:03 -07:00
karlkar
b1079cb493 Fix for not setting up the camera if it is offline during setup phase (#13082)
* Fix for not setting up the camera if it is offline during setup phase

* async/await and modified service creation

* Properly handle not supported PTZ

* setup platform made synchronous as ONVIFService constructors do I/O

* Fix intendation issue
2018-03-15 20:30:41 -07:00
Fabien Piuzzi
0deef34881 Adding Foobot device sensor (#12417)
* Added Foobot device sensor

* Added error handling tests

* Corrections after PR review.

* Migrated to async/await syntax

 * lint fixes
 * stop raising HomeAssistantError
 * debug log for number of requests

* Moved shared data between sensors from a class attribute to a separate class

* Made test more async-aware

disabled setup error test for now as it's not working

* Working failure scenarios tests
2018-03-15 19:50:58 -07:00
cdce8p
2350ce96a6 Homekit: New supported devices (#13244)
* Fixed log message
* Added support for scripts
* Added support for lights
* Small refactoring
* Added support for humidity sensor
* Added tests
2018-03-16 01:05:28 +01:00
Anders Melchiorsen
de1ff1e952 Fix Sonos join/unjoin in scripts (#13248) 2018-03-15 16:12:43 -07:00
Gerard
d13bcf8412 Add extra sensors for BMW ConnectedDrive (#12591)
* Added extra sensors for BMW ConnectedDrive

* Updates based on review of @MartinHjelmare

* Updates based on 2nd review of @MartinHjelmare

* Changed control flow for updates to support updates triggered by remote services.

* updated library version number

* Changed order of commands so that the UI looks consistent.

State of lock is now set optimisitcally before getting proper update
from the server. So that the state does not toggle in the UI.

* Added comment on optimistic state

* Updated requirements_all.txt

* Revert access permission changes

* Fix for Travis

* Changes based on review by @MartinHjelmare
2018-03-15 22:56:35 +01:00
Paulus Schoutsen
456ff4e84b Tado: don't reference unset hass var (#13237)
Tado: don't reference unset hass var
2018-03-15 13:53:59 -07:00
Paulus Schoutsen
89a19c89a7 Fix aiohttp deprecation warnings (#13240)
* Fix aiohttp deprecation warnings

* Fix Ring deprecation warning

* Lint
2018-03-15 21:49:49 +01:00
Juggels
a86bf81768 Fix 'dict' object has no attribute 'strftime' (#13215)
* Fix 'dict' object has no attribute 'strftime'

* Clear existing list instead of new object
2018-03-15 21:43:20 +01:00
Anders Melchiorsen
5e675677ad Cleanup Sonos platform setup (#13225)
* Cleanup Sonos platform setup

* Remove unneeded lists
2018-03-15 20:43:28 +01:00
maxlaverse
ff416c0e7a Try to fix caldav (#13236)
* Fix device attribute type for event end

* Fix is_over and add tests
2018-03-15 10:58:11 -07:00
Paulus Schoutsen
170b8671b9 Fix logbook JSON serialize issue (#13229)
* Fix logbook JSON serialize issue

* Address flakiness

* Lint

* deflake ?

* Deflake 2
2018-03-15 10:54:22 -07:00
Maximilien Cuony
ee6d6a8859 myStrom: Add RGB support to Wifi bulbs (#13194) 2018-03-15 16:45:27 +01:00
Andrei Pop
1d2fd8a2e9 Edimax component reports wrong power values (#13011)
* Fixed Edimax switch authentication error for newer firmware.

* pyedimax moved to pypi

* Added pyedimax to gen_requirements_all.py

* Cleanup

* Fixed https://github.com/home-assistant/home-assistant/issues/13008

* Only ValueError now

* Trivial error.
2018-03-15 16:27:42 +01:00
Eugene Kuzin
92f13ff60d media_content_type attribute display fix (#13204)
* media_content_type fix

Kodi media_content_type attribute display fix

* media_content_type fix (#6989)

fixes attribute display for unknown media

* code cleanup

* trailing whitespaces

* comments correction

* redundant "else:" removed
2018-03-15 08:43:29 -04:00
Clement Wong
5c434f143e Tibber use appNickname as name (#13231) 2018-03-15 13:16:52 +01:00
cdce8p
646ed5de52 Added cover.group platform (replaces #12303) (#12692)
* Added cover.group platform
* Added async/await, smaller changes
* Made (async_update) methods regular methods
* Small improvements
* Changed classname
* Changes based on feedback
* Service calls
* update_supported_features is now a callback method
* combined all 'update_attr_*' methods in 'async_update'
* Small changes
* Fixes
   * is_closed
   * current_position
   * current_tilt_position
* Updated tests
* Small changes 2
2018-03-15 12:31:31 +01:00
Otto Winter
27c1806897 Python 3.5 adjustments (#13173) 2018-03-15 13:10:54 +02:00
Fabian Affolter
6909be1cc7 Add docstring (#13232) 2018-03-15 11:45:54 +01:00
PhracturedBlue
223bc187dc More robust MJPEG parser. Fixes #13138. (#13226)
* More robust MJPEG parser. Fixes ##13138.

* Reimplement image extraction from mjpeg without ascy generator to support python 3.5
2018-03-14 21:44:13 -07:00
c727
c971d61422 Change Hass.io icon to home-assistant (#13230) 2018-03-14 20:56:56 -07:00
Kane610
e122692b46 deCONZ - Add support for consumption and power sensors (#13218)
* Add support for consumption and power sensors

* Keep attr_current inside component
2018-03-14 20:07:37 -07:00
Paulus Schoutsen
76874e1cbc Update translations 2018-03-14 19:47:31 -07:00
cdce8p
d348f09d3d HomeKit Restructure (new config options) (#12997)
* Restructure
* Pincode will now be autogenerated and display using a persistence notification
* Added 'homekit.start' service
* Added config options
* Renamed files for types
* Improved tests
* Changes (based on feedback)
* Removed CONF_PIN_CODE
* Added services.yaml
* Service will only be registered if auto_start=False
* Bugfix names, changed default port
* Generate aids with zlib.adler32
* Added entity filter, minor changes
* Small changes
2018-03-15 02:48:21 +01:00
Paulus Schoutsen
64f18c62f4 Update frontend 2018-03-14 16:39:15 -07:00
Paulus Schoutsen
be2e202618 Bump frontend to 20180315.0 2018-03-14 16:13:46 -07:00
engrbm87
07f20676cb Add notifications to downloader.py (#12961)
* Update downloader.py

Add persistent notification to alert when download is finished or in case of download failure.

* Update downloader.py

* Update downloader.py

* Update downloader.py

* Fire and event when download is requested

Added 2 events to represent download completed and download failed. This will allow the user to trigger an automation based on the status of the download.

* Update downloader.py

* Update downloader.py

replaced . with _

* Update downloader.py

fixed linting errors
2018-03-14 16:03:40 -07:00
Paulus Schoutsen
a30ca4307b Merge branch 'master' into dev 2018-03-14 15:58:55 -07:00
Paulus Schoutsen
8d52eba484 Merge pull request #13223 from home-assistant/release-0-65-5
0.65.5
2018-03-14 15:55:50 -07:00
Paulus Schoutsen
8e05a5c12b Version bump to 0.65.6 2018-03-14 15:08:34 -07:00
Paulus Schoutsen
25fe6ec536 Fix input_boolean Google Assistant serialize error (#13220) 2018-03-14 15:08:23 -07:00
Anders Melchiorsen
30a1fedce8 Avoid Sonos error when joining with self (#13196) 2018-03-14 15:08:23 -07:00
Anders Melchiorsen
4e569ac0c3 Ignore unsupported Sonos favorites (#13195) 2018-03-14 15:08:22 -07:00
Alok Saboo
8a6370f7c9 Revert throttle Arlo api calls (#13174) 2018-03-14 15:08:21 -07:00
cdce8p
874cccd530 Bugfix HomeKit: Error string values for temperature (#13162) 2018-03-14 15:08:21 -07:00
Paulus Schoutsen
e1a5e5a8ba Fix input_boolean Google Assistant serialize error (#13220) 2018-03-14 15:07:37 -07:00
Paulus Schoutsen
a9917e7a56 Fix history API (#13214) 2018-03-14 22:29:51 +01:00
Anders Melchiorsen
ef7ce5eb1b Ignore unsupported Sonos favorites (#13195) 2018-03-14 12:08:41 -07:00
Anders Melchiorsen
7fc9ac0931 Avoid Sonos error when joining with self (#13196) 2018-03-14 12:07:50 -07:00
Paulus Schoutsen
e2029e3970 Add vesync to coveragerc 2018-03-14 12:05:17 -07:00
Paulus Schoutsen
7e2fc19f5a Sort coveragerc 2018-03-14 11:39:38 -07:00
cdce8p
c48c8710b7 Bugfix HomeKit: Error string values for temperature (#13162) 2018-03-14 13:22:38 +01:00
Dan Nixon
b6bed1dfab Report swap in MiB (#13148)
It makes sense to report swap and memory in the same unit and MiB is
more useful considering Home Assistant may be running on lower end
hardware (Raspberry Pi for example) where 100MiB resolution is not
adequate.
2018-03-14 08:47:45 +01:00
Vincent Van Den Berghe
948f29544a Fixed SI units for current consumption (#13190) 2018-03-14 08:14:35 +01:00
Mark Perdue
6310deb5c2 Add new platform for VeSync switches (#13000)
* Added vesync platform
Support for power toggling, current power, and daily energy kWh

* Adds vesync to requirements file.

* Reorder vesync item in requirements_all.txt from gen_requirements_all

* Removes unnecessary global values that are not used in this component

* Removes try/catch from setup_platform -no throws. Guard check login()

* Remove unnecessary boolean convert

* Fix indentation of log messages
2018-03-14 00:10:47 -07:00
JC Connell
cfded7eab9 Python Spotcrime sensor requires API key, fixes include/exclude (#12926)
* Add spotcrime.py to dev

* Modify sensor to accept user API key

* Update Spotcrime to 1.0.3 in requirements_all.txt

* Fix line 76 (97 > 79 characters)

* Fix lint errors
2018-03-14 08:01:10 +01:00
Pascal Vizeli
0ef4340099 Fix freegeoip (#13193) 2018-03-13 20:50:08 -07:00
Vincent Van Den Berghe
29e659cf4c Fixed SI units for current consumption 2018-03-13 22:20:56 +01:00
Jon Maddox
24a9da85c0 Channels clean ups (#12967)
* already in the default schema

* these are already globally disabled

* require a single entity id

* remove unused import

* w h i t e s p a c e

* actually keep it

* it is a string

* use a generator expression

* 💄

* Revert "💄"

This reverts commit 81c08bb732.

* Revert "actually keep it"

This reverts commit 0d92d3afb2.

* Revert "remove unused import"

This reverts commit 8a166208e4.

* Revert "already in the default schema"

This reverts commit 9173de4fd3.

* we're already ensuring defaults with the platform schema
2018-03-13 14:14:02 -07:00
Alok Saboo
71baa6532e Revert throttle Arlo api calls (#13174) 2018-03-13 14:12:28 -07:00
Otto Winter
4c9e7c2da4 Upgrade pytest to 3.4.2 (#13169)
* Upgrade pytest to 3.4.2

* Upgrade pytest-sugar to 0.9.1
2018-03-13 13:57:04 -07:00
Otto Winter
5958e6a60f Improve MQTT failed connection error message (#13184) 2018-03-13 13:56:16 -07:00
Andreas Wolter
3e7a737bff Added IPAreaThermostat and an exception-list for HM_IGNORE_DISCOVERY_NODE (#13171) 2018-03-13 21:54:09 +01:00
Ville Skyttä
dd48fb04a3 upcloud: Provide unique ID for server entities (#13181) 2018-03-13 13:51:10 -07:00
Otto Winter
d5612b5ccc Upgrade holidays to 0.9.4 (#13167) 2018-03-13 17:30:31 +01:00
Kane610
8a1687accb deConz rewrite to use async await syntax (#13151)
* Rewrite to use async await syntax

* Fix hound comment
2018-03-13 08:47:45 +01:00
Jesse Hills
53351423dd Change iglo port to cv.port validator (#13163) 2018-03-13 08:29:20 +01:00
Daniel Høyer Iversen
75fb8ef98b upgrade tibber libary to 0.4.0 to use aiohttp 3.0 (#13164) 2018-03-13 07:04:27 +01:00
Fabian Affolter
989638b266 Upgrade Sphinx to 1.7.1 (#13127) 2018-03-12 18:22:48 -07:00
Otto Winter
d028c33e7f Disable Monkey Patch for 3.6.3+ (#13150) 2018-03-12 16:12:21 -07:00
Paulus Schoutsen
0a2e949e0a Remove crazy JSON encoding things that are no longer used (#13029)
Catch JSON encoding errors in HTTP view
2018-03-12 23:22:08 +01:00
Paulus Schoutsen
1bea8747ac Merge pull request #13149 from home-assistant/release-0-65-4
0.65.4
2018-03-12 14:52:01 -07:00
Alok Saboo
e54394e906 Throttle Arlo api calls (#13143) 2018-03-12 14:14:43 -07:00
Jeroen ter Heerdt
c384fd9653 Adding check for empty discovery info in alarm control panel Egardia. (#13114) 2018-03-12 14:14:42 -07:00
Paulus Schoutsen
3560fa754c Catch if bridge goes unavailable (#13109) 2018-03-12 14:14:42 -07:00
Paulus Schoutsen
101a6ab07c Fix unavailable property for wemo switch (#13106)
* Fix unavailable property for wemo switch

* Have subscriptions respect the lock

* Move subscription callback to added to hass section
2018-03-12 14:14:42 -07:00
Paulus Schoutsen
eb1ca20cfc Version bump to 0.65.4 2018-03-12 14:14:36 -07:00
Jeroen ter Heerdt
ae286a550b Adding check for empty discovery info in alarm control panel Egardia. (#13114) 2018-03-12 14:03:05 -07:00
Fabian Affolter
c5330a13b6 Upgrade schiene to 0.22 (#13121) 2018-03-12 14:02:36 -07:00
Fabian Affolter
6ab4a408d2 Upgrade zeroconf to 0.20.0 (#13123) 2018-03-12 14:02:03 -07:00
Fabian Affolter
1202134964 Upgrade youtube_dl to 2018.03.10 (#13124) 2018-03-12 14:01:32 -07:00
Fabian Affolter
bbbb44b999 Upgrade TwitterAPI to 2.4.10 (#13126) 2018-03-12 14:01:05 -07:00
Fabian Affolter
54e0cc1304 Upgrade mypy to 0.570 (#13128) 2018-03-12 14:00:10 -07:00
Per Osbäck
f9e07e617c update to async/await (#13137) 2018-03-12 13:57:13 -07:00
Alok Saboo
95a528a75f Throttle Arlo api calls (#13143) 2018-03-12 13:56:33 -07:00
Paulus Schoutsen
51b0cbefe3 Catch if bridge goes unavailable (#13109) 2018-03-12 13:55:22 -07:00
Paulus Schoutsen
8d8b07abd5 Fix unavailable property for wemo switch (#13106)
* Fix unavailable property for wemo switch

* Have subscriptions respect the lock

* Move subscription callback to added to hass section
2018-03-12 13:54:56 -07:00
Federico Zivolo
15d345c4ef fix: Support different JointSpace API versions (#13084) 2018-03-12 12:33:04 -07:00
Fabian Affolter
676c94561b Upgrade astral to 1.6 (#13120) 2018-03-12 12:28:27 -07:00
Fabian Affolter
02ad9c3574 Upgrade aiohttp to 3.0.7 (#13119) 2018-03-12 12:26:51 -07:00
Otto Winter
890197e407 asyncio.ensure_future Python 3.5 (#13141) 2018-03-12 19:42:08 +01:00
Paulus Schoutsen
9ee123f5ce Version bump to 0.66.0.dev0 2018-03-11 13:20:47 -07:00
Adam Mills
14aa4e7694 Lint script tweaks (#13093)
* Also lint working tree files

When performing a git diff of upstream/dev..., git is diffing against
the current HEAD, but does not include working tree files. By manually
calculating a merge-base SHA to diff against, git will still diff those
files.

* Don't pylint tests files, since we don't in CI

* Use merge base for lazytox

* Simplify files changed header
2018-03-11 16:15:09 -04:00
Paulus Schoutsen
49d51e5040 Merge pull request #13098 from home-assistant/release-0-65-3
0.65.3
2018-03-11 13:14:18 -07:00
tadly
31130f902b Updated jsonrpc-websocket to 0.6 (#13096)
Fix Kodi by updating jsonrpc-websocket to 0.6
2018-03-11 12:52:02 -07:00
Greg Dowling
8603f1a047 Bump pyvera to 0.2.42. Improve event loop robustness. (#13095) 2018-03-11 12:52:01 -07:00
Otto Winter
a34786fb2d Revert "Cast automatically drop connection (#12635)" (#13094)
This reverts commit e14893416f.
2018-03-11 12:52:00 -07:00
Joe Lu
8e51c12010 Integrated with py-synology:0.2.0 which has fix to auto-renew session when it's expired (#13079) 2018-03-11 12:52:00 -07:00
Paulus Schoutsen
e3d176f479 Fix Tado doing async wrong (#13078)
* Fix Tado doing async wrong

* Remove last coroutine decorator
2018-03-11 12:51:59 -07:00
Diogo Gomes
e37619acc1 Convert decimals from SQL results 2018-03-11 12:51:59 -07:00
Jesse Hills
85fa88c8b3 - Bump iGlo Version (#13063)
- Use effect list as a method
2018-03-11 12:51:58 -07:00
Julius Mittenzwei
7935c2504e Fixes KNX fire event problem, issue https://github.com/home-assistant/home-assistant/issues/13049 (#13062) 2018-03-11 12:51:58 -07:00
Paulus Schoutsen
7018806802 Run asyncio event loop in debug mode during tests (#13058)
* Run asyncio event loop in debug mode during tests

* Remove debug mode again
2018-03-11 12:51:57 -07:00
Paulus Schoutsen
a7f34bbce9 Implement Hue available property (#12939) 2018-03-11 12:51:57 -07:00
Paulus Schoutsen
e6683b4c84 Bump version to 0.65.3 2018-03-11 12:51:40 -07:00
tadly
991c457430 Updated jsonrpc-websocket to 0.6 (#13096)
Fix Kodi by updating jsonrpc-websocket to 0.6
2018-03-11 12:46:16 -07:00
Greg Dowling
401e92f84e Bump pyvera to 0.2.42. Improve event loop robustness. (#13095) 2018-03-11 12:43:28 -07:00
Otto Winter
1dc5fa145f Revert "Cast automatically drop connection (#12635)" (#13094)
This reverts commit e14893416f.
2018-03-11 12:42:58 -07:00
Joe Lu
dff4f6ce48 Integrated with py-synology:0.2.0 which has fix to auto-renew session when it's expired (#13079) 2018-03-11 12:33:36 -07:00
Paulus Schoutsen
56b3cb0583 Fix Tado doing async wrong (#13078)
* Fix Tado doing async wrong

* Remove last coroutine decorator
2018-03-11 12:33:07 -07:00
Paulus Schoutsen
d0f089975d Run asyncio event loop in debug mode during tests (#13058)
* Run asyncio event loop in debug mode during tests

* Remove debug mode again
2018-03-11 12:32:12 -07:00
Adam Mills
26960283a0 Config flow translations (#13066)
* Development script for testing translation strings

* Localize backend of config flow

* Fix hue tests

* Update hue.en.json

* Move components to individual directories

* Bridge -> bridge
2018-03-11 12:04:34 -07:00
Matthias Urlichs
f5cc40024d Rename homeassistant.util.async to .async_ (#13088)
"async" is (going to be) a reserved word.
2018-03-11 10:01:12 -07:00
Paulus Schoutsen
d42b5a93dd Implement Hue available property (#12939) 2018-03-11 09:49:28 -07:00
Andrey
3dfc49d311 Make Sensibo climate registry_entity compliant (#13086) 2018-03-11 17:19:25 +01:00
Adam Mills
dc8424032b Remove Z-Wave old/new entity_id attributes (#12652) 2018-03-11 10:30:03 -04:00
Johann Kellerman
f164a5a65f Better errors for unknown secrets (#13072) 2018-03-11 12:51:03 +02:00
Otto Winter
d74a2b68c1 Sensor template don't exit early on TemplateError (#13041)
* Sensor template don't exit early on TemplateError

* Add friendly name unknown state test

* Also track entites from attribute templates

* Use set instead of list
2018-03-10 20:45:32 -08:00
Jesse Hills
458598546d - Bump iGlo Version (#13063)
- Use effect list as a method
2018-03-10 20:31:57 -08:00
Julius Mittenzwei
3f6d30ed06 Fixes KNX fire event problem, issue https://github.com/home-assistant/home-assistant/issues/13049 (#13062) 2018-03-10 20:26:21 -08:00
Diogo Gomes
28ff1f7ac2 Convert decimals from SQL results 2018-03-11 00:27:58 +02:00
Paulus Schoutsen
60aacff827 Merge pull request #13061 from home-assistant/release-0-65-2
0.65.2
2018-03-10 11:11:02 -08:00
Paulus Schoutsen
42359b3b48 Convert decimals from SQL results (#13059) 2018-03-10 10:41:41 -08:00
Paulus Schoutsen
b98d2e2485 Don't call async from sync (#13057) 2018-03-10 10:41:40 -08:00
Sebastian Muszynski
5281892e69 Yeelight version bumped. (#13056) 2018-03-10 10:41:40 -08:00
Anders Melchiorsen
70064e4c69 Fix async lifx_set_state (#13045) 2018-03-10 10:41:40 -08:00
Jerad Meisner
b2d8feb979 Bump pysabnzbd version (#13042) 2018-03-10 10:41:39 -08:00
Johann Kellerman
9a7a0f28b1 Ensure we have valid config AFTER merging packages #13015 (#13038)
* Ensure we have valid config AFTER merging packages #13015

* also fix packages
2018-03-10 10:41:39 -08:00
Paul Tarjan
c7c47a18a9 Use request.query (#13037)
Fixes #13036
2018-03-10 10:41:38 -08:00
John Allen
5726159dd4 Fix sensibo's min/max_temp properties (#12996)
The super class has these as properties, not regular methods
2018-03-10 10:41:38 -08:00
Paulus Schoutsen
0e00de8a33 Convert decimals from SQL results (#13059) 2018-03-10 10:40:28 -08:00
Paulus Schoutsen
266b13b3cb Version bump to 0.65.2 2018-03-10 10:20:30 -08:00
Paulus Schoutsen
c1bb7d5cc2 Update frontend to 20180310.0 2018-03-10 10:20:14 -08:00
Paulus Schoutsen
ae47da7bce Update frontend to 20180310.0 2018-03-10 10:19:49 -08:00
Paulus Schoutsen
f01b5b0040 Don't call async from sync (#13057) 2018-03-10 10:02:16 -08:00
Johann Kellerman
40485a6e89 Ensure we have valid config AFTER merging packages #13015 (#13038)
* Ensure we have valid config AFTER merging packages #13015

* also fix packages
2018-03-10 10:02:04 -08:00
cdce8p
7ea7fc8d38 Script/lint, Lazytox: Fix issue to ignore delete files (#13051)
* Fix issue to ignore delete files

* Updated lazytox
2018-03-10 09:12:23 -08:00
Timmo
86baed4e52 Glances Docker Sensors (#13026)
* Added container count

* Added container count

* Change Name

* Fix if

* Added Docker cpu use and memory use
2018-03-10 18:11:53 +01:00
Sebastian Muszynski
b4b779c49d python-miio version bumped. (#13055) 2018-03-10 09:11:10 -08:00
Sebastian Muszynski
0143752d94 Yeelight version bumped. (#13056) 2018-03-10 09:10:50 -08:00
Anders Melchiorsen
e910ecfd5f Fix async lifx_set_state (#13045) 2018-03-10 11:07:02 +01:00
John Allen
4d74fc2d07 Fix sensibo's min/max_temp properties (#12996)
The super class has these as properties, not regular methods
2018-03-10 10:52:45 +02:00
Paul Tarjan
f9c1675c95 Use request.query (#13037)
Fixes #13036
2018-03-10 00:36:20 -08:00
Jerad Meisner
76fb2447a5 Bump pysabnzbd version (#13042) 2018-03-10 09:27:13 +01:00
Otto Winter
2fae86bbd3 Make lazytox script executable (#13040) 2018-03-10 08:39:49 +01:00
Paulus Schoutsen
905d71c9e3 Merge pull request #13033 from home-assistant/release-0-65-1
0.65.1
2018-03-09 20:17:02 -08:00
Paulus Schoutsen
bf430ad14b Version bump to 0.65.1 2018-03-09 19:42:52 -08:00
cdce8p
a58d8fc68b HomeKit Bugfix: names (#13031)
* Fix display_names, changed default port (+1)

* Revert port change
2018-03-09 19:42:36 -08:00
Paulus Schoutsen
3c41c0c46e Add support for input boolean to Google Assistant (#13030) 2018-03-09 19:42:36 -08:00
Paulus Schoutsen
6ffc53b290 Make Throttle async aware (#13027)
* Make Throttle async aware

* Lint
2018-03-09 19:42:35 -08:00
Johann Kellerman
8f807a3006 Safe fix for #13015 (#13024) 2018-03-09 19:42:35 -08:00
Paulus Schoutsen
34c694c20e allow ios device tracker see calls to go through (#13020) 2018-03-09 19:42:35 -08:00
cdce8p
3ca139e21e HomeKit Bugfix: names (#13031)
* Fix display_names, changed default port (+1)

* Revert port change
2018-03-09 19:41:59 -08:00
Paulus Schoutsen
a8a895a61b allow ios device tracker see calls to go through (#13020) 2018-03-09 19:39:50 -08:00
Paulus Schoutsen
36361d623d Make Throttle async aware (#13027)
* Make Throttle async aware

* Lint
2018-03-09 19:38:51 -08:00
Paulus Schoutsen
652e0d45a9 Add support for input boolean to Google Assistant (#13030) 2018-03-09 19:38:33 -08:00
Heiko Thiery
556901ea48 remove rounding of temperature reading (#13018)
With homeassistant 0.65.0 the filter sensor is introduced. Now there
is a common way to filter the peaks comming from the readings.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2018-03-09 15:53:28 -08:00
Johann Kellerman
05255b9c3f Safe fix for #13015 (#13024) 2018-03-09 15:52:21 -08:00
Paulus Schoutsen
11e1b8a19d Update netdisco to 1.3.0 (#13007) 2018-03-09 13:04:23 -08:00
Johann Kellerman
37d8cd7b75 New lazytox.py script (#12862) 2018-03-09 22:27:39 +02:00
Paulus Schoutsen
ca973b68e0 Merge pull request #12995 from home-assistant/release-0-65
0.65
2018-03-09 09:47:11 -08:00
Ryan McLean
d19a8ec7da Updated to plexapi 3.0.6 (#13005) 2018-03-09 09:31:15 -08:00
Otto Winter
4152ac4aa2 Clean up Light Groups (#12962)
* Clean up Light Groups

* Fix tests

* Remove light group from .coveragerc

* async_schedule_update_ha_state called anyway
2018-03-09 09:31:14 -08:00
mueslo
efdc7042df Add consider_home and source_type to device_tracker.see service (#12849)
* Add consider_home and source_type to device_tracker.see service

* Use schema instead of manual validation

* Extend schema to validate all keys

* Fix style

* Set battery level to int
2018-03-09 09:31:14 -08:00
Ryan McLean
ebf4be3711 Plex mark devices unavailable if they 'vanish' and clear media (#12811)
* Marks Devices unavailable if they 'vanish' and clears media

* Fixed PEP8 complaint

* Fixed Linting

* Lint Fix

* Fix redine of id

* More lint fixes

* Removed redundant loop for setting availability of client
Renamed '_is_device_available' to '_available'
Renamed 'available_ids' to 'available_client_ids'

* removed whitespace per houndCI
2018-03-09 09:31:13 -08:00
Johann Kellerman
16d72d2351 check_config script evolution (#12792)
* Initial async_check_ha_config_file

* check_ha_config_file

* Various fixes

* feedback - return the config

* move_to_check_config
2018-03-09 09:31:13 -08:00
PhracturedBlue
b2210f429e Add camera proxy (#12006)
* Add camera proxy

* Fix additional tox linting issues

* Trivial cleanup

* update to new async/await methods rather than decorators.  Other minor fixes from code review
2018-03-09 09:31:12 -08:00
Steve Easley
7410bc90f0 Get zha switch and binary_sensor state on startup (#11672)
* Get zha switch and binary_sensor state on startup

* Removed unused var

* Make zha switch report status

* Use right method name

* Formatting fix

* Updates to match latest dev

* PR feedback updates

* Use async for cluster commands
2018-03-09 09:31:12 -08:00
Ryan McLean
d8a7c547df Updated to plexapi 3.0.6 (#13005) 2018-03-09 08:50:39 -08:00
Ryan McLean
ecaf0189cc Plex mark devices unavailable if they 'vanish' and clear media (#12811)
* Marks Devices unavailable if they 'vanish' and clears media

* Fixed PEP8 complaint

* Fixed Linting

* Lint Fix

* Fix redine of id

* More lint fixes

* Removed redundant loop for setting availability of client
Renamed '_is_device_available' to '_available'
Renamed 'available_ids' to 'available_client_ids'

* removed whitespace per houndCI
2018-03-09 08:50:21 -08:00
Otto Winter
ca5f470956 Clean up Light Groups (#12962)
* Clean up Light Groups

* Fix tests

* Remove light group from .coveragerc

* async_schedule_update_ha_state called anyway
2018-03-09 06:15:39 -08:00
mueslo
3ba19c52d5 Add consider_home and source_type to device_tracker.see service (#12849)
* Add consider_home and source_type to device_tracker.see service

* Use schema instead of manual validation

* Extend schema to validate all keys

* Fix style

* Set battery level to int
2018-03-08 23:57:21 -08:00
Johann Kellerman
6734c966b3 check_config script evolution (#12792)
* Initial async_check_ha_config_file

* check_ha_config_file

* Various fixes

* feedback - return the config

* move_to_check_config
2018-03-08 19:34:24 -08:00
Steve Easley
5e2296f2a4 Get zha switch and binary_sensor state on startup (#11672)
* Get zha switch and binary_sensor state on startup

* Removed unused var

* Make zha switch report status

* Use right method name

* Formatting fix

* Updates to match latest dev

* PR feedback updates

* Use async for cluster commands
2018-03-08 19:31:52 -08:00
PhracturedBlue
c5228cbc64 Add camera proxy (#12006)
* Add camera proxy

* Fix additional tox linting issues

* Trivial cleanup

* update to new async/await methods rather than decorators.  Other minor fixes from code review
2018-03-08 18:23:52 -08:00
Paulus Schoutsen
7e15f179c6 Bump release 0.65 2018-03-08 17:52:41 -08:00
Boyi C
321eb2ec6f Move HomeAssistantView to separate file. Convert http to async syntax. [skip ci] (#12982)
* Move HomeAssistantView to separate file. Convert http to async syntax.

* pylint

* websocket api

* update emulated_hue for async/await

* Lint
2018-03-08 17:51:49 -08:00
corneyl
2ee73ca911 Fixes notify.html5 for notifications on FireFox (#12993)
* Only pass the gcm_key when using Google Cloud Messaging as endpoint.

* Test if the gcm_key is only included for GCM endpoints.
2018-03-08 17:50:17 -08:00
Anders Melchiorsen
19a529e917 Fix limitlessled color temperature (#12971)
* Adjust limitlessled mired range

* Do temperature conversion on a Kelvin scale
2018-03-08 17:47:53 -08:00
Paulus Schoutsen
7f065e38a7 Check color temp range for google assistant (#12994) 2018-03-08 17:43:41 -08:00
Paulus Schoutsen
c4a4802a8c Bump frontend to 20180309.0 2018-03-08 16:43:23 -08:00
Anders Melchiorsen
44e4f8d1ba Fix Sonos group discovery (#12970)
* Avoid iterating sonos devices that are not yet added

* Rebuild zone topology for each new device
2018-03-08 15:39:31 -08:00
cdce8p
eaf525d41d Script/gen_requirements: Ignore package families (#12963)
* Added fnmatch for IGNORE_PACKAGE_FAMILIES
2018-03-09 00:28:49 +01:00
Jacob Mansfield
6d7dbe5536 Show the error message when Zabbix fails to log in (#12985)
* Show the error message when Zabbix fails to log in

* More verbose name for exception variable
2018-03-08 15:25:10 -08:00
koolsb
ab397e2b1a Update pyalarmdotcom version (#12987)
* Update pyalarmdotcom version

* Update pyalarmdotcom version
2018-03-08 15:24:28 -08:00
John Mihalic
6be81feb2d Bump pyEmby version to support aiohttp => 3 (#12986) 2018-03-08 15:23:51 -08:00
Paulus Schoutsen
9b1a75a74b Refactor Google Assistant (#12959)
* Refactor Google Assistant

* Fix cloud test

* Fix supported features media player demo

* Fix query

* Fix execute

* Fix demo media player tests

* Add tests for traits

* Lint

* Lint

* Add integration tests

* Add more tests

* update logging

* Catch out of range temp errrors

* Fix cloud error

* Lint
2018-03-08 14:39:10 -08:00
Anders Melchiorsen
8792fd22b9 IMAP sensor async/await conversion (#12988) 2018-03-08 21:30:50 +01:00
Anders Melchiorsen
5dd0193ba6 LIFX async/await conversion (#12973)
* LIFX async/await conversion

* async with
2018-03-08 07:24:35 +01:00
Paulus Schoutsen
b159e8acee Hue: Don't change brightness when changing just color (#12940) 2018-03-07 09:51:36 -08:00
Adam Mills
a99c8eb6c6 Pin lokalise script to working version (#12965) 2018-03-07 09:46:21 -05:00
maxclaey
4218b31e7b Add support for alarm system, switch and thermostat to homekit (#12819)
* Added support for security system, switch and thermostat
* Processing review
* Only perform set call when the call didn't come from HomeKit
* Added support for alarm_code
* Take into account review remarks
* Provide tests for HomeKit security systems, switches and thermostats
* Support STATE_AUTO
* Guard if state exists
* Improve support for thermostat auto mode
* Provide both high and low at the same time for home assistant
* Set default values within accepted ranges
* Added tests for auto mode
* Fix thermostat test error
* Use attributes.get instead of indexing for safety
* Avoid hardcoded attributes in tests
2018-03-07 13:17:52 +01:00
ruohan.chen
35bae1eef2 Telegram_bot three platform support proxy_url and proxy_params (#12878)
* telegram_bot three platform support proxy_url and proxy_params

* add telegram_bot._initialize_bot to create the bot instance

* rename _initialize_bot to initialize_bot
2018-03-07 12:44:07 +01:00
Jon Maddox
d119610cf1 Add a Media Player Component for Channels (#12937)
* add Channels media player

* add Channels' services

* style 💄

* more 💄

* make up your mind robot

* 💄 💄 💄

* dump client and pull it in via a package

* ChannelsApp -> ChannelsPlayer

* load the lib

* add pychannels in requirements

* not using requests anymore

* extra line 💄

* move this here

* move this up

* 🔥

* use constants for these

* add a platform schema

* force update here

* get defaults to None

* break out after finding it

* use None for state if offline or errored

* pull in CONF_NAME

* fix syntax

* update requirements_all.txt

* 💄💄💄

* 💄

* docs

* like this? ¯\(°_o)/¯
2018-03-07 00:33:13 -08:00
John Arild Berentsen
4aed41cbe8 BugFix Popp strike lock not discovered in homeassistant. (#12951)
* Add Secure lockbox to lock discovery

* Add Entry_control devices to binary sensors
2018-03-07 00:29:24 -08:00
Anders Melchiorsen
c462292e4d Fix LIFX color conversions (#12957) 2018-03-07 05:55:04 +01:00
Diogo Gomes
b04e7bba9f [SQL Sensor] partial revert of #12452 (#12956)
* partial revert of #12452

* return missing
2018-03-06 16:34:24 -08:00
Christoph Gerneth
e6364b4ff6 optional displaying the sensors location on the map (#12375)
* Changed sensor attributes for GPS

the sensor is now using the correct attributes (latitued and
longitued) which enables them to show up on the map.

* added option to display the sensor on the map

the configuration will be extended by the optional 'show_on_map' flag.
Default is not display the sensor on the map.

* making the change non-breaking: old default behaviour

* removed doubled attributes for lat and lon
2018-03-06 22:53:51 +01:00
Paulus Schoutsen
36b9c0a946 Remove weird tests (#12936)
* Remove mediaroom test
* Fix meraki test doing mac lookups
* Fix flaky unknown device config
* Move more device tracker I/O testing into memory
2018-03-06 21:53:02 +02:00
Michael Pusterhofer
9086119082 Add add_devices back to rpi_camera (#12947)
* Add add_devices back to rpi_camera
2018-03-06 21:44:37 +02:00
Ryan Mounce
dc94079d74 Make ubus dhcp name resolution optional (#12658)
For the case that a separate DHCP server is used or the device is a dumb
WiFi access point, allow device name resolution to be disabled.
2018-03-06 19:16:18 +01:00
karlkar
78c27b99bd Added support for multiple onvif profiles (#11651)
* Added support for multiple profiles

* Removed attributes, setup made synchronous, as it performs I/O
2018-03-05 19:56:15 -08:00
Aaron Bach
f054e9ee54 Updated to enforce quoted ZIP codes for Pollen (#12934) 2018-03-05 19:47:45 -08:00
Anders Melchiorsen
205e83a6d5 Fix netatmo sensor warning from invalid Voluptuous default (#12933) 2018-03-05 19:45:40 -08:00
Diogo Gomes
5063464d5e Support for queries with no results (fix for #12856) (#12888)
* Addresses issue #12856

* error -> warning

* added edge case and test

* uff uff

* Added SELECT validation

* Improved tests
2018-03-05 19:44:04 -08:00
Paulus Schoutsen
38af04c6ce Reinstate our old virtual env check in favor of pip (#12932) 2018-03-05 15:51:37 -08:00
Nicko van Someren
03225cf20f Added checks for empty replies from REST calls and supporting tests (#12904) 2018-03-05 15:30:28 -08:00
Paulus Schoutsen
3682080da2 Bump frontend to 20180305.0 2018-03-05 15:22:44 -08:00
Julius Mittenzwei
13cb9cb07b Bumped (minor) version of xknx within knx-component. This fixes a bug with inverted percentage within sensors. (#12929) 2018-03-05 15:10:45 -08:00
maxclaey
05204a982e Set supported features based on capabilities of device (#12922)
Catch nest APIErrors when setting temperature
2018-03-05 14:57:52 -08:00
Aaron Bach
18b288dcfe Addresses issues with Pollen.com API troubles (#12930)
* Addresses issues with Pollen.com API troubles (#12916)

* Reverted some unnecessary style changes
2018-03-05 14:15:54 -08:00
Paulus Schoutsen
60d7e32f81 Flaky tests (#12931)
* Skip flaky DDWRT tests

* Import APNS before running tests
2018-03-05 14:13:18 -08:00
Paulus Schoutsen
6a5c7ef43f Upgrade to aiohttp 3 (#12921)
* Upgrade aiohttp to 3.0.6

* Fix tests

* Fix aiohttp client stream test

* Lint

* Remove drain
2018-03-05 13:28:41 -08:00
Paulus Schoutsen
e5c4bba906 Remove unused cloud APIs (#12913) 2018-03-05 22:28:15 +01:00
Paulus Schoutsen
e07fb24987 Update python-coinbase to 2.1.0 (#12925) 2018-03-05 22:26:37 +01:00
Sebastian Muszynski
e7b84432f9 Xiaomi MiIO Switch: Allow unavailable devices at startup by model setting (#12626)
* Unavailable state introduced if the device isn't reachable.

* Redundancy removed.

* Pylint fixed.

* Missing space added.

* Pylint fixed.

* Use format instead of concatenation.
2018-03-05 08:25:12 +01:00
Sebastian Muszynski
b0e062b2f8 Xiaomi MiIO Remote: Lazy discover disabled (#12710)
* Lazy discovery disabled: The Chuang Mi IR Remote Controller wants to be re-discovered every 5 minutes. As long as polling is disabled the device should be re-discovered in front of every command.

* Use a unique data key per domain.

* Named argument used and comment added.
2018-03-05 07:06:00 +01:00
Per Osbäck
259121c7a7 update notify html5 dependencies (#12898) 2018-03-04 18:46:09 -08:00
Dan Nixon
326241d9d8 Add empty unit to systemmonitor load averages (#12900)
Adds an empty unit to load averages reported by the systemmonitor
component in order to correctly identify the state as numeric.

A similar workaroud to this is already used for packet counts in the
same component.

Re #11022
2018-03-04 18:41:27 -08:00
Daniel Høyer Iversen
7c7da9df05 Tibber: Check if the current electricity price is available before we… (#12905)
* Tibber: Check if the current electricity price is available before we ask for new prices. await syntax

* tibber
2018-03-04 18:38:21 -08:00
Eduardo Fonseca
cf3f1c3081 Fixing small naming bug (#12911) 2018-03-04 18:37:54 -08:00
Per Osbäck
f00d5cb8ca update html5 to async/await tests (#12896)
* update html5 to async/await tests

* removed paranthesis
2018-03-04 18:35:07 -08:00
Paulus Schoutsen
3920de7119 Fix async method call in sync context (#12890) 2018-03-04 18:31:29 -08:00
Anders Melchiorsen
fd409a16a1 Remove dynamic controls from sonos (#12908) 2018-03-04 18:30:15 -08:00
Richard Lucas
7145afe729 Apple TV should return all supported features (#12167) 2018-03-05 00:04:11 +01:00
Jason Albert
70760b5d3b Fix for moisture sensors in isy994 (#12734)
* Fix for moisture sensors - previously never triggered

* Change quotes to be consistent
2018-03-04 13:59:54 -08:00
Anders Melchiorsen
d418355d4d InfluxDB cleanups (#12903)
* Close influxdb on shutdown

* Ignore inf as an influxdb value

* Remove deprecated CONF_RETRY_QUEUE
2018-03-04 21:01:16 +01:00
Andrei Pop
81ba666db7 Fix Edimax new firmware auth error and move to pyedimax fork (#12873)
* Fixed Edimax switch authentication error for newer firmware.

* pyedimax moved to pypi

* Added pyedimax to gen_requirements_all.py

* Cleanup
2018-03-04 20:36:38 +01:00
Anders Melchiorsen
a147401034 Additional radio schemes for sonos (#12886) 2018-03-04 14:02:31 +01:00
Alan Tse
36e9f523d1 Adding additional switches and sensors for Tesla (#12241)
* Adding switch for maxrange charging and sensors for odometer and range

* Fixing style errors
2018-03-04 11:35:38 +01:00
Per Osbäck
ae257651bf update html5 to async/await (#12895) 2018-03-04 11:20:03 +01:00
Joe Lu
53cc3262bd Upgrade to py-canary 0.4.1 (#12894) 2018-03-04 10:19:12 +01:00
Joe Lu
2e5b4946e1 Fix issue with guest August lock being included (#12893) 2018-03-04 10:14:47 +01:00
Paulus Schoutsen
67c49a7662 Add config flow for Hue (#12830)
* Add config flow for Hue

* Upgrade to aiohue 0.2

* Fix tests

* Add tests

* Add aiohue to test requirements

* Bump aiohue dependency

* Lint

* Lint

* Fix aiohttp mock

* Lint

* Fix tests
2018-03-03 21:28:04 -08:00
Anders Melchiorsen
d06807c634 Improve influxdb throughput (#12882)
* Batch influxdb events for writing

* Name constants
2018-03-03 21:22:31 -08:00
Kevin Tuhumury
2321603eb7 Add the Gamerscore and Tier of the account (#12867)
* Added the Gamerscore and Tier of the account.

The tier is the subscription type of the Xbox Live account, so Silver (which is now called Free) or Gold (paid).

* Don't add the gamerscore and tier inside of the loop, since they're always the same.
2018-03-04 02:38:51 +01:00
a-andre
ba20ffdde7 Fix interaction with hyperion on NodeMCU (#12872)
* Hyperion on NodeMCU has no 'activeEffects' entry

* Hyperion on NodeMCU has non-empty 'activeLedColor' when light is turned off
2018-03-03 17:04:32 -08:00
Paulus Schoutsen
cf8907ed0f Fix aggressive scan intervals (#12885) 2018-03-03 14:03:06 -08:00
Boris K
95176b0666 Fix 0 value when home-assistant restarts (#12874) 2018-03-03 22:59:25 +01:00
Julius Mittenzwei
f0d9844dfb await syntax knx scene (#12879) 2018-03-03 13:55:24 -08:00
Anders Melchiorsen
54f8f1223f Optimize logbook SQL query (#12881) 2018-03-03 13:54:55 -08:00
Anders Melchiorsen
339a839dbe Add SQL index to states.event_id (#12825) 2018-03-03 22:54:38 +01:00
Anders Melchiorsen
e2e10b91a7 Grammar fix 'an unique' (#12870) 2018-03-03 19:23:55 +01:00
JC Connell
a9d242a213 Add support for Zillow Zestimate sensor (#12597)
* Added Zillow Zestimate sensor.

* Add zestimate.py to .coveragerc

* Fix line 167 81>80

* Incorporate tinloaf changes.

* Saving work

* Incorporate changes requested by MartinHjelmare

* Remove unnecessary import

* Add a blank line between standard library and 3rd party imports
2018-03-03 17:41:33 +01:00
Daniel Høyer Iversen
49581a4a2a Add unique id for Tibber sensor (#12864)
Upgrade Tibber libary
2018-03-03 13:18:45 +01:00
Jens Østergaard Nielsen
d8a11fd706 Updated to use latest ihcsdk version (#12865)
* Updated to used latest ihcsdk version

* Updated requirements_all.txt
2018-03-03 12:48:58 +01:00
Anders Melchiorsen
d63cf94d6d Fix dead Sonos web interface even more (#12851) 2018-03-03 00:19:22 -08:00
Sebastian Muszynski
7d8a309017 IndexError (list index out of range) fixed. (#12858) 2018-03-03 00:15:19 -08:00
Otto Winter
99eeb01525 Fix light group update before add (#12844)
* Fix light group update before add.

* Revert pytest skip
2018-03-02 15:04:32 -08:00
Sebastian Muszynski
92b07ba8d1 PyXiaomiGateway version bumped. (#12828) 2018-03-02 12:00:17 -08:00
Paulus Schoutsen
c2b06b9e55 Merge branch 'master' into dev 2018-03-02 11:34:33 -08:00
Anders Melchiorsen
dd67192057 Keep auto groups during group reload (#12841)
* Keep auto groups during group reload

* Make protected member public

* Add test
2018-03-02 11:29:49 -08:00
Paulus Schoutsen
a5ffe0f72b Merge pull request #12848 from home-assistant/release-0-64-3
0.64.3
2018-03-02 11:26:26 -08:00
Ville Skyttä
7937064fb7 Address upcloud post-merge comments (#12011) (#12835) 2018-03-02 11:23:53 -08:00
Daniel Høyer Iversen
0762c7caef Update volvooncall.py (#12834) 2018-03-02 11:23:12 -08:00
Paulus Schoutsen
32b6fb60d8 Handle Hue errors better (#12845)
* Handle Hue errors better

* Lint
2018-03-02 11:22:26 -08:00
Paulus Schoutsen
4a85ab1ecb Cloud unauth (#12840)
* Handle expired refresh token better

* Retry less aggressive

* Newline
2018-03-02 11:22:26 -08:00
Andrey
981f6fa027 Fix sensibo default IDs to be according to schema (#12837) 2018-03-02 11:22:26 -08:00
Johann Kellerman
125088449a is_allowed_path: Also unit test folder #12788 #12807 (#12810) 2018-03-02 11:22:25 -08:00
Paulus Schoutsen
fec7c87ff3 Version bump to 0.64.3 2018-03-02 11:22:05 -08:00
Paulus Schoutsen
d333593aa6 Handle Hue errors better (#12845)
* Handle Hue errors better

* Lint
2018-03-02 11:21:30 -08:00
Paulus Schoutsen
4e03176634 Skip flaky light.group test [skipci] (#12847) 2018-03-02 11:19:19 -08:00
Andrey
e20e0425b1 Fix sensibo default IDs to be according to schema (#12837) 2018-03-02 11:16:48 -08:00
Paulus Schoutsen
228b030c82 Cloud unauth (#12840)
* Handle expired refresh token better

* Retry less aggressive

* Newline
2018-03-02 10:33:05 -08:00
Jeroen ter Heerdt
7a979e9f72 Egardia redesign - generic component and sensor support (#11994)
* Egardia redesign - generic component and sensor support

* Updating .coveragerc and requirements_all

* Fixing linting errors

* Fixing linting errors (again)

* Fixing linting errors

* Responding to review

* Responding to review.

* Updating requirements_all.txt

* Responding to review.

* Responding to review

* Removing unnessesary logging line.

* Responding to review

* Responding to review.

* Fixing copying mistake.

* Responding to review.

* Improving validation.

* Updating package requirement to .38

* Fixing syntax error.

* Updating requirements_all.txt

* Fixing bug handling alarm status.

* Updating requirements_all.txt

* Updating requirements_all.txt

* Changing parsing of configuration.

* Changing code lookup.

* Fixing linting error.
2018-03-02 12:50:00 +01:00
Thijs de Jong
25c4c9b63c Add icons to Xiaomi Aqara sensors (#12814)
* Update xiaomi_aqara.py

* Update xiaomi_aqara.py
2018-03-01 17:15:08 -08:00
Otto Winter
03970764d8 Add light.group platform (#12229)
* Add grouped_light platform

* 📝 Fix Lint issues

* 🎨 Reformat code with yapf

* A Few changes

*  Python 3.5 magic

* Improvements

Included the comments from #11323

* Fixes

* Updates

* Fixes & Tests

* Fix bad-whitespace

* Domain Config Validation

... by rebasing onto #12592

* Style changes & Improvements

* Lint

* Changes according to Review Comments

* Use blocking light.async_turn_*

* Revert "Use blocking light.async_turn_*"

This reverts commit 9e83198552.

* Update service calls and state reporting

* Add group service call tests

* Remove unused constant.
2018-03-01 17:14:26 -08:00
cdce8p
168e1f0e2d Improved Homekit tests (#12800)
* Added test for temperature fahrenheit

* Restructured tests to use more mocks

* Rearanged homekit constants

* Improved 'test_homekit_class'

* Added import statements

* Fix Pylint Test errors
2018-03-01 15:20:02 -08:00
Otto Winter
d3386907a4 MQTT Python 3.5 Async Await Syntax (#12815)
* MQTT Async Await

* Remove unused decorator.
2018-03-01 15:06:26 -08:00
Diogo Gomes
de3c76983a Filter Sensor (#12650)
* filter sensor platform implementation

* added tests

* default arguments

* Fix for unavailable units during initial startup

* unused variable

* Addresses code review by @MartinHjelmare

* fix

* don't need hass in this test

* Various Improvements

* Added Throttle Filter

* hound fixes

* test throttle filter

* fix

* Address comments by @balloob

* added test, reformulated filter tests

* Precision handling

* address comments from @balloob

* Revert "Precision handling"

This reverts commit f4abdd3702.

* removed stats

* only round floats

* Registry decorator usage

* Tries to address remaining comments
2018-03-01 15:03:01 -08:00
Otto Winter
b9d8789771 Cast Python Async Await Syntax (#12816) 2018-03-01 23:25:52 +01:00
Daniel Høyer Iversen
b186b27600 Tibber: retry if we fail to connect at startup (#12620)
* Tibber: retry if we fail to connect at startup

* Tibber: retry if we fail to connect at startup

* Tibber: retry if we fail to connect at startup

* Tibber: retry if we fail to connect at startup

* Update tibber.py

* Update tibber.py
2018-03-01 23:15:27 +01:00
Paulus Schoutsen
3ca446dda1 Version bump to 0.64.2 2018-03-01 11:52:00 -08:00
Paulus Schoutsen
1bc5042bf9 Merge pull request #12808 from home-assistant/release-0-64-2
0.64.2
2018-03-01 11:48:39 -08:00
Paulus Schoutsen
23c39ebefd Fix flakiness in tests (#12806) 2018-03-01 11:47:56 -08:00
Johann Kellerman
ff83efe376 is_allowed_path: Also unit test folder #12788 #12807 (#12810) 2018-03-01 18:55:58 +01:00
cdce8p
17ba813a6d Changed default from all to changed (#12660)
* Default option now '--changed'
* to check all files, use: '--all' or 'tox -e lint'
2018-03-01 18:02:19 +01:00
Greg Dowling
78dd010a04 Merge pull request #12817 from home-assistant/bump_pyloopenergy
Bump pyloopenergy to 0.0.18. Fixes hassio connect issues.
2018-03-01 16:31:10 +00:00
pavoni
88021ba404 Bump pyloopenergy to 0.0.18. Fixes hassio connect issues. 2018-03-01 16:05:18 +00:00
Paulus Schoutsen
491b3d707c Add optional words to conversation utterances (#12772)
* Add optional words to conversation utterances

* Conversation to handle singular/plural

* Remove print

* Add pronounce detection to shopping list

* Lint

* fix tests

* Add optional 2 words

* Fix tests

* Conversation: coroutine -> async/await

* Replace \s with space
2018-03-01 07:35:12 -08:00
Ryan McLean
59141a4063 Unique IDs for Plex Clients (#12799)
* Unique IDs for Clients

* HoundCI cleanup

* debug output removal

* Updates from feedback

* More Updates from feedback

* More Updates from feedback

* Lint Fixes
2018-02-28 23:01:35 -08:00
Anders Melchiorsen
b6805853f1 Fix dead Sonos web interface with some music sources (#12796)
* Get data from soco, not event

* Patch soco.events.parse_event_xml to ignore exceptions
2018-02-28 23:01:34 -08:00
Aaron Bach
7511286a25 Fixed Pollen.com bugs with ZIP codes and invalid API responses (#12790) 2018-02-28 23:01:34 -08:00
Bas Schipper
70979d855d Fixed missing optional keyerror data_bits (#12789) 2018-02-28 23:01:33 -08:00
uchagani
a1010cc63a Update samsungctl library to latest version (#12769)
* update samsungctl library to latest version

* add websocket dependency
2018-02-28 23:01:33 -08:00
Anders Melchiorsen
3a2c3fe589 Silence harmless sonos data structure warnings (#12767) 2018-02-28 23:01:32 -08:00
happyleavesaoc
eeb9992fde bump fedex version (#12764) 2018-02-28 23:01:32 -08:00
Anders Melchiorsen
191f24b2b9 Revert optimized logbook SQL (#12762) 2018-02-28 23:01:31 -08:00
ChristianKuehnel
761b4181c0 updated to bimmer_connected 0.4.1 (#12759)
fixes https://github.com/home-assistant/home-assistant/issues/12698
2018-02-28 23:01:30 -08:00
Paulus Schoutsen
7d8ca2010b Merge remote-tracking branch 'origin/master' into dev 2018-02-28 23:00:44 -08:00
Adam Mills
dbef8f0b78 Only run deploy from lint branch (#12805) 2018-02-28 20:37:40 -08:00
John Mihalic
ed85e368e3 Bump pyHik version, digest auth, more device support (#12801) 2018-02-28 20:33:03 -08:00
John Mihalic
4867ed23dc Take ownership of Emby, Eight Sleep, Hikvision (#12803) 2018-02-28 20:05:37 -08:00
Adam Mills
9f35d4dfca Translation cleanup (#12804)
* Inline load/save JSON

* Skip cleanup on travis deploy
2018-02-28 20:04:20 -08:00
Adam Mills
b434ffba2d Support serving of backend translations (#12453)
* Add view to support backend translation fetching

* Load backend translations from component json

* Translations for season sensor

* Scripts to merge and unpack Lokalise translations

* Fix copy paste error

* Serve post-lokalise translations to frontend

* Linting

* Auto-deploy translations with Travis

* Commit post-lokalise translation files

* Split logic into more helper functions

* Fall back to English for missing keys

* Move local translation copies to `.translations`

* Linting

* Initial tests

* Remove unnecessary file check

* Convert translation helper to async/await

* Convert translation helper tests to async/await

* Use set subtraction to find missing_components

* load_translation_files use component->file mapping

* Remove duplicated resources fetching

Get to take advantage of the slick Python 3.5 dict merging here.

* Switch to live project ID
2018-02-28 19:31:38 -08:00
Ryan McLean
a60712d826 Unique IDs for Plex Clients (#12799)
* Unique IDs for Clients

* HoundCI cleanup

* debug output removal

* Updates from feedback

* More Updates from feedback

* More Updates from feedback

* Lint Fixes
2018-02-28 17:53:51 -08:00
Reed Riley
53078f3069 iCloud location tracking improvements (#12399)
* Add an error message when there are name collisions in iCloud

* Teach icloud component to set interval based on proximity to nearest zone.
2018-02-28 16:54:19 -08:00
Mike O'Driscoll
3416d3f5f1 TekSavvy Sensor unlimited bandwidth support (#12325)
* Support TekSavvy Unlimited Plans

Support TekSavvy account usage for unlimited plans.
Seeing cap limit to 0 will now provide unlimited behaviour on usage calculations.

* Add unit tests to sensor.teksavvy

Add coverage unit tests to TekSavvy Sensor component, none existing previously.
2018-02-28 16:21:10 -08:00
Anders Melchiorsen
b1cc9bf452 Fix dead Sonos web interface with some music sources (#12796)
* Get data from soco, not event

* Patch soco.events.parse_event_xml to ignore exceptions
2018-02-28 16:10:58 -08:00
kbickar
6fe6dcfac9 Added Sense energy monitor sensor (#11580)
* Added Sense energy monitor sensor

* Added missing =

* Style updates

* Added newline, but not blank line at end of file

* Updated sense API to 0.2.2

* Moved import in function

* Fixed tabs

* Updated requirements

* Removed bare except

* Longer update times and more stats

* sense api update

* Updated to use string formatting

* Setup to use monitored_conditions

* Fix syntax

* API update

* blank space fixes

* More blank fixes

* API version update

* Fixed comment format

* removed unneeded function call
2018-02-28 14:29:24 -08:00
Maximilian Früh
001515bdc4 Add "headers" config parameter to rest switch (#12706)
* Add "headers" config parameter to rest switch

* Minor fix: line length
2018-02-28 14:00:51 -08:00
Otto Winter
c1aaef28a9 MQTT Static Typing (#12433)
* MQTT Typing

* Tiny style change

* Fixes

I should've probably really sticked to limiting myself to static typing...

* Small fix 😩

Ok, this seriously shouldn't have happened.
2018-02-28 22:59:14 +01:00
Paulus Schoutsen
f7e9215f5e Fix when 2 states match with same name (#12771) 2018-02-28 13:39:01 -08:00
Paulus Schoutsen
e2a2fe36fc Bump frontend to 20180228.1 (#12786)
* Bump frontend to 20180228.1

* Update reqs
2018-02-28 13:26:49 -08:00
Sean Wilson
3628fcf083 Add 'lock' device class (#11640)
* Add 'lock' device class

* Invert lock settings as per https://github.com/home-assistant/home-assistant/pull/11640
2018-02-28 13:26:25 -08:00
Bertbert
44cad7df30 Add Unit System Option For Fitbit (#11817)
* Add Unit System Option For Fitbit

* Update fitbit.py

* Update fitbit.py
2018-02-28 13:18:50 -08:00
Ville Skyttä
bbd58d7357 Add UpCloud platform (#12011)
* Add UpCloud platform

* Update upcloud-api to 0.4.1

* Update upcloud-api to 0.4.2

* Convert UpCloud to use Entity, helpers.dispatcher

* Lint
2018-02-28 13:17:12 -08:00
Sebastian Muszynski
222748dfbf Xiaomi MiIO Vacuum: Use a unique data key per domain (#12743)
* Use a unique data key per domain.

* Tests fixed.
2018-02-28 13:15:45 -08:00
Aaron Bach
a0eca9c6d1 Fixed Pollen.com bugs with ZIP codes and invalid API responses (#12790) 2018-02-28 13:09:57 -08:00
Bas Schipper
b556b86301 Fixed missing optional keyerror data_bits (#12789) 2018-02-28 13:07:23 -08:00
Philip Rosenberg-Watt
e82b358831 Round humidity for display purposes (#12766)
Humidity was not being rounded as temperature was. This change fixes
that.
2018-02-28 10:59:47 -08:00
uchagani
9658f4383c Update samsungctl library to latest version (#12769)
* update samsungctl library to latest version

* add websocket dependency
2018-02-28 07:37:12 +01:00
James Marsh
f6c504610b Add custom header support for rest_command (#12646)
* Add support for specifying custom headers for rest_command.
* Added headers configuration to behave similarly to the rest sensor.
* Replaced test_rest_command_content_type which only validated the
  configuration with test_rest_command_headers which tests several
  combinations of parameters that affect the request headers.
2018-02-28 08:16:31 +02:00
Paulus Schoutsen
f5c633415d Bump frontend to 20180228.0 2018-02-27 20:49:59 -08:00
Aaron Bach
c5157c1027 Update Yi platform to make use of async/await (#12713) 2018-02-27 18:06:45 -08:00
ChristianKuehnel
bba1e2adc9 updated to bimmer_connected 0.4.1 (#12759)
fixes https://github.com/home-assistant/home-assistant/issues/12698
2018-02-27 18:05:38 -08:00
Anders Melchiorsen
a63714dc86 Revert optimized logbook SQL (#12762) 2018-02-27 18:04:55 -08:00
happyleavesaoc
ab74ac8eca bump fedex version (#12764) 2018-02-27 18:04:30 -08:00
Anders Melchiorsen
f19b934869 Silence harmless sonos data structure warnings (#12767) 2018-02-27 18:04:00 -08:00
Paulus Schoutsen
efd155dd3c Intent: Set light color (#12633)
* Make color_name_to_rgb raise

* Add Light Set Color intent

* Move some methods around

* Cleanup

* Prevent 1 more func call

* Make a generic Set intent for light

* Lint

* lint
2018-02-27 18:02:21 -08:00
Anders Melchiorsen
14d052d242 Quote services.yaml string (#12763) 2018-02-28 00:16:49 +01:00
Teemu R
39cee987d9 Add Songpal ("Sony Audio Control API") platform (#12143)
* Add Songpal ("Sony Audio Control API") platform

This adds support for a variety of Sony soundbars and potentially
many more devices using the same API.
See http://vssupport.sony.net/en_ww/device.html for list of
supported devices.

* add songpal requirement

* update coveragerc

* fix linting

* add service description to yaml

* add entity_id

* make pylint also happy.

* raise PlatformNotReady when initialization fails, bump requirement for better exception handling

* use noqa instead of pylint's disable, fix newline error

* use async defs and awaits

* Make linter happy

* Changes based on code review, fix set_sound_setting.

* define set_sound_setting schema on top of the file

* Move initialization back to async_setup_platform

* Fix linting

* Fixes based on code review

* Fix coveragerc ordering
* Do not print out the whole exception trace when failing to update
* Do not bail out when receiving more than one volume control
* Set to unavailable when no volume controls are available
2018-02-27 13:21:56 -08:00
Johann Kellerman
6ed765698a Check_config await error (#12722)
* not awaited

* hounded
2018-02-27 12:29:17 -08:00
Sebastian Muszynski
138350fe3d Xiaomi MiIO Light: Flag the device as unavailable if not reachable (#12449)
* Unavailable state introduced if the device isn't reachable.
A new configuration option "model" can be used to define the device type.

```
light:
  - platform: xiaomi_miio
    name: Xiaomi Philips Smart LED Ball
    host: 192.168.130.67
    token: da548d86f55996413d82eea94279d2ff
    # Bypass of the device model detection.
    # Optional but required to add an unavailable device
    model: philips.light.bulb
```

New attribute "scene" and "delay_off_countdown" added.
New service xiaomi_miio_set_delay_off introduced.

* Service xiaomi_miio_set_delayed_turn_off updated. The attribute "delayed_turn_off" is a timestamp now.

* None must be a valid model.

* Math.

* Microseconds removed because of the low resolution.

* Comment updated.

* Update the ATTR_DELAYED_TURN_OFF on a deviation of 4 seconds (max latency) only.

* Import of datetime fixed.

* Typo fixed.

* pylint issues fixed.

* Naming.

* Service parameter renamed.

* New ceiling lamp model (philips.light.zyceiling) added.

* Use positive timedelta instead of seconds.

* Use a unique data key per domain.
2018-02-27 12:27:52 -08:00
Paulus Schoutsen
88b7f429c8 Merge pull request #12742 from home-assistant/release-0-64-1
0.64.1
2018-02-27 11:24:37 -08:00
Philip Rosenberg-Watt
992516ba86 Fix DarkSky floating-point math (#12753)
DarkSky delivers relative humidity from 0-100% as a 0-1 decimal value,
so we convert it by multiplying by 100.0. Unfortunately, due to floating
point math, the display of a raw value of 0.29 ends up looking like
28.999999999999996% relative humidity.

This change rounds the value to two decimal places.
2018-02-27 11:22:16 -08:00
Otto Winter
484841c890 Fix MQTT async_add_job in sync context (#12744) 2018-02-27 11:22:16 -08:00
Philip Rosenberg-Watt
4e522448b1 Fix DarkSky floating-point math (#12753)
DarkSky delivers relative humidity from 0-100% as a 0-1 decimal value,
so we convert it by multiplying by 100.0. Unfortunately, due to floating
point math, the display of a raw value of 0.29 ends up looking like
28.999999999999996% relative humidity.

This change rounds the value to two decimal places.
2018-02-27 11:19:02 -08:00
Otto Winter
8645f244da Fix MQTT async_add_job in sync context (#12744) 2018-02-27 11:18:20 -08:00
Lev Aronsky
be64422d1c Fix Citybikes naming (#12661)
* Fix Citybikes naming.

* Semantic fixes upon requests.

Entity ID generation now includes the base name (again),
resulting in preservation of the entity ID format (the change is
non-breaking)

* Use `async_generate_entity_id`.
2018-02-27 14:22:52 +01:00
Paulus Schoutsen
a0997bd214 Update ZHA deps (#12737) 2018-02-27 02:01:57 -08:00
Anders Melchiorsen
802bc322e8 Fix harmony duplicate detection (#12729) 2018-02-27 02:01:56 -08:00
ChristianKuehnel
ed8eda86e2 fix for https://github.com/home-assistant/home-assistant/issues/12673 (#12726) 2018-02-27 02:01:56 -08:00
Thijs de Jong
bbc2f1d808 Unbreak tahoma (#12719)
* Update requirements_all.txt

* Update tahoma.py
2018-02-27 02:01:55 -08:00
Pascal Vizeli
83203a10a7 Don't allow to use a old unsecure library (#12715)
* Don't allow to use a old unsecury library

* Update gen_requirements_all.py

* Cryptodome fix for python-broadlink

* Coinbase cryptodome fix
2018-02-27 02:01:54 -08:00
Oliver
113ea2d1dc Bugfix: Update of sources for non AVR-X devices always fails (#12711)
* Basic support of post 2016 AVR-X receivers

* Bugfix: Update of sources for non AVR-X devices always fails
2018-02-27 02:01:54 -08:00
tumik
d128f4e51f Component deconz: Fix dark attribute on presence sensors (#12691)
pydeconz changed PRESENCE to be an array in v25, so this code hasn't worked since that change.
2018-02-27 02:01:54 -08:00
Paulus Schoutsen
de3a9d552a Fix mysensor defaults (#12687) 2018-02-27 02:01:53 -08:00
Jesse Hills
948ef7523e Fix getting state from iglo (#12685) 2018-02-27 02:01:53 -08:00
Paulus Schoutsen
9e8340432c Harmony: make activity optional (#12679) 2018-02-27 02:01:52 -08:00
Lev Aronsky
0a067f4cc7 Fix a problem with calling deconz.close (#12657)
* Fix a problem with calling `deconz.close`

The event object (`EVENT_HOMEASSISTANT_STOP`) is sent as an argument to
the callable passed to `async_listen_once`. However, `deconz.close` is a bound method
that takes no arguments. Therefore, it needs a wrapper to discard the event
object.

* Removed unnecessary code and added a docstring.

* Fix the docstring according to guidelines.

* Removed unnecessary whitespace.
2018-02-27 02:01:52 -08:00
Johann Kellerman
68f92d2e7c Roomba timeout (#12645)
* Roomba timeout

* PlatformNotReady
2018-02-27 02:01:51 -08:00
Otto Winter
e14893416f Cast automatically drop connection (#12635) 2018-02-27 02:01:51 -08:00
Pascal Vizeli
9751fed493 Don't allow to use a old unsecure library (#12715)
* Don't allow to use a old unsecury library

* Update gen_requirements_all.py

* Cryptodome fix for python-broadlink

* Coinbase cryptodome fix
2018-02-27 01:58:45 -08:00
Paulus Schoutsen
dc8c331c68 Update ZHA deps (#12737) 2018-02-27 00:05:29 -08:00
Jesse Hills
d052d45712 Fix getting state from iglo (#12685) 2018-02-26 23:07:39 -08:00
Adam Mills
4242411089 Disable asuswrt tests (#12663) 2018-02-26 22:53:54 -08:00
tumik
f396266c74 Component deconz: Fix dark attribute on presence sensors (#12691)
pydeconz changed PRESENCE to be an array in v25, so this code hasn't worked since that change.
2018-02-26 22:44:57 -08:00
Oliver
21d8ecdacd Bugfix: Update of sources for non AVR-X devices always fails (#12711)
* Basic support of post 2016 AVR-X receivers

* Bugfix: Update of sources for non AVR-X devices always fails
2018-02-26 22:44:11 -08:00
ChristianKuehnel
6bdb2fe5a0 fix for https://github.com/home-assistant/home-assistant/issues/12673 (#12726) 2018-02-26 22:42:32 -08:00
Anders Melchiorsen
c1c23bb4b6 Remove automatic sqlite vacuum (#12728) 2018-02-26 22:41:37 -08:00
Anders Melchiorsen
98fef81d19 Fix harmony duplicate detection (#12729) 2018-02-26 22:40:46 -08:00
Thiago Oliveira
71cab65df6 correct air index unit (#12730)
AirVisual's air index unit is AQI (Air Quality Index), not PSI (Pressure per Square Inch). More details can be found at https://airvisual.com/

Cheers,
2018-02-26 22:39:26 -08:00
Lev Aronsky
111e515da7 Fix a problem with calling deconz.close (#12657)
* Fix a problem with calling `deconz.close`

The event object (`EVENT_HOMEASSISTANT_STOP`) is sent as an argument to
the callable passed to `async_listen_once`. However, `deconz.close` is a bound method
that takes no arguments. Therefore, it needs a wrapper to discard the event
object.

* Removed unnecessary code and added a docstring.

* Fix the docstring according to guidelines.

* Removed unnecessary whitespace.
2018-02-27 07:31:47 +01:00
Paulus Schoutsen
f7fc4c6f15 Frontend bump to 20180227.0 2018-02-26 22:24:31 -08:00
Paulus Schoutsen
a783006f92 Version bump to 0.64.1 2018-02-26 22:23:53 -08:00
Paulus Schoutsen
5b8aeafdb9 Frontend bump to 20180227.0 2018-02-26 22:21:10 -08:00
Adam Mills
c1a6131aa8 Update core HSV color scaling to standard scales: (#12649)
Hue is scaled 0-360
Sat is scaled 0-100
Val is scaled 0-100
2018-02-26 22:20:24 -05:00
Johann Kellerman
4821858afb Homekit schema gracefully fail with integer (#12725)
* Homekit schema gracefully fail with integer
* Fix return value
* Added test
* Fix 2
2018-02-27 01:09:49 +01:00
Johann Kellerman
446390a8d1 AsusWRT log exceptions (#12668)
* logexception

* Improve err message #2978

* not quiet

* tests
2018-02-26 16:08:37 -08:00
cdce8p
6a665ffb84 Fix homekit: temperature calculation (#12720) 2018-02-26 22:29:52 +01:00
Thijs de Jong
10570f5ad6 Unbreak tahoma (#12719)
* Update requirements_all.txt

* Update tahoma.py
2018-02-26 22:27:20 +01:00
Sebastian Muszynski
2c1083bda1 Next generation of Xiaomi Aqara devices added (#12659)
* Next generation of Xiaomi Aqara devices added: ctrl_neutral1.aq1, ctrl_neutral2.aq1, ctrl_ln1.aq1, ctrl_ln2.aq1, ctrl_86plug.aq1

* The Aqara wireless button (3rd gen, sensor_switch.aq3) supports a click_type called "shake".

* Warning added to spot new features.
2018-02-26 21:54:06 +01:00
Paulus Schoutsen
f8a0a0ba59 Fix mysensor defaults (#12687) 2018-02-26 17:01:00 +01:00
Paulus Schoutsen
1d14a17ffd Harmony: make activity optional (#12679) 2018-02-26 01:11:28 -08:00
Paulus Schoutsen
a8c9303892 Add history_graph component to demo (#12681) 2018-02-26 00:28:25 -08:00
Robin
bf41674e06 Adds simulated sensor (#12539)
* Create simulated.py

* Create test_simulated.py

* Update .coveragerc

* Drop numpy and fix attributes

Drop numpy and fix attributes to be machine readble

* Update test_simulated.py

* Update simulated.py

* Update test_simulated.py

* Update simulated.py

* Update test_simulated.py

* Update simulated.py

* Update simulated.py

* Update test_simulated.py

* Update simulated.py

* Fix default random seed error

* Update simulated.py

* Addresses balloob comments

* Update simulated.py
2018-02-26 00:01:01 -08:00
cdce8p
6e6ae173fd Added config validator for future group platforms (#12592)
* Added cv.EntitiesDoamin(domain) validator

* Check if all entities in string or list belong to domain
* Added tests

* Use factory function and entity_ids

* Different error message

* Typo

* Added entity_domain validator for a single entity_id

* Image_processing platform now uses cv.entity_domain for source validation
2018-02-25 23:48:21 -08:00
Julius Mittenzwei
7d5c1581f1 KNX Component: Scene support and expose sensor values (#11978)
* XKNX improvements: Added Scene support, added support for exposing sensors to KNX bus, added reset value option for binary switches

* fixed import

* Bumped version of KNX library (minor upgrade with two important bugfixes)

* bumped version of xknx (now without python requirement *sigh*)

* Issue #11978: fixed review comments

* Issue #11978: hound suggestion fixed:

* review comments

* made async functions async

* Addressed issues mentined by @MartinHjelmare

* removed default=None from validation schema

* ATTR_ENTITY_ID->CONF_ENTITY_ID

* moved missing function to async syntax

* pylint

* Trigger notification

* Trigger notification

* fixed review comment
2018-02-25 23:44:09 -08:00
Johann Kellerman
6d5fb49687 Roomba timeout (#12645)
* Roomba timeout

* PlatformNotReady
2018-02-25 23:43:26 -08:00
awkwardDuck
e96ac74b11 Fix formatting of minutes for sleep start in the fitbit sensor (#12664)
* fix formatting of minutes for sleep start

https://github.com/home-assistant/home-assistant/issues/12594

* Update fitbit.py
2018-02-25 19:28:41 -08:00
cdce8p
27b1d448a3 Homekit Update, Support for TempSensor (°F) (#12676)
* Changed version of "HAP-python" to "v1.1.7"

* Updated acc file to simplify init calls

* Code refactored and '°F' temp Sensors added

* Changed call to 'HomeAccessory' and 'HomeBridge'
* Extended function of 'add_preload_service' to add additional characteristics
* Added function to override characteristic property values

* TemperatureSensor
  * Added unit
  * Added calc_temperature

* Updated tests
2018-02-25 19:27:40 -08:00
Paulus Schoutsen
84c156e8f5 Version bump to 0.64 2018-02-25 13:17:47 -08:00
Paulus Schoutsen
5dcf92fa2a Merge pull request #12609 from home-assistant/release-0-64
0.64.0
2018-02-25 12:25:02 -08:00
Paulus Schoutsen
6c614df96e Remove braviatv_psk (#12669) 2018-02-25 11:51:45 -08:00
Paulus Schoutsen
347ba1a2d8 Remove braviatv_psk (#12669) 2018-02-25 11:50:06 -08:00
Otto Winter
8d0d676ff2 Fix cast doing I/O in event loop (#12632) 2018-02-25 11:33:56 -08:00
Sebastian Muszynski
781b7687a4 The name of the enum must be used here because of the speed_list. (#12625)
The fan.set_speed example value is lower-case and led to confusion. Both spellings are possible now: Idle & idle
2018-02-25 11:33:56 -08:00
Pascal Vizeli
286baed9ad Hassio update timeout filter list (#12617)
* Update timeout filter list

* Update http.py
2018-02-25 11:33:55 -08:00
Anders Melchiorsen
43ad3ae2d4 Move recorder query out of event loop (#12615) 2018-02-25 11:33:55 -08:00
Scott Bradshaw
19d34daef0 OpenGarage - correctly handle offline status (#12612) (#12613) 2018-02-25 11:33:54 -08:00
Paulus Schoutsen
7c80ef714e Fix voluptuous breaking change things (#12611)
* Fix voluptuous breaking change things

* Change xiaomi aqara back
2018-02-25 11:33:54 -08:00
Anders Melchiorsen
9ca67c36cd Optimize logbook SQL query (#12608) 2018-02-25 11:33:53 -08:00
Thijs de Jong
6aa8916654 Add Tahoma scenes (#12498)
* add scenes to platform

* add scene.tahoma

* requires tahoma-api 0.0.12

* update requirements_all.txt

* hound

* fix pylint error
2018-02-25 11:33:53 -08:00
Otto Winter
2261ce30e3 Cast unique_id and async discovery (#12474)
* Cast unique_id and async discovery

* Lazily load chromecasts

* Lint

* Fixes & Improvements

* Fixes

* Improve disconnects

cast.disconnect with blocking=False does **not** do I/O; it simply sets an event for the socket client looper

* Add tests

* Remove unnecessary calls

* Lint

* Fix use of hass object
2018-02-25 11:33:52 -08:00
kennedyshead
7f5ca314ec Fix mclimate accounts with not only melissa components (#12427)
* Fixes for mclimate accounts with not only melissa components

* Fixes melissa sensor to only use HVAC

* Bumping version to 1.0.3 and remove OP_MODE that is not supported

* Removes STATE_AUTO from translation and tests
2018-02-25 11:33:52 -08:00
Tom Harris
32166fd56a Upgrade insteonplm to 0.8.2 (required refactoring) (#12534)
* Merge from current dev

* Update for Sensor approach

* Update reference to state classes

* Reference stateKey correctly

* Reference stateKey

* Change deviceInfo to a dict

* Pass state to properties method

* Add state info to device_state_attributes

* Update entity name to include state name

* Update for on() off() vs light_on/off

* Flag newnames option

* Update configuration schema

* Update configuration schema

* Spell False correctly

* Rename state to statekey

* Rename statekey to stateKey

* Call new device with stateKey and newname

* Simplify use of newnames

* Add workdir to save devices

* Fix newnames config setup

* Propogate OnOffSensor to VariableSensor change

* Upgrade insteonplm version to 0.8.0

* Pass address rather than device object to platform

* Set inteon_plm data variable to PLM

* Consistant use of conn and plm

* Consistant use of conn and plm

* Proper reference to device and address

* Fixed platform setup issues

* Correct issue with missing _supported_features attr

* Properly reference self._state vs self.state

* Bump insteonplm version to 0.8.1

* Remove subplatform and map based on state name

* Correct refrence to State

* Correct reference to device.states

* Bump insteonplm to 0.8.2

* Fix format errors

* Fix format issues

* Fix trailing whitespace

* Correct format issues

* Fix format issues

* Fix format issues

* Fixed format issues

* Fixed format issues

* Move imports inside classes

* Simplify import of modules

* Correct reference to OnOffSwitch_OutletTop and bottom

* Remove unnessary references

* Fix format issues

* Code review adjustments

* Fix format issue

* Use new nameing format for groups that are not group 0x01

* Remove newname feature

* Fix binary_sensor type to default to None

* Fix device_class property to return the sensor type correctly.

* rename _device and _state to avoid conflicts with Entity

* Format long lines

* Pylint clean up

* Insteon_PLM

* lint cleanup

* Check device_override has address

* 3.4 lint clean up

* Changes per code review

* Change discovered from a list of dict to a dict

* Correct common_attributes usage

* Change discovered from a list of dict to a dict

* Add debugging message to confirm platform setup

* Debug messages

* Debug messages

* Debug async_added_to_hass

* Debug async_added_to_hass async_add_job

* Debug async_added_to_hass

* Debug devices not loading in hass

* Debug new entities not being added to hass

* Debug adding devices to hass

* Revert "3.4 lint clean up"

This reverts commit 0d8fb992b1.

* 3.4 lint clean up

* Revert "Debug adding devices to hass"

This reverts commit ec306773d4.

* Revert "Debug new entities not being added to hass"

This reverts commit 55fb724d06.

* Revert "Debug devices not loading in hass"

This reverts commit 07814b4f14.

* Revert "Debug async_added_to_hass"

This reverts commit 4963a255d8.

* Revert "Debug async_added_to_hass async_add_job"

This reverts commit 22cadff91f.

* Revert "Debug async_added_to_hass"

This reverts commit 12c5651fe4.

* Pylint clean up

* pylint cleanup

* Clean up naming

* Enhance config schema. Fix logging issue

* Reapply changes after squash
2018-02-25 20:13:39 +01:00
Lewis Juggins
e8173fbc16 Enable pytradfri during build, and include in Docker (#12662) 2018-02-25 18:20:43 +00:00
Mike Megally
63552abce5 Synology Chat as a notification platform (#12596)
* first attempt at synology chat as a notification platform

* quick fix

* houndci and coverage

* Cleanup

Some cleanup of the file

* Ugh underscore

* Use string formatting

* Remove `CONF_NAME`
2018-02-25 14:47:46 +01:00
Julius Mittenzwei
16cb7388ee Removing asyncio.coroutine syntax from HASS core (#12509)
* changed asyncio.coroutine syntax to new async def/await

* removed py34 from tox environment

* reverted some changes within entity.py

* -

* reverted changes within bootstrap.py

* reverted changes within discovery.py

* switched decorators

* Reverted change within aiohttp_client.py

* reverted change within logging.py

* switched decorators

* Await lock properly

* removed asyncio.coroutine from test
2018-02-25 03:38:46 -08:00
cdce8p
eacfbc048a Improved Homekit tests (#12647)
* Spelling and typos
* Updated 'test_homekit_pyhap_interaction'
* Patch ip_address
2018-02-25 10:58:13 +01:00
cdce8p
da832dbda2 Removed py34 (#12648) 2018-02-25 08:05:20 +01:00
Adam Mills
f51a3738aa Check if $files is empty, don't try to execute it (#12651) 2018-02-24 22:11:49 -05:00
Paulus Schoutsen
6d431c3fc3 Allow renaming entities in entity registry (#12636)
* Allow renaming entities in entity registry

* Lint
2018-02-24 10:53:59 -08:00
Otto Winter
2821820281 Cast automatically drop connection (#12635) 2018-02-24 10:27:44 -08:00
Julius Mittenzwei
3713dfe139 Removing asyncio.coroutine syntax from some components (#12507)
* Removing asyncio.coroutine syntax (first steps)

* merge conflict

* fixed small bug

* pylint
2018-02-24 10:24:33 -08:00
Otto Winter
c076b805e7 Fix cast doing I/O in event loop (#12632) 2018-02-23 15:13:48 -08:00
kennedyshead
7a44eee093 Fix mclimate accounts with not only melissa components (#12427)
* Fixes for mclimate accounts with not only melissa components

* Fixes melissa sensor to only use HVAC

* Bumping version to 1.0.3 and remove OP_MODE that is not supported

* Removes STATE_AUTO from translation and tests
2018-02-23 23:33:12 +01:00
Sebastian Muszynski
485979cd86 Xiaomi Aqara Gateway: Service descriptions added (#12631)
* Service descriptions of the Xiaomi Aqara Gateway added.

* Descriptions added.
2018-02-23 22:33:51 +01:00
Pascal Vizeli
5a80d4e5ea Hassio update timeout filter list (#12617)
* Update timeout filter list

* Update http.py
2018-02-23 10:13:04 -08:00
Sebastian Muszynski
c3d322f26c The name of the enum must be used here because of the speed_list. (#12625)
The fan.set_speed example value is lower-case and led to confusion. Both spellings are possible now: Idle & idle
2018-02-23 10:11:54 -08:00
Otto Winter
230b73d14a Cast unique_id and async discovery (#12474)
* Cast unique_id and async discovery

* Lazily load chromecasts

* Lint

* Fixes & Improvements

* Fixes

* Improve disconnects

cast.disconnect with blocking=False does **not** do I/O; it simply sets an event for the socket client looper

* Add tests

* Remove unnecessary calls

* Lint

* Fix use of hass object
2018-02-23 09:31:22 -08:00
Otto Winter
042f292e4f Fix CODEOWNERS permissions (#12621) 2018-02-23 14:57:49 +01:00
Thijs de Jong
daa00bc65a Add Tahoma scenes (#12498)
* add scenes to platform

* add scene.tahoma

* requires tahoma-api 0.0.12

* update requirements_all.txt

* hound

* fix pylint error
2018-02-23 13:03:00 +01:00
Anders Melchiorsen
1b22f2d8b8 Move recorder query out of event loop (#12615) 2018-02-23 10:12:40 +01:00
Paulus Schoutsen
1e672b93e7 Fix voluptuous breaking change things (#12611)
* Fix voluptuous breaking change things

* Change xiaomi aqara back
2018-02-22 23:29:42 -08:00
Paulus Schoutsen
6ee3c1b3e5 Hello Python 3.5 (#12610)
* Hello Python 3.5

* Fix test

* Fix tests

* Fix never awaited block till done warnings
2018-02-22 23:22:27 -08:00
Scott Bradshaw
156206dfee OpenGarage - correctly handle offline status (#12612) (#12613) 2018-02-22 21:53:08 -08:00
Anders Melchiorsen
7dcb2ae24c Optimize logbook SQL query (#12608) 2018-02-22 15:40:58 -08:00
Paulus Schoutsen
6b03cb913c Version bump to 0.65.0.dev0 2018-02-22 15:35:24 -08:00
Paulus Schoutsen
079724be05 Merge remote-tracking branch 'origin/master' into dev 2018-02-22 15:32:07 -08:00
Jeremy Klein
f899ce8fbf Adding RoomHinting to GoogleAssistant to allow for room annotations. (#12598) 2018-02-22 15:24:41 -08:00
cdce8p
ffd3889271 Updated script/lint (#12600)
* Compare to common ancestor
* Check if no file was changed
2018-02-22 15:22:59 -08:00
Sebastian Muszynski
87c69452f9 Set speed service fixed. (#12602) 2018-02-22 15:21:36 -08:00
Gerard
1af65f8f23 Component for Sony Bravia TV with Pre-Shared Key (#12464) 2018-02-22 21:09:52 +00:00
Mike Megally
f0a1beac5d Allow ignoring call service events in mqtt_eventstream (#12519)
* [WIP] Allow ignoring call service events

This allows a setting a configuration value (False by default to continue the current behavior) which will ignore call service events.

* extra spaces

removed them

* updates from PR review

* removed print

* update spacing

* updated allowed events to allow for custom events, and included some tests

* hound fixes

* Remove unused constant

* Lint
2018-02-22 11:19:18 +01:00
JC Connell
4fdbbc497d Python spotcrime (#12460)
* Added python-spotcrime sensor

* Added python-spotcrime sensor

* Remove accidental included file

* Update indentation to match PEP8

* Remove days from const.py

* Changed default days to 1

* Incorporate changes requested by MartinHjelmare

* Remove unnecessary import and fix lint error
2018-02-21 23:47:15 -08:00
Paulus Schoutsen
de72eb8fe9 Make groups entities again (#12574) 2018-02-21 23:42:23 -08:00
Lukas Barth
2a4971dec7 Add unique_id to Xiaomi Aqara (#12372)
* Add unique_id to Xiaomi Aqara

* Slugify the unique ID

* Use the domain instead of a separate string

* Add underscore

* Remove unique ID from attributes

* Re-add removed attributes

* Remove domain from the unique ID

* Use type or data key

* Also make sure that the data key is not None

* Yes, it does have that member, if that check passes. Thanks pylint.
2018-02-21 23:36:39 -08:00
Robin
4d7fb2c7de Adds folder sensor (#12208)
* Adds folder sensor

The state of the sensor is the time that the most recently modified
file in a folder was modified.

* Address lint errors

* Edit docstrings

Makes the recommended edits to docstrings

* Update .coveragerc

Add sensor/folder.py

* Update folder.py

* Address requests

Address requests changes

* Adds folder

* Adds test, tidy up

* Tidy

* Update test_folder.py

* Update folder.py

* Fix setup

Fix setup with else statement

* Update folder.py

* Update folder.py

* Remove list of files from attributes

* Update test_folder.py

* Update folder.py

* Update test_folder.py

* Update folder.py

* Update folder.py
2018-02-21 23:21:07 -08:00
Greg Laabs
184a54cc58 Fix fix isy994 fan detection (#12595)
* Fixed 3 small issues in isy994 component

1. FanLincs have two nodes: one light and one fan motor. In order for each node to get detected as different Hass entity types, I removed the device-type check for FanLinc. The logic will now fall back on the uom checks which should work just fine. (An alternative approach here would be to special case FanLincs and handle them directly - but seeing as the newer 5.x ISY firmware already handles this much better using NodeDefs, I think this quick and dirty approach is fine for the older firmware.) Fixes #12030
2. Some non-dimming switches were appearing as `light`s in Hass due to an duplicate NodeDef being in the light domain filter. Removed! Fixes #12340
3. The `unqiue_id` property was throwing an error for certain entity types that don't have an `_id` property from the ISY. This issue has always been present, but was exposed by the entity registry which seems to be the first thing to actually try reading the `unique_id` property from the isy994 component.

* Fix ISY994 fan detection

ISY reports "med" in the uom, not "medium"

* Add special-case for FanLincs so the light node is detected properly

* Re-add insteon-type filter for fans, which dropped in a merge error
2018-02-21 22:20:40 -08:00
matthewcky2k
c6480e46c4 Add Bluetooth and NFC card/tag Alarm types (#12151)
* Add Bluetooth and NFC card/tag Alarm types

* removed white space
2018-02-21 17:03:10 -05:00
Pascal Vizeli
b228695907 Hassio cleanup part2 (#12588)
* Update handler.py

* Update handler.py

* Update __init__.py

* Update handler.py

* Update handler.py

* Update __init__.py

* Update tests
2018-02-21 22:42:55 +01:00
Paulus Schoutsen
51c06e35cf Cloud reconnect tweaks (#12586) 2018-02-21 12:55:33 -08:00
Kane610
b8df2d4042 Deconz support water sensor (#12581)
* Add support for smoke detector in deconz

* Support for water sensors in deconz
2018-02-21 12:52:05 -08:00
Anders Melchiorsen
2d36d4d9f3 Set event_id foreign key in recorded states (#12580) 2018-02-21 12:51:20 -08:00
Paulus Schoutsen
03d6071a45 Update pychromecast to 2.0.0 (#12587) 2018-02-21 12:49:56 -08:00
Paulus Schoutsen
6ce9be6b3a Update frontend to 20180221.1 2018-02-21 12:45:10 -08:00
Anders Melchiorsen
ed1a883b52 Fix sonos default errorcodes (#12582) 2018-02-21 21:11:14 +01:00
Anders Melchiorsen
f9ee29a5cd Logbook speedup (#12566)
* Optimize logbook filtering

* Avoid State construction during Events filtering

* Move tuple creation out of loop

* Add benchmark
2018-02-21 10:35:55 -08:00
Paulus Schoutsen
8d0b7adf24 Fix config 404 (#12571) 2018-02-21 13:16:08 +01:00
Oliver
28fec209e0 Basic support of post 2016 AVR-X receivers (#12569) 2018-02-20 23:09:14 -08:00
Anders Melchiorsen
5ad0baf128 Add limitlessled night effect (#12567) 2018-02-20 23:08:45 -08:00
Paulus Schoutsen
49d410546a Frontend version bump to 20180221.0 2018-02-20 17:55:15 -08:00
bottomquark
722926b315 Fix caldav component handling missing dtend (#12562) 2018-02-20 15:37:34 -08:00
Kane610
c898fb1f16 Add support for smoke detector in deconz (#12561) 2018-02-20 15:28:06 -08:00
Pascal Vizeli
4f96eeb06e Cleanup hass.io component (#12556)
* Cleanup hass.io component

* fix lint

* Fix all tests

* Fix lint

* fix lint

* fix doc lint
2018-02-20 15:24:31 -08:00
ChristianKuehnel
316eb59de2 Add new component: BMW connected drive (#12277)
* first working version of BMW connected drive sensor

* extended coveragerc

* fixed blank line

* fixed pylint

* major refactoring after major refactoring in bimmer_connected

* Update are now triggered from BMWConnectedDriveVehicle.
* removed polling from sensor and device_tracker
* backend URL is not detected automatically based on current country
* vehicles are discovered automatically
* updates are async now

resolves:
* https://github.com/ChristianKuehnel/bimmer_connected/issues/3
* https://github.com/ChristianKuehnel/bimmer_connected/issues/5

* improved exception handing

* fixed static analysis findings

* fixed review comments from @MartinHjelmare

* improved startup, data is updated right after sensors were created.

* fixed pylint issue

* updated to latest release of the bimmer_connected library

* updated requirements-all.txt

* fixed comments from @MartinHjelmare

* calling self.update from async_add_job

* removed unused attribute "account"
2018-02-20 23:02:08 +01:00
rubenverhoef
5d29d88888 Added support for milight single channel dimmer (#12558) 2018-02-20 22:30:19 +01:00
Paulus Schoutsen
210226daac Update frontend 2018-02-20 09:08:37 -08:00
Otto Winter
f2a2727a15 Fix WUnderground spamming logs (#12548) 2018-02-20 09:01:34 -08:00
Krasimir Zhelev
1d8a5147e9 Frontier silicon async (#12503)
* Moving frontier_silicon platform to afspai(async fsapi)

* updated requirements_all.txt

* uses afsapi 0.0.2, which supports timeout

* uses afsapi 0.0.3, forward(before next) and rewind(before prev) renamed

* Moving frontier_silicon platform to afspai(async fsapi)

* updated requirements_all.txt

* uses afsapi 0.0.2, which supports timeout

* uses afsapi 0.0.3, forward(before next) and rewind(before prev) renamed

* Removing debug message

* removed time import

* Update frontier_silicon.py
2018-02-20 17:14:34 +01:00
Otto Winter
3077444d62 Fix numeric_state condition spamming on unavailable (#12550) 2018-02-20 17:02:27 +01:00
cdce8p
7829e61361 Bugfix: Input Datetime config schema (#12552)
* Bugfix for Input Datatime config schema

* Has_at_least_one_key_value only works if parameter is optional

* Added default parameters
2018-02-20 16:21:35 +01:00
Anders Melchiorsen
fb985e2909 Build JSON in executor (#12536) 2018-02-20 12:37:01 +01:00
Paulus Schoutsen
39847ea651 Clarify cloud error (#12540)
* Clarify cloud error

* Fix tests
2018-02-20 12:31:43 +01:00
Robin
17bdcac61b Adds filesize component (#12211)
* Create filesize.py

* Update filesize.py

* Updates filesize

Addresses issues raised in review

* Update .coveragerc

* Addresses requested changes

Addresses the changes requested by @baloob.
Additionally the file size in bytes is now available in attributes.

* Create test_filesize.py

This isn't working yet

* Update test_filesize.py

* Update test_filesize.py

* Update test_filesize.py

* Update test_filesize.py

* Update test_filesize.py

* Update test_filesize.py

* fixed valid file test

* Update test_filesize.py

* Fix indentation

Fix incorrect indentation in setup

* Update filesize.py

* Update filesize.py
2018-02-19 23:55:54 -08:00
Paulus Schoutsen
e37974c5fc Lint 2018-02-19 23:10:44 -08:00
Arvind Prasanna
46ce114066 Clarify a comment regarding python versions (#12537) 2018-02-19 22:41:13 -08:00
Paulus Schoutsen
d68a24b3b8 Update voluptuous serialize (#12538) 2018-02-19 22:12:39 -08:00
Paulus Schoutsen
336b00765d Fix Sphinx build (#12535) 2018-02-19 20:51:05 -08:00
cdce8p
bb29f16054 Merge pull request #12532 from cdce8p/homekit-test_bugfixes
Homekit: Test bugfixes for py3.5
2018-02-20 02:50:49 +01:00
cdce8p
42ab4e1366 Homekit component test bugfixes for py3.5 2018-02-20 01:40:56 +01:00
thrawnarn
722b9ba49b Changed to async_schedule_update_ha_state (#12518)
* Changed to async schedule update ha state

* Changed to async schedule update ha state

* Fixed my fetch error

* Added new line at the end
2018-02-19 15:43:14 -08:00
Pascal Vizeli
f3748cc4fa Add password support (#12525) 2018-02-19 14:49:52 -08:00
cdce8p
eec3bad94f Add support for HomeKit (#12488)
* Basic Homekit support

* Added Temperatur Sensor
* Added Window Cover

* Code refactored

* Added class HomeAccessory(Accessory)
* Added class HomeBridge(Bridge)
* Changed homekit imports to relative, to enable use in custom_components
* Updated requirements
* Added docs
* Other smaller changes

* Changed Homekit from entity to class

* Changes based on feedback
* Updated config schema
* Add only covers that support set_cover_position

* Addressed comments, updated to pyhap==1.1.5

* For lint: added files to gen_requirements_all
* Added codeowner

* Small change to Wrapper classes

* Moved imports to import_types, small changes

* Small changes, added tests

* Homekit class: removed add_accessory since it's already covered by pyhap
* Added test requirement: HAP-python
* Added test suit for homekit setup and interaction between HA and pyhap
* Added test suit for get_accessories function

* Test bugfix

* Added validate pincode, tests for cover and sensor types
2018-02-19 14:46:22 -08:00
Anders Melchiorsen
dc21c61a44 LimitlessLED assumed state (#12475)
* Use assumed state for LimitlessLED

* Replace inheritance with feature tests

* Clean up

* Clean up conversion methods

* Clamp temperature
2018-02-19 23:11:21 +01:00
Sebastian Muszynski
da9c0a1fd7 python-miio version bumped. (Closes: #12471) (#12481) 2018-02-19 20:53:20 +01:00
Daniel Høyer Iversen
6f2ee9a34c new version of xiaomi lib (#12513) 2018-02-19 12:40:05 +01:00
Teemu R
a378e18a3f bump python-eq3bt version, fixes #12499 (#12510) 2018-02-18 15:37:42 -08:00
Russell Cloran
63fcf9d425 zha: Add support for humidity sensors (#12496)
* zha: Add support for humidity sensors

* Fix lint issue
2018-02-18 15:03:18 -08:00
Russell Cloran
17b57099ae zha: Simplify unique ID (#12495)
Also fixes entity IDs generated for devices on the same endpoint.
2018-02-18 15:02:34 -08:00
thrawnarn
1143499301 More features for the Bluesound component (#11450)
* Added support for join and unjoin

* Added support for sleep functionality

* Fixed supported features

* Removed long lines and fixed documentation strings

* Fixed D401, imperative mood

* Added shuffle support

* Removed unnecessary log row

* Removed model, modelname and brand

* Removed descriptions

* Removed polling command on method run. This change is not needed

* Fixed merge errors

* Removed unused usings

* Pylint fixes

* Hound fixes

* Remove attr Sleep and removed white space in services.xml
2018-02-18 14:59:26 -08:00
Henrik Nicolaisen
72fa170265 added smappee component (#11491)
* added smappee component

* Fixed pylint errors and a few use cases when starting up with invalid credentials

Added coverage omit

* Added support to run only locally
Added a few more sensors
Added more error handling

Better parsing and debug message

* fixed smappee switch after local/remote support was added

* Smappee - update switches for local support (#3)

* Merged with local version

* Updated smappy library with the patched one

Fixed lint, added merge missing param

Fixed missing run for requirements_all.txt

Fixed lint

* Fixed on/off based on library. Reverted change used for testing stacktrace

* Fixed switches to work with both remote and local active

Fixed lint

Fixed switches

Fixed lint

* nothing to update per switch as the states are not saved by smappee system

* added better error handling for communication errors with smappee

* fixed lint errors

* fixed comment

* fixed lint error

* fixed lint error

* update smappee module with reviewer comments
- update smappy module
- cache cloud api requests
- added actuator info
- updated return states
2018-02-18 14:34:28 -08:00
Frederik Bolding
60148f3e83 Converted shopping list to use json util and added default override for json util (#12478)
* Converted shopping list to use json util, Added default override for json util

* Reverted accidental revert

* Fixed pylint issue
2018-02-18 13:11:24 -08:00
Anders Melchiorsen
635d36c6ba Rework Sonos media player platform (#12126)
* Rework Sonos media player platform for push

* Ignore play_mode from events where it is missing

* Remove unused preload helper

* Freeze SoCo version

* Updates for entity registry

* Add codeowner

* Use real soco release
2018-02-18 20:05:20 +01:00
karlkar
2280dc2a34 Support for PTZ in Onvif cameras (#11630)
* Service PTZ added

* Removed description loading during setup

* Fixed hound issues

* Changed attribute names

* Fixed pylint error

* Cleaning up the code

* Changed access to protected member to dict

* Removed new line added by mistake

* Fixed pylint error

* Fixed minors

* Fixed pylint caused by usage of create_type function

* Code made more concise

* Fixed string intendation problem

* Service name changed

* Update code to fit with the new version

* Set ptz to None if PTZ setup failed

* more precise exception used
2018-02-18 08:08:56 -08:00
Anders Melchiorsen
0d0e0b8ba3 Avoid warnings when purging an empty database (#12494) 2018-02-18 08:06:33 -08:00
Joe Lu
a8444b22e7 Support for August doorbell (#11124)
* Add support for August doorbell

* Address PR comment for August platform

* Address PR comment for August binary sensor

* Address PR comment for August camera

* Addressed PR comment for August lock

* - Fixed houndci-bot error

* - Updated configurator description

* - Fixed stale docstring

* Added august module to .coveragerc
2018-02-18 09:24:51 +01:00
Paulus Schoutsen
e8d8b75c07 Try deflaking recorder tests (#12492)
* Try deflaking recorder tests

* Remove run_coroutine_threadsafe

* Lint
2018-02-17 23:20:28 -08:00
happyleavesaoc
02c05e2490 bump usps version (#12465) 2018-02-17 21:49:32 -08:00
Joakim Plate
92aeef82ef Enable compression when sending json to client (#11165)
* Enable compression when sending json to client

Make server compress json content when transmitting to client. Json is quite verbose and compresses well.

A real world example is history_graph requested data for in my case 4 temperature sensors updating every half a second for a graph over 10 days lead to 6MB json which compressed to 200KB using deflate compression.

* Rename variable to request

* Name the variable response instead of request
2018-02-17 21:32:08 -08:00
Philip Rosenberg-Watt
909a06566e Fail gracefully with unreachable LaMetric (#12451)
Accounts with multiple LaMetric devices at unreachable IPs (for example
at a different location, on a different/unroutable subnet, etc.) may
cause the notify.lametric service to fail. This update wraps the message
sending routine in a try/except clause and outputs log messages
indicating the problem.

Fixes #12450
2018-02-17 21:13:05 -08:00
Sergio Viudes
8840c227d2 Added doorbird_last_motion to DoorBird camera platform (#12457) 2018-02-17 21:12:11 -08:00
mjj4791
6299c054c8 Prevent error when no internet or DNS is available (#12486) 2018-02-17 16:19:27 -08:00
Paulus Schoutsen
38da81c308 Merge pull request #12484 from home-assistant/release-0-63-3
0.63.3
2018-02-17 15:29:10 -08:00
Diogo Gomes
6ce9b35e81 [SQL Sensor] always close session (#12452)
* close aborted session

* blank line
2018-02-17 13:58:56 -08:00
Anders Melchiorsen
bf67d0e650 Optimize recorder purge (#12448) 2018-02-17 13:58:56 -08:00
Andrey
fcf97524a2 Fix light template to return brightness as int (#12447) 2018-02-17 13:58:55 -08:00
Ryan McLean
b651cdd8f2 Fix for contentRating error (#12445)
* Fix for contentRating

* Use getattr instead of hasattr

* Lint
2018-02-17 13:58:55 -08:00
Daniel Høyer Iversen
6838de3786 Reduce the load on met.no servers, yr.no sensor (#12435)
* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* fix comment

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Update yr.py
2018-02-17 13:58:54 -08:00
Greg Laabs
c9300a98e0 Fixed 3 small issues in isy994 component (#12421)
1. FanLincs have two nodes: one light and one fan motor. In order for each node to get detected as different Hass entity types, I removed the device-type check for FanLinc. The logic will now fall back on the uom checks which should work just fine. (An alternative approach here would be to special case FanLincs and handle them directly - but seeing as the newer 5.x ISY firmware already handles this much better using NodeDefs, I think this quick and dirty approach is fine for the older firmware.) Fixes #12030
2. Some non-dimming switches were appearing as `light`s in Hass due to an duplicate NodeDef being in the light domain filter. Removed! Fixes #12340
3. The `unqiue_id` property was throwing an error for certain entity types that don't have an `_id` property from the ISY. This issue has always been present, but was exposed by the entity registry which seems to be the first thing to actually try reading the `unique_id` property from the isy994 component.
2018-02-17 13:58:53 -08:00
Sebastian Muszynski
de7a4b9501 python-miio version bumped. (Closes: #12389, Closes: #12298) (#12392) 2018-02-17 13:58:53 -08:00
Paulus Schoutsen
a046e2ed20 Version bump to 0.63.3 2018-02-17 13:39:30 -08:00
Daniel Høyer Iversen
eaba3b315c Reduce the load on met.no servers, yr.no sensor (#12435)
* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* fix comment

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Spread the load more for the yr.no sensor

* Update yr.py
2018-02-17 13:33:41 -08:00
Julius Mittenzwei
4837254146 KNX/Climate: Fixed platform schema min/max values. (#12477)
* Issue 10388: Fixed platform schema min/max values of CONF_SETPOINT_SHIFT_MIN and CONF_SETPOINT_SHIFT_MAX

* readded default values for CONF_SETPOINT_SHIFT_MAX and CONF_SETPOINT_SHIFT_MIN
2018-02-17 13:22:38 -08:00
Paulus Schoutsen
371fe9c78f Add example in test how to create list or object in template (#12469) 2018-02-17 11:47:20 -08:00
Adam Mills
22a007a785 Bump aioautomatic to 0.6.5 for voluptuous 0.11 (#12480) 2018-02-17 14:13:27 -05:00
Matthew Hilton
66dcb6c947 ONVIF Camera added Error handling and rtsp authentication. (#11129)
Bugfixes for several issues with hass.io and non-venv installations

Added passing of credentials to RTSP stream

Changed from ONVIFService to ONVIFCamera as ONVIFService didn't contain
the same error handling.

Changed method to get Stream URL from camera to a more compatible method

Added extra Error handling
2018-02-17 08:57:05 -05:00
Richard Lucas
fab991bbf6 Map Alexa StepVolume responses to volume_up/down (#12467)
It turns out I misunderstood which media_player services are available
when a media player supports StepVolume. This PR maps the Alexa
StepSpeaker messages to the volume_up and volume_down services.

Currently Alexa allows you to specify the number of steps but the media
player volume_up and volume_down services don't support this. For now I
just look to see if the steps are +/- and call up/down accordingly.
2018-02-17 08:54:15 -05:00
Paulus Schoutsen
3fd61d8f45 Update voluputous (#12463)
* Update voluputous

* Fix http config

* Fix optional with default=None

* Optional, default=none

* Fix defaults in voluptuous schemas

* Fix tests

* Fix update error

* Lint
2018-02-17 10:29:14 +01:00
Paulus Schoutsen
e4ef6b91d6 Typo 2018-02-16 23:24:12 -08:00
Simon Nørager Sørensen
dd7bffc28c Add the Xiaomi TV platform. (#12359)
* Added the Xiaomi TV platform.

* Implemented a more efficient default name.

* Fixed a few style errors that slipped past the eye.

* Indicate that state is assumed.
2018-02-16 15:09:20 -08:00
Paulus Schoutsen
26340fd9df Bump frontend to 20180216.0 2018-02-16 15:06:46 -08:00
Otto Winter
fe5626b927 Make WUnderground async (#12385)
* 🐎 Async WUnderground

* ∞ Them lines be too long

* Fix pylint warnings

* Changes according to comments

* Remove STATE_UNKNOWN

* 🔬 Fix tests

* Improve tests
2018-02-16 14:54:11 -08:00
Paulus Schoutsen
b3a47722f0 Initial support for Config Entries (#12079)
* Introduce Config Entries

* Rebase fail

* Address comments

* Address more comments

* RequestDataValidator moved
2018-02-16 14:07:38 -08:00
Ryan McLean
2053c8a908 Fix for contentRating error (#12445)
* Fix for contentRating

* Use getattr instead of hasattr

* Lint
2018-02-16 11:51:19 -08:00
Andrey
13d6e56106 Fix light template to return brightness as int (#12447) 2018-02-16 09:32:11 -08:00
Sebastian Muszynski
1f041d54d9 Fake the state for a short period and skip the next update. (#12446)
On state change the device doesn't provide the new state immediately.

Flag the device as unavailable if no communication is possible.
2018-02-15 22:01:34 -08:00
Jesse Hills
8d48272cbd Add effects to iGlo Lights (#12365)
* Add effects to iGlo Lights
Simplify state variables to library

* Fix lint issues
2018-02-15 21:57:58 -08:00
Tabakhase
facd833e6d Vagrant - sendfile python3.5 debian-stretch (#12454)
* vagrant dev - force hass-AIOHTTP to not use sendfile
Ref: https://www.virtualbox.org/ticket/9069
strongly needed for `home-assistant-polymer`

* vagrant dev - python 3.4 to 3.5 by upgrade to debian-stretch
2018-02-15 21:53:10 -08:00
Anders Melchiorsen
0e2d98dbf5 Optimize recorder purge (#12448) 2018-02-15 20:22:57 -08:00
Diogo Gomes
d43a8e593a [SQL Sensor] always close session (#12452)
* close aborted session

* blank line
2018-02-15 20:20:45 -08:00
Aaron Bach
c7c0df53aa AirVisual: Entity Registry updates and cleanup (#12319)
* AirVisual: Entity Registry updates and cleanup

* Small cleanup

* Owner-requested changes

* Changed hashing function

* Put a better class instatiation mechanism in place

* Small cleanup

* Reverting unintended breaking change

* Removing hashing as part of creating the unique ID

* Attempting to jumpstart Travis
2018-02-15 14:52:47 -08:00
Igor Bernstein
612dd30201 Stop mapping zigbee switches to lights & switches. (#12280)
Zigbee switches only contain client clusters that are meant to control server clusters on a different device/endpoint.
This device type -> cluster mapping can be found in https://www.nxp.com/docs/en/user-guide/JN-UG-3076.pdf.
The intended usage is of connecting client clusters to server clusters is described in https://products.currentbyge.com/sites/products.currentbyge.com/files/document_file/DT200-GE-Zigbee-Primer-Whitepaper.pdf

The lack of server clusters on switches has been verified using a GE ZigBee Lighting Switch 45856GE and a 45857GE dimmer.

Output from a 45856GE:
Device:
  NWK: 0x0cd8
  IEEE: 00:22:a3:00:00:1f:37:68
  Endpoints:
    1: profile=0x104, device_type=DeviceType.ON_OFF_LIGHT
      Input Clusters:
        Basic (0)
        Identify (3)
        Groups (4)
        Scenes (5)
        On/Off (6)
        Metering (1794)
        Diagnostic (2821)
      Output Clusters:
        Time (10)
        Ota (25)
    2: profile=0x104, device_type=DeviceType.ON_OFF_LIGHT_SWITCH
      Input Clusters:
        Basic (0)
        Identify (3)
        Diagnostic (2821)
      Output Clusters:
        Identify (3)
        On/Off (6)
2018-02-15 14:51:54 -08:00
Sergio Viudes
f0d9e5d7ff Fix: timeout data attribute now is parsed to float (#12432) 2018-02-15 14:49:46 -08:00
Diogo Gomes
d18709df5b Update CODEOWNERS (#12440)
As contributor of the components
2018-02-15 13:40:30 -08:00
Paulus Schoutsen
f32911d036 Cleanup http (#12424)
* Clean up HTTP component

* Clean up HTTP mock

* Remove unused import

* Fix test

* Lint
2018-02-15 22:06:14 +01:00
Russell Cloran
ad8fe8a93a zha: Add unique_id to entities (#12331)
* zha: Add unique_id to entities

* Lint

* fix comments

* Update __init__.py

* Update __init__.py
2018-02-15 13:38:56 +01:00
Daniel Høyer Iversen
b4dbfe9bbd Update the Tibber sensor at startup (#12428) 2018-02-15 12:33:49 +01:00
Julius Mittenzwei
ae32d208d9 Cleanup of knx component (#12408) 2018-02-14 22:10:12 -08:00
Julius Mittenzwei
f5d1f53fab Small code cleanup: (#12409)
- should_poll of base class already returns False
- there is no is_on within Scene
2018-02-14 22:07:04 -08:00
Julius Mittenzwei
96bd153c80 Added support for colored KNX lights (#12411) 2018-02-14 22:06:36 -08:00
cdce8p
7e2e82d956 Print every changed file on new line (#12412) 2018-02-14 22:01:30 -08:00
Otto Winter
5d4b1ecd3b Fix MQTT payload decode returning prematurely (#12420)
* Fix MQTT returning prematurely

* Add test
2018-02-14 22:00:49 -08:00
Greg Laabs
c25c4c85d6 Fixed 3 small issues in isy994 component (#12421)
1. FanLincs have two nodes: one light and one fan motor. In order for each node to get detected as different Hass entity types, I removed the device-type check for FanLinc. The logic will now fall back on the uom checks which should work just fine. (An alternative approach here would be to special case FanLincs and handle them directly - but seeing as the newer 5.x ISY firmware already handles this much better using NodeDefs, I think this quick and dirty approach is fine for the older firmware.) Fixes #12030
2. Some non-dimming switches were appearing as `light`s in Hass due to an duplicate NodeDef being in the light domain filter. Removed! Fixes #12340
3. The `unqiue_id` property was throwing an error for certain entity types that don't have an `_id` property from the ISY. This issue has always been present, but was exposed by the entity registry which seems to be the first thing to actually try reading the `unique_id` property from the isy994 component.
2018-02-14 21:58:49 -08:00
Paulus Schoutsen
78c44180f4 Extract data validator to own file and add tests (#12401) 2018-02-14 21:06:03 +01:00
Fabian Affolter
416f64fc70 Upgrade sphinx-autodoc-typehints to 1.2.5 (#12404) 2018-02-14 15:01:39 +01:00
Julius Mittenzwei
f25d56d666 Code cleanup of velux scene (#12390)
* Code cleanup of velux scene

* fixed review comments

* fixed review comments
2018-02-14 15:00:45 +01:00
Paulus Schoutsen
6f043f3c5c Merge branch 'master' into dev 2018-02-13 23:19:39 -08:00
Frederik Bolding
6500cb7915 File Path fixes for RPi Camera (#12338)
* Checked file path with is_allowed_path() for RPi Camera

* Used cv.isfile to verify file path instead of manual checks

* Changed default file path for RPiCamera to config_dir/image.jpg

* Used tempfiles for storing RPi Camera images, if no other path is defined

* Stopped checking for whitelisted paths on temporary files
2018-02-13 23:07:50 -08:00
Paulus Schoutsen
d85ed8d0fe Merge pull request #12402 from home-assistant/release-0-63-2
0.63.2
2018-02-13 23:00:45 -08:00
Anders Melchiorsen
c82ca62820 Downgrade limitlessled to 1.0.8 (#12403) 2018-02-13 22:58:49 -08:00
Anders Melchiorsen
28964806c5 Downgrade limitlessled to 1.0.8 (#12403) 2018-02-13 22:58:31 -08:00
Sean Dague
c414ecd4f0 Introduce zone_id to identify player+zone (#12382)
The yamaha component previously used a property named unique_id to
ensure that exactly 1 media_player was discovered per zone per
control_url. This was introduced so that hard coded devices wouldn't
be duplicated by automatically discovered devices.

In HA 0.63 unique_id became a reserved concept as part of the new
device registry, and the property was removed from the component. But
the default returns None, which had the side effect of only ever
registering a single unit + zone, the first one discovered. This was
typically the Main_Zone of the unit, but there is actually no
guaruntee of that.

This fix brings back the logic under a different property called
zone_id. This is not guarunteed to be globally stable like unique_id
is supposed to be, but it is suitable for the deduplication for yamaha
media players.
2018-02-13 22:11:05 -08:00
citruz
72f100723f Updated beacontools (#12368) 2018-02-13 22:11:04 -08:00
Otto Winter
9e4da37022 Fix WUnderground names (#12346)
* 📝 Fix WUnderground names

* 👻 Fix using event loop callback
2018-02-13 22:11:03 -08:00
Rene Nulsch
e5f000f976 Fix MercedesMe - add check for unsupported features (#12342)
* Add check for unsupported features

* Lint fix

* change to guard clause
2018-02-13 22:11:03 -08:00
Paulus Schoutsen
e2408cc804 Version bump to 0.63.2 2018-02-13 22:03:06 -08:00
Patrik Ekström
9bfeb3b5af Changed pyvera version to 0.2.41 (#12391)
* Changed pyvera version to 0.2.41

Changed required pyvera version to 0.2.41 from 0.2.39.
The 0.2.41 supports the VeraSecure built in siren. Siren is treated as switch and can now be turned on and off. Before it was armable but generated error in Vera controller.  This allows for both detecting status of Siren if triggered from within Vera and also outside controll from HA.

* Added pyvera 0.2.41 library
2018-02-13 21:55:50 -08:00
Aaron Bach
c5c409bed3 Pollen.com: Entity Registry updates and cleanup (#12361)
* Updated Pollen sensors to be entity registry-friendly

* Pollen.com: Entity Registry updates and cleanup

* Small cleanup

* Owner-requested changes
2018-02-13 16:25:10 -08:00
Kane610
8bff813014 Improve service by allowing to reference entity id instead of deconz id (#11862)
* Improve service by allowing to reference entity id instead of deconz id

* Change from having access to full entities to only store entity id together with deconz id

* Don't use eval, there is a dict type for voluptuous

* Use entity registry instead of keeping a local registry over entity ids

* Removed old code

* Add test for get_entry

* Bump dependency to v28
Fixed call to protected member

* Use chain to iterate over dict values

* Cleanup

* Fix hound comment

* Cleanup

* Follow refactoring of entity

* Revert to using a local registry

* Remove unused import

* self.hass is automatically available when entity is registered in hass
2018-02-13 16:23:03 -08:00
Sebastian Muszynski
a4944da68f python-miio version bumped. (Closes: #12389, Closes: #12298) (#12392) 2018-02-14 00:17:47 +01:00
Fabian Affolter
bc64053214 Add attributes (fixes #12332) (#12377)
* Add attributes (fixes #12332)

* Fix pylint issue
2018-02-13 23:47:59 +01:00
Paulus Schoutsen
c7416c8986 Remove usage of deprecated assert method (#12379) 2018-02-13 23:25:06 +01:00
Fabian Affolter
429628ec1d Upgrade youtube_dl to 2018.02.11 (#12383) 2018-02-13 23:24:18 +01:00
Sean Dague
16dafaa5af Introduce zone_id to identify player+zone (#12382)
The yamaha component previously used a property named unique_id to
ensure that exactly 1 media_player was discovered per zone per
control_url. This was introduced so that hard coded devices wouldn't
be duplicated by automatically discovered devices.

In HA 0.63 unique_id became a reserved concept as part of the new
device registry, and the property was removed from the component. But
the default returns None, which had the side effect of only ever
registering a single unit + zone, the first one discovered. This was
typically the Main_Zone of the unit, but there is actually no
guaruntee of that.

This fix brings back the logic under a different property called
zone_id. This is not guarunteed to be globally stable like unique_id
is supposed to be, but it is suitable for the deduplication for yamaha
media players.
2018-02-13 23:24:03 +01:00
Paulus Schoutsen
f0231c1f29 Specify algorithms for webpush jwt verification (#12378) 2018-02-13 23:23:34 +01:00
Johann Kellerman
5995c2f313 SMA sensor add SSL and upgrade to pysma 0.2 (#12354) 2018-02-13 22:03:56 +02:00
Diogo Gomes
80d2c76e85 Upgrade panasonic_viera to 0.3.1 (#12370)
* Bump panasonic_viera library to 0.3.1

Fixes media_play in hassio environment

* update requirements
2018-02-13 17:06:30 +01:00
Paulus Schoutsen
d2cea84254 Allow disabling entities in the registry (#12360) 2018-02-13 13:33:15 +01:00
citruz
a4b88fc31b Updated beacontools (#12368) 2018-02-13 11:32:44 +01:00
karlkar
f5c2e7ff68 Eq3btsmart more reliable (#11555)
* Eq3btsmart more reliable

* Fixed 'Line too long' violations

* Fixed trailing whitespaces

* Fixed indents

* Fix for disallowing external temperature setting

* Logic fix after increasing eq3bt version
2018-02-12 22:29:58 -08:00
Rene Nulsch
00ff305bd7 Fix MercedesMe - add check for unsupported features (#12342)
* Add check for unsupported features

* Lint fix

* change to guard clause
2018-02-12 21:07:20 -08:00
Fabian Affolter
66d14da5e9 Upgrade alpha_vantage to 1.9.0 (#12352) 2018-02-12 21:06:03 -08:00
happyleavesaoc
ba9fef4de6 bump fedex version (#12362) 2018-02-12 21:02:03 -08:00
Mike O'Driscoll
0a558a0e82 Add New Sensor for ISP Start.ca (#12356)
Adding a new sensor for ISP Start.ca to track download/upload usage.
2018-02-12 19:43:56 -08:00
Otto Winter
2c202690d8 Fix WUnderground names (#12346)
* 📝 Fix WUnderground names

* 👻 Fix using event loop callback
2018-02-12 13:15:28 -08:00
Sebastian Muszynski
04bde68db3 Communication reduced. Setting brightness and/or color temperature will turn on the device. (#12343) 2018-02-12 11:24:48 -08:00
Dougal Matthews
2d77a2bb39 Use the speedometer icon in the fastdotcom sensor (#12348)
This change makes the icon match the one used in the speedtest sensor.
2018-02-12 11:15:10 -08:00
Mike O'Driscoll
52f57b755e Change Unifi SSID filtering to list comprehension (#12344)
Changed from filter to list comprehension.
2018-02-12 20:02:07 +01:00
Paulus Schoutsen
870728f68f Mock Module + Platform default to async (#12347)
* Mock Module + Platform default to async

* Change checks
2018-02-12 10:59:20 -08:00
Paulus Schoutsen
48f40453f7 Merge branch 'master' into dev 2018-02-12 09:00:11 -08:00
Paulus Schoutsen
073126755c Merge pull request #12334 from home-assistant/release-0-63-1
0.63.1
2018-02-12 08:56:04 -08:00
Fabian Affolter
034eb9ae1a Upgrade Sphinx to 1.7.0 (#12335) 2018-02-12 11:24:26 +01:00
Abílio Costa
d34a4fb6e3 nmap_tracker: don't scan on setup (#12322)
* nmap_tracker: don't scan on setup

	A scan takes about 6 seconds so it delays HA from booting. Since
another scan is done by the device_tracker base component during setup,
there is no need to do two scans on boot.

* simplify setup
2018-02-12 08:52:00 +01:00
Paulus Schoutsen
7a9ceb6f54 Fix platform dependencies (#12330) 2018-02-11 23:38:47 -08:00
Richard Lucas
a06000c76d Always return lockState == LOCKED when handling Alexa.LockController (#12328) 2018-02-11 23:38:39 -08:00
Richard Lucas
2a0bd8d330 Fix Report State for Alexa Brightness Controller (#12318)
* Fix Report State for Alexa Brightness Controller

* Lint
2018-02-11 23:38:31 -08:00
Paulus Schoutsen
ead158b68c Respect entity namespace for entity registry (#12313)
* Respect entity namespace for entity registry

* Lint
2018-02-11 23:38:24 -08:00
Paulus Schoutsen
bfd9a5a863 Allow overriding name via entity registry (#12292)
* Allow overriding name via entity registry

* Update requirements
2018-02-11 23:38:15 -08:00
Paulus Schoutsen
56b185f7ab Remove unique ID from netatmo (#12317)
* Remove unique ID from netatmo

* Shame platform in error message
2018-02-11 23:31:40 -08:00
Russell Cloran
34ccfae565 zha: Update zigpy-xbee to 0.0.2
0.0.2 implements auto_form, so that configuring the radio to be a
controller is done automatically.
2018-02-11 23:31:30 -08:00
Richard Lucas
dc8a0205ee Fix Alexa Step Volume (#12314) 2018-02-11 23:30:55 -08:00
Paulus Schoutsen
7471211b60 Version bump to 0.63.1 2018-02-11 23:27:38 -08:00
Paulus Schoutsen
04b68902e3 Fix platform dependencies (#12330) 2018-02-11 23:26:52 -08:00
Albert Lee
ebe4418afe device_tracker.asuswrt: Ignore unreachable ip neigh entries (#12201) 2018-02-11 23:24:29 -08:00
Mike O'Driscoll
eaa2791539 Unifi tracking filter by SSID (#12281)
Enable unifi device tracker component to track devices only
on specific SSIDs.
2018-02-11 23:23:53 -08:00
Richard Lucas
7059b6c6c1 Always return lockState == LOCKED when handling Alexa.LockController (#12328) 2018-02-11 23:20:54 -08:00
Paulus Schoutsen
5d15b257c4 Fix line endings [skipci] (#12333) 2018-02-11 23:07:28 -08:00
Richard Lucas
669929de06 Fix Report State for Alexa Brightness Controller (#12318)
* Fix Report State for Alexa Brightness Controller

* Lint
2018-02-11 22:36:22 -08:00
Paulus Schoutsen
eb7adc74ef Respect entity namespace for entity registry (#12313)
* Respect entity namespace for entity registry

* Lint
2018-02-11 20:55:38 -08:00
Russell Cloran
3b3050434a zha: Add remove service (#11683)
* zha: Add remove service

* Lint
2018-02-11 20:34:19 -08:00
Paulus Schoutsen
7e9dcfa4c9 Revert #12316 (#12329) 2018-02-11 20:33:08 -08:00
Aaron Bach
c193d80ec5 Updated RainMachine to play better with the entity registry (#12315)
* Updated RainMachine to play better with the entity registry

* Owner-requested changes
2018-02-11 19:55:51 -08:00
Paulus Schoutsen
2e3524147c Remove unique ID from netatmo (#12317)
* Remove unique ID from netatmo

* Shame platform in error message
2018-02-11 19:33:37 -08:00
Johann Kellerman
f28fa7447e Force LF line endings for Windows (#12266)
* Force LF line endings for Windows

* include all
2018-02-11 19:23:16 -08:00
Russell Cloran
069454323e zha: Update zigpy-xbee to 0.0.2
0.0.2 implements auto_form, so that configuring the radio to be a
controller is done automatically.
2018-02-11 17:20:55 -08:00
ChristianKuehnel
ed1d6f1027 Removed default sensor configuration (#12252)
* removed default configuration, added warning if no sensor was configured

* fixed typo in currency-try icon

* changed if statement
2018-02-11 23:51:10 +01:00
Russell Cloran
28ed304c93 zha: Update zigpy-xbee to 0.0.2
0.0.2 implements auto_form, so that configuring the radio to be a
controller is done automatically.
2018-02-11 14:45:52 -08:00
Paulus Schoutsen
3e150bb2b3 Protect bloomsky platform setup (#12316) 2018-02-11 22:49:16 +01:00
Anders Melchiorsen
247edf1b69 Purge recorder data by default (#12271) 2018-02-11 13:22:59 -08:00
NovapaX
219ed7331c add friendly_name_template to template sensor (#12268)
* add friendly_name_template to template sensor.
If set, overrides friendly_name setting.

* Add test
2018-02-11 12:12:30 -08:00
Thijs de Jong
47bfef9640 Clarify tahoma errrors (#12307) 2018-02-11 20:36:03 +01:00
Richard Lucas
767d3c6206 Fix Alexa Step Volume (#12314) 2018-02-11 11:25:05 -08:00
Otto Winter
e4a826d1c1 📝 Fix fixture encoding (#12296) 2018-02-11 11:01:44 -08:00
Paulus Schoutsen
a71d5f4614 Bump frontend to 20180211.0 2018-02-11 09:45:21 -08:00
Jerad Meisner
6c358fa6a3 Migrated SABnzbd sensor to asyncio and switched to pypi library (#12290)
* Migrated SABnzbd sensor to asyncio and switched to pypi library

* bumped pysabnzbd version and refactored imports
2018-02-11 09:33:56 -08:00
Tod Schmidt
26209de2f2 Move HassIntent handler code into helpers/intent (#12181)
* Moved TurnOn/Off Intents to component

* Removed unused import

* Lint fix which my local runs dont catch apparently...

* Moved hass intent code into intent

* Added test for toggle to conversation.

* Fixed toggle tests

* Update intent.py

* Added homeassistant.helpers to gen_requirements script.

* Update intent.py

* Update intent.py

* Changed return value for _match_entity

* Moved consts and requirements

* Removed unused import

* Removed http view

* Removed http import

* Removed fuzzywuzzy dependency

* woof

* A few cleanups

* Added domain filtering to entities

* Clarified class doc string

* Added doc string

* Added test in test_init

* woof

* Cleanup entity matching

* Update intent.py

* removed uneeded setup from tests
2018-02-11 09:33:19 -08:00
Otto Winter
678f284015 Upgrade pylint to 1.8.2 (#12274)
* Upgrade pylint to 1.8.1

* Fix no-else-return

* Fix bad-whitespace

* Fix too-many-nested-blocks

* Fix raising-format-tuple

See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst

* Fix len-as-condition

* Fix logging-not-lazy

Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string

* Fix stop-iteration-return

* Fix useless-super-delegation

* Fix trailing-comma-tuple

Both of these seem to simply be bugs:
 * Nest: The value of self._humidity never seems to be used anywhere
 * Dovado: The called API method seems to expect a "normal" number

* Fix redefined-argument-from-local

* Fix consider-using-enumerate

* Fix wrong-import-order

* Fix arguments-differ

* Fix missed no-else-return

* Fix no-member and related

* Fix signatures-differ

* Revert "Upgrade pylint to 1.8.1"

This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.

* Fix arguments-differ

* except for device_tracker

* Cleanup

* Fix test using positional argument

* Fix line too long

I forgot to run flake8 - shame on me... 🙃

* Fix bad-option-value for 1.6.5

* Fix arguments-differ for device_tracker

* Upgrade pylint to 1.8.2

* 👕 Fix missed no-member
2018-02-11 09:20:28 -08:00
Rene Nulsch
64c5d26a84 Fix Panel_IFrame - FTP URL not allowed in 0.63 (#12295) 2018-02-11 09:19:31 -08:00
Rene Nulsch
2edebfee0a Fix config error for FTP links, add test (#12294) 2018-02-11 09:19:00 -08:00
Otto Winter
b1c0cabe6c Fix MQTT retained message not being re-dispatched (#12004)
* Fix MQTT retained message not being re-dispatched

* Fix tests

* Use paho-mqtt for retained messages

* Improve code style

* Store list of subscribers

* Fix lint error

* Adhere to Home Assistant's logging standard

"Try to avoid brackets and additional quotes around the output to make it easier for users to parse the log."
 - https://home-assistant.io/developers/development_guidelines/

* Add reconnect tests

* Fix lint error

* Introduce Subscription

Tests still need to be updated

* Use namedtuple for MQTT messages

... And fix issues

Accessing the config manually at runtime isn't ideal

* Fix MQTT __init__.py tests

* Updated usage of Mocks
* Moved tests that were testing subscriptions out of the MQTTComponent test, because of how mock.patch was used
* Adjusted the remaining tests for the MQTT clients new behavior - e.g. self.progress was removed
* Updated the async_fire_mqtt_message helper

*  Update MQTT tests

* Re-introduce the MQTT subscriptions through the dispatcher for tests - quite ugly though...  🚧
* Update fixtures to use our new MQTT mock 🎨

* 📝 Update base code according to comments

* 🔨 Adjust MQTT test base

* 🔨 Update other MQTT tests

* 🍎 Fix carriage return in source files

Apparently test_mqtt_json.py and test_mqtt_template.py were written on Windows. In order to not mess up the diff, I'll just redo the carriage return.

* 🎨 Remove unused import

* 📝 Remove fire_mqtt_client_message

* 🐛 Fix using python 3.6 method

What's very interesting is that 3.4 didn't fail on travis...

* 🐛 Fix using assert directly
2018-02-11 09:17:58 -08:00
Paulus Schoutsen
17e5740a0c Allow overriding name via entity registry (#12292)
* Allow overriding name via entity registry

* Update requirements
2018-02-11 09:16:01 -08:00
Paulus Schoutsen
8b9eab196c Attempt fixing flakiness of check config test (#12283)
* Attempt fixing check_config script test flakiness

* Fix logging

* remove cleanup as Python will exit

* Make sure we don't enqueue magicmocks

* Lint

* Reinstate cleanup as it broke secret tests
2018-02-11 09:00:02 -08:00
Johann Kellerman
65c6f72c9d check_config check bootstrap errors (#12291) 2018-02-10 23:40:48 -08:00
Thom Troy
fe1a85047e have climate fallback to state if no ATTR_OPERATION_MODE (#12271) (#12279) 2018-02-10 15:06:24 -08:00
Paulus Schoutsen
74010fc2df Merge branch 'master' into dev 2018-02-10 14:03:55 -08:00
Paulus Schoutsen
0e16f7f307 Merge pull request #12267 from home-assistant/release-0-63
0.63
2018-02-10 14:00:29 -08:00
Slava
18aa1037dd Update limitlessled requirement to v1.0.9 (#12275)
* Update limitlessled requirement to v1.0.9

* trigger cla

* take back empty line
2018-02-10 13:11:05 -08:00
Paulus Schoutsen
aad26599ae Retry keyset cloud (#12270)
* Use less threads in helpers.event tests

* Add helpers.event.async_call_later

* Cloud: retry fetching keyset
2018-02-10 13:11:05 -08:00
escoand
a9412d27aa allow wildcards in subscription (#12247)
* allow wildcards in subscription

* remove whitespaces

* make function public

* also implement for mqtt_json

* avoid mqtt-outside topic matching

* add wildcard tests

* add not matching wildcard tests

* fix not-matching tests
2018-02-10 13:11:04 -08:00
Slava
a9e2dd3427 Update limitlessled requirement to v1.0.9 (#12275)
* Update limitlessled requirement to v1.0.9

* trigger cla

* take back empty line
2018-02-10 12:59:04 -08:00
Paulus Schoutsen
f2296e1ff8 Retry keyset cloud (#12270)
* Use less threads in helpers.event tests

* Add helpers.event.async_call_later

* Cloud: retry fetching keyset
2018-02-10 11:40:24 +01:00
David K
134445f622 Fix some rfxtrx devices with multiple sensors (#12264)
* Fix some rfxtrx devices with multiple sensors

Some combined temperature/humidity sensors send one packet for each of
their sensors. Without this fix one of the home assistant sensors would
always display an unknown value.

* Add comment
2018-02-10 10:45:00 +01:00
escoand
cad9e9a4cb allow wildcards in subscription (#12247)
* allow wildcards in subscription

* remove whitespaces

* make function public

* also implement for mqtt_json

* avoid mqtt-outside topic matching

* add wildcard tests

* add not matching wildcard tests

* fix not-matching tests
2018-02-09 15:22:50 -08:00
Albert Lee
1db4df6d3a device_tracker.asuswrt: Clean up unused connection param (#12262) 2018-02-09 15:21:10 -08:00
Paulus Schoutsen
7c36c5d9b4 Version bump to 0.64.0.dev0 2018-02-09 14:56:46 -08:00
Paulus Schoutsen
3333dcc6c2 Version bump to 0.63 2018-02-09 14:55:20 -08:00
Paulus Schoutsen
681dc72a15 Merge branch 'master' into dev 2018-02-09 14:54:27 -08:00
Anton Lundin
b0780110c7 One bug fix and one improvement to the statistics sensor. (#12259)
* Correct time on recorder loaded values in statistics sensor

Previously, the current time was used when initial values was loaded
form the recorder component. This changes that to use the stored time
from recorder instead.

Signed-off-by: Anton Lundin <glance@acc.umu.se>

* Expose min / max age of values in the statistics sensor

This is very useful when doing derived calculations, for example in a
template sensor.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2018-02-09 23:50:05 +01:00
Paulus Schoutsen
b087ea101d Update frontend to 20180209.0 2018-02-09 14:34:20 -08:00
David
129d720d8e Fix duplicate entity_ids in System Monitor (#12124)
* Fix duplicate entity_ids in System Monitor

This fix makes it so `_percent` is appended to the `entity_id` of the following 3 resources, in order to make the `entity_id` unique:
- disk_use_percent
- memory_use_percent
- swap_use_percent

* match entity_id to resource name

Match entity_id to resource name, to make resulting entity_id more predictable

* match entity_id to more resource names

match entity_id to more resource names

* Add unique_id property

* Revert "Add unique_id property"

This reverts commit c213ac360e.
2018-02-09 14:10:16 -08:00
Eleftherios Chamakiotis
6174c1754b Fix for iTunes media player not updating artwork (#12089)
* Added timestamp at the end of the iTunes API URL from where HA retrieves the artwork, so that it's not cached, as the URL exposed by the API never changes

* Rearranged imports according to pylint

* Added content_id in media file URL instead of timestamp, according to Paulus' suggestion
2018-02-09 14:09:34 -08:00
luca-angemi
4c11a3461f Update owntracks.py (#12260) 2018-02-09 23:06:31 +01:00
Daniel Perna
0b947882ac Update pyhomematic to 0.1.39 (#12265)
* Update pyhomematic
2018-02-09 21:59:10 +01:00
ChristianKuehnel
2014e42e4e miflora - fix for exception handling bug (#12149)
* updated to development branch of miflora

* updated requirements_all.txt

* upgraded to version 0.3

* updated requirements_all.txt
2018-02-09 21:31:49 +01:00
Otto Winter
2ae0c5653e Fix source code using Windows newline (#12248)
* 🚜 Fix usage of carriage return

* 🤝 Rebase and repeat

* 🚜 Fix file permissions
2018-02-09 08:11:47 +01:00
Pascal Vizeli
e4874fd7c7 Update aiohttp 2.3.10 / yarl 1.1.0 (#12244)
* Update aiohttp 2.3.10 / yarl 1.1.0

* Update setup.py

* Update package_constraints.txt

* Update google.py

* Update static.py
2018-02-08 20:57:05 -08:00
Jon Maddox
18d027a10d Add Service Schema to Broadlink Switch (#12253)
* add service schema to ensure single values are wrapped into a list

Co-Authored-By: Paulus Schoutsen <paulus@paulusschoutsen.nl>

* 💐
2018-02-08 19:37:17 -08:00
ChristianKuehnel
b08294386b added more debug logging for sensor.alpha_vantage (#12249)
* added more debug logging for sensor.alpha_vantage

* fixed typo in log statement, more fine grained logging

* Capitalized first character in log statement

* replaced quotes as proposed by @OttoWinter
2018-02-09 00:14:49 +01:00
Anders Melchiorsen
acb521330c Add explicit first-time config for new purge_keep_days default (#12246) 2018-02-08 09:44:19 -08:00
cdce8p
231b62d043 Fix cover service description (#12243)
Parameter for `set_cover_tilt_position` is `tilt_position` not `position`.
2018-02-08 16:09:42 +01:00
Eu
905bb36e6a Added password mode to input_text (obscure content of text box) (#11849)
* Round values to one decimal

Temperature detection range: -20 - 60 Deg.C ( + / - 0.3 Deg.C )
Humidity detection range: 0 - 100pct RH ( + / - 0.3pct )
Atmospheric pressure detection range: 30 - 110KPa ( + / - 120Pa )

* Add password mode option

Hide the content of the input_text field

* Revert "Round values to one decimal"

This reverts commit a3124a6aaa.

* Added test for mode option

* Added newline (lint)
2018-02-08 12:29:33 +01:00
mkfink
25cbc8317f Force update support for mqtt binary sensor (#12092) 2018-02-08 12:28:12 +01:00
Anders Melchiorsen
6265d1b747 Avoid influxdb filling connection pool (#12182)
* Add a processing queue to influxdb

* Updates after reviews

* Remove lint

* Move retry loop to thread class

* Move constant calculation out of loop

* Deprecate retry_queue_limit
2018-02-08 12:25:26 +01:00
Thijs de Jong
702b1be985 Set tahoma cover update interval to default (#12232)
revert 35f35050ff158b423dc437c66bdea5ebcbabc009#diff-c65eb52376398392f1395f8127364078
2018-02-08 12:20:51 +01:00
Diogo Gomes
15368d4ca1 [SMALL PATCH] Sql sensor (#12242)
* Initial Commit

* Passed all checks

* Make DB_URL required

* addresses review comments from @fabaff

* unused variable

* return nothing
2018-02-08 12:17:54 +01:00
Paulus Schoutsen
5601fbdc7a Entity layer cleanup (#12237)
* Simplify entity update

* Split entity platform from entity component

* Decouple entity platform from entity component

* Always include unit of measurement again

* Lint

* Fix test
2018-02-08 12:16:51 +01:00
Sergey Isachenko
8523933605 Fixes for tesla. New sensors. (#12225)
* fixes #11970

* long line fix
2018-02-07 23:34:26 -08:00
Diogo Gomes
0300229085 SQL sensor (#12142)
* Initial Commit

* Passed all checks

* Make DB_URL required

* addresses review comments from @fabaff

* unused variable
2018-02-07 23:32:39 -08:00
Sergey Isachenko
d0ffb1bc52 librouteros version bump (#12227) 2018-02-07 23:15:02 -08:00
Andrey
2b9bb7963d Update min js=latest version (#12091) 2018-02-07 23:14:31 -08:00
Anders Melchiorsen
945606238c Allow zero purge_interval to disable recorder purge (#12220) 2018-02-07 22:59:09 -08:00
Anders Melchiorsen
aa9b5e6ea5 Return of entity_id in template platforms (#12234) 2018-02-07 22:46:14 -08:00
Phil Elson
9d5dee574a Specify the minimum python version in the setup.py. (#12144)
* Specify the minimum python version in the setup.py.

* Used the minimum python version defined in homeassistant.const.
2018-02-07 12:38:06 -08:00
Marc Egli
ea35ffbc81 Add wake on lan capability to philips TV (#12065)
* Add wake on lan capability to philips TV

* Update requirements_all.txt

* Fix line length issues.

* Replace wake on lan with turn on script for philips TV

* rerun requirements script
2018-02-07 09:35:08 -08:00
Kevin Siml
d05a1e35fc Update pushsafer.py (#11466)
* Update pushsafer.py

Now you can setup your pushsafer notification, and change the following parameters:
sound, vibration, icon, devices (targets), icon/led color, url, url title, time2live, picture

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* Update pushsafer.py

* fix lint
2018-02-07 17:23:10 +01:00
Phil Elson
5ba02c531e Catch concurrent.futures.CancelledError in websocket code. (#12150)
* Catch concurrent.futures.CancelledError in websocket code.

* Added a comment about the use of futures.CancelledError
2018-02-06 21:30:18 -08:00
Boyi C
7e246e4680 Fix logger bug on Windows: path contains '\'. (#12197)
* Fix logger bug on Windows: path contains '\'.

* update

* Update __init__.py
2018-02-06 12:56:31 -08:00
kennedyshead
bd29cd2ba2 Fixes according to review from @MartinHjelmare Thank you. (#12171) 2018-02-06 21:27:35 +01:00
Sebastian Muszynski
cee57aab24 Xiaomi MiIO Light: Brightness mapping improved (#12203)
* Mapping ([1,100] <-> [1,255]) of the brightness improved.

* The cast to int isn't needed for python3.
2018-02-06 19:59:49 +01:00
Jerad Meisner
a2916a9c47 Fix Xeoma camera platform to allow different admin/viewer credentials (#12161) 2018-02-06 10:47:38 -08:00
Conrad Juhl Andersen
49c7b422f2 Add Xiaomi Universal IR Remote (Chuangmi IR) (#11891)
* First version of remote xiaomi-miio

* added to coveragerc

* fixed pylint error

* misc fixes and input validation

* address syssi's requests except device and async_service_handler

* forgot to run linter

* implemented async_service_handler

* fixed delay == None, honor timeout given by user, pythonic compare of None

* Added some whitespace for readability, added error message to turn_on and turn_off, fixed services.yaml examples

* fixed pylint errors

* readd pass for readability

* fixed small stuff

* Use RemoteDevice, Make send_command non-async

* Ready code for next version of python-miio (Support for pronto hex codes)

* cast command_optional to int, better input validation, fixed index out of bounds error.

* revert code now in python-miio

* ready for python-miio 0.3.5

* Removed unneccary return statements

* require 0.3.5

* Rebase and update requirements_all.txt
2018-02-06 19:47:24 +01:00
Thibault Cohen
a1d586c793 Fix clear playlist in Volumio component (#12173) 2018-02-06 10:46:44 -08:00
Russell Cloran
c7dad113d9 zha: Add support for XBee radios (#12205)
* zha: Add support for xbee radios

* Lint
2018-02-06 10:46:28 -08:00
Dan Nixon
844337ca42 Properly handle thresholds of zero (#12175)
Explicitly test for thresholds to be None rather than truth value
testing (which for number types returns False for zero values).
2018-02-06 10:32:56 -08:00
lance36
0fd17a7c35 Much nicer icon (#12212)
mdi:robot-vacuum will be renamed mdi:roomba 
https://github.com/Templarian/MaterialDesign/issues/2368
2018-02-06 18:52:55 +01:00
Sean Dague
6f74b672a3 Make waterfurnace recovery more robust (#12202)
This makes waterfurnace recovery more robust by catching any
understood exceptions by the library, and always doing another login.
2018-02-06 12:12:35 +01:00
Russell Cloran
f58e5f442d zha: Update to bellows 0.5.0+zigpy (#12187) 2018-02-05 16:05:19 -08:00
tadly
98b47cecbd Upgrade wakeonlan to 1.0.0 (#12190) 2018-02-05 16:04:31 -08:00
Richard Lucas
e7a0759e1c Add support for Alexa.StepSpeaker (#12183) 2018-02-05 16:02:08 -08:00
William Scanlon
bdaf9cfae2 Bump pyeconet version to fix JSONDecodeError (#12204) 2018-02-05 15:59:17 -08:00
hawk259
4f0776de13 Binary Sensor Template: Add icon_template and entity_picture_template support (#12158)
* Binary Sensor Template: Add icon_template and entity_picture_template support

* fix white space

* Added else logging and return state
2018-02-05 23:30:56 +01:00
Rene Nulsch
323fe87b57 Change attributes in new Mercedes Me component (#12147)
* Fix wrong component doc URL

* Change attributes to lowercase snakecase

* pylint fix

* Remove test comments
2018-02-05 23:29:19 +01:00
Fabian Affolter
c72460ccf0 Upgrade Sphinx to 1.6.7 (#12200) 2018-02-05 22:11:20 +01:00
Fabian Affolter
49343c9b02 Replace Gitter with Discord (#12199) 2018-02-05 21:25:37 +01:00
Joe Lu
e35d4f0a2c Canary live stream (#11949)
* Added support for Canary live stream view

* Updated requirements

* - Fixed lint error

* Addressed PR comment

* - Disabled polling for Canary camera as suggested in PR comment
- Live session is now renewed every time camera is retrieved and min time between session renewal is 90 seconds
2018-02-05 14:02:43 +01:00
tbergo
86e89b7c26 Upgrade pytouchline to 0.7 (#12179) 2018-02-05 09:33:07 +01:00
Thibault Cohen
44cfd2999c fix ecobee is_aux_heat_on property (#12186) 2018-02-05 09:21:20 +01:00
Tod Schmidt
f5030d9ebf Services (small_pr)(fix): Added missing return on data template error (#12184)
* Added return on data template error

* Rebased so not sure why spelling errors returned...
2018-02-05 09:19:56 +01:00
Sebastian Muszynski
137933a774 python-miio version bumped. Fixes all xiaomi_miio components. (Closes: #12017, Closes: #11948, Closes: #11200) (#12188) 2018-02-05 09:14:09 +01:00
Fabian Affolter
905a994972 Upgrade schiene to 0.21 (#12176) 2018-02-04 21:33:41 +01:00
Dan Nixon
ec201f3458 Move TP-Link socket LED state setting to update() (#12170)
* Add error handling to TP-LInk LED state set

Handles errors when setting the LED state of TP-Link sockets.

If the socket is unavailable then the raised exception will cause the
compoent to not be added to HA.

* Move LED state setting out of __init__
2018-02-04 19:20:06 +01:00
akloeckner
cff4f8ec9a add delay_arrival (#12169)
This adds the delay_arrival field from the schiene interface.
This field sometimes explains an ontime=false with delay=0...
2018-02-04 18:30:03 +01:00
Fabian Affolter
64cbfdfd77 Upgrade influxdb to 5.0.0 (#12156)
* Upgrade influxdb to 5.0.0

* UPdate sensor as well
2018-02-04 18:23:26 +01:00
kennedyshead
8fe339d2a8 Tests for samsungtv (#11933)
* Testing samsungtv

* Remove samsungtv from .coveragerc
2018-02-03 13:09:16 -05:00
Diogo Gomes
c209c10887 [Mediaroom media_player] Follow up on PR #11864 (#12155)
* addresses @MartinHjelmare on #11864

* as requested by @MartinHjelmare
2018-02-03 17:58:34 +01:00
Diogo Gomes
b33d89326f Panasonic viera new services (#11963)
* Implemented play_media

Panasonic Viera TV has a full blown Web Browser that can play any media

* media stop

* format checks

* added SUPPORT_*

* bump version

* Tks @rytilahti

* one too many
2018-02-03 11:51:34 -05:00
Per Osbäck
1aca6f922f update python-openzwave to 4.1.3 (#12057)
* update python-openzwave to 4.1.0

* 0.4.1.3
2018-02-03 11:08:48 -05:00
ErnstEeldert
9b0dbf3fbe Adding xy_color attribute support to deconz lights (#12106) 2018-02-03 17:08:00 +01:00
ruohan.chen
4ac9e7edf4 fix generic_thermostat bug when restore state from HA start up (#12134)
* fix generic_thermostat bug when restore state from HA start up

if you don't set "initial_operation_mode" in config, you will get
`self._enabled = True` when init GenericThermostat. And then you will
miss the `if self._current_operation != STATE_OFF` statement and the
self._enabled still keep `True`. That's the problem

* add a test to describe the restore case
2018-02-03 16:59:19 +01:00
Fabian Affolter
c144a3339f Upgrade TwitterAPI to 2.4.8 (#12148) 2018-02-03 16:56:35 +01:00
Fabian Affolter
acc767cdb1 Upgrade mutagen to 1.40.0 (#12152) 2018-02-03 16:55:19 +01:00
Diogo Gomes
880f18a37e Mediaroom (#11864)
* make port mapping optional

* dependencies + improvements

* Added bytes and packets sensors from IGD

* flake8 check

* new sensor with upnp counters

* checks

* whitespaces in blank line

* requirements update

* added sensor.upnp to .coveragerc

* downgrade miniupnpc

Latest version of miniupnpc is 2.0, but pypi only has 1.9

Fortunately it is enough

* revert to non async

miniupnpc will do network calls, so this component can’t be moved to
coroutine

* hof hof

forgot to remove import ot asyncio

* Add baudrate option

* merge

* Added Mediaroom media_player component

* Updated header

Works with MEO and VDF set-top boxes in Portugal

* formatting

* Development Checklist (done)

* fix formatting according to houndci-bot

* more format fixing (tks houndci-bot)

* more fixes

* too much cleanup...

* too much

* pylint check

* Initial commit

Basic configuration testing

* flake8 and lint
2018-02-03 08:29:55 -05:00
kennedyshead
f7c9787418 Add Melissa (HVAC/climate) component (#11503)
* Adding component melissa

* Adding sensor component melissa

* Adding Melissa climate component

* Testing component

* Tests for Climate component

* Testing Melissa sensor

* Fixing review Thank you @rytilahti
2018-02-03 03:17:01 +01:00
Nigel Rook
c204a7c787 Tado fixes (#11294)
* Fix tado overlay end state

Previously, when tado ended an overlay state itself, say because a timer
expired or a scheduled temperature change ocurred, the tado climate
component would not return to Smart Schedule mode. This change fixes
that issue

* Correct tado state after multiple rapid updates

Previosuly, making two changes to tado climate within 10 seconds, for
example setting operation mode to Tado mode, then changing the
temperature, would leave the entity showing the incorrect state for up
to a minute.

This change forces an unthrottled update after setting the climate
state, which fixes the issue

* Fix comment formatting
2018-02-02 17:28:54 -08:00
Ville Skyttä
2cbab48e1b Update flake8-docstrings to 1.0.3 (#12136) 2018-02-02 17:22:44 -08:00
Anthony Arnaud
86daec8c59 Fix #11875 Ubus broken since upgrade to 0 57 (#12141) 2018-02-02 17:22:29 -08:00
Anthony Arnaud
0f879a6c60 Fix #8475 device tracker ubus tracks unauthenticated and unassociated devices (#12140) 2018-02-02 17:22:14 -08:00
led-spb
a3e36e6c66 Adding information about current TV channel to WebOS media player (#11339)
* Added Channel attribute to webos media pplayer

* webostv: Current TV channel display as media_title

* Added displaying information about the current TV channel for WebOS platform

* Fixed PEP8 requirements
2018-02-02 23:54:54 +01:00
Thibault Cohen
730e0a0094 Update volumio component (#12045) 2018-02-02 23:12:54 +01:00
Ville Skyttä
13ec8b143d Spelling fixes (#12138) 2018-02-02 22:35:34 +01:00
Rene Nulsch
ed2d54ab45 Add Mercedes me component (#11743)
* Add Mercedes me component

* pump api version to 0.1.2

* Add Mercedes me component

* pump api version to 0.1.2

* clean up code

* Code cleanup

* Remove unneeded return statement

* Return statements added again

* Implement requested changes

* Rework component, move data load to component

* lint

* remove debug logging

* Change RainCloud comments, change from track_utc_time to track_time_interval

* Final cleanup for version 1
2018-02-02 10:56:58 -05:00
Marc Khouri
72c35468b3 Remove asyncio.test_utils to fix tests in Docker/Python 3.7 (#12102)
The module `asyncio.test_utils` has been removed from Python in the 3.7 branch, because it was intended to be a private module for internal testing of asyncio. For more information, see the upstream bug report at https://bugs.python.org/issue32273 and the upstream PR at https://github.com/python/cpython/pull/4785.

For this commit, I have migrated the small amount of functionality that was being used from the `asyncio.test_utils` directly into the `RunThreadsafeTests` Class. To see the original `asyncio.test_utils.TestCase` class, which I pulled some functionality from, please see: https://github.com/python/cpython/blob/3.6/Lib/asyncio/test_utils.py#L440

Note: In addition to being broken in 3.7, this test case also seems to be broken in Python 3.6.4 when using Docker. This PR fixes the test when run in docker.

To reproduce: `./script/test_docker -- tests/util/test_async.py`
failing output (prior to this commit):

```
... trimmed ...
py36 runtests: PYTHONHASHSEED='3262989550'
py36 runtests: commands[0] | py.test --timeout=9 --duration=10 --cov --cov-report= tests/util/test_async.py
Test session starts (platform: linux, Python 3.6.4, pytest 3.3.1, pytest-sugar 0.9.0)
rootdir: /usr/src/app, inifile: setup.cfg
plugins: timeout-1.2.1, sugar-0.9.0, cov-2.5.1, aiohttp-0.3.0
timeout: 9.0s method: signal

―――――――――――――――――― ERROR collecting tests/util/test_async.py ――――――――――――――――――――――――
ImportError while importing test module '/usr/src/app/tests/util/test_async.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/util/test_async.py:3: in <module>
from asyncio import test_utils
/usr/local/lib/python3.6/asyncio/test_utils.py:36: in <module>
from test import support
E ImportError: cannot import name 'support'
```
2018-02-02 14:59:05 +00:00
Eleftherios Chamakiotis
87c0fd98c7 Add support for "off" function to iTunes (#12109)
fixes #7614
2018-02-02 14:54:47 +00:00
Rene Nulsch
1d2e930900 OpenALPR Cloud API - transfer image in body of POST request (#12112)
* Send image in body of POST request

* Fix tests

* Implement requested change
2018-02-02 14:19:13 +01:00
Paul Annekov
ad24cbddcc fixed wrong check for valid range of 'rgb' values (#12132) 2018-02-02 14:02:11 +01:00
nordlead2005
65f22b09ae Dark sky precip accumulation (#12127)
* Added DarkSky Precipitation Accumulation as an hourly forecast field

* fixed spacing
2018-02-02 10:23:27 +01:00
hawk259
569f7e2fea Adds SUPPORT_TARGET_TEMPERATURE_HIGH and SUPPORT_TARGET_TEMPERATURE_LOW support (#12110)
Fixes: [Issue 12048]
2018-02-02 10:11:13 +01:00
Daniel Høyer Iversen
12dc0db856 except vol.MultipleInvalid in Broadlink #11795 (#12107)
* except vol.MultipleInvalid in Broadlink #11795

* typo
2018-02-02 09:05:54 +01:00
Marius
6d5a87afb6 Fixes away_mode error on startup (#12121)
* Fixes away_mode error on startup

* Updated based on feedback
2018-02-02 09:05:19 +01:00
Timmo
30ad591a59 Downgrade Sonarr and Radarr 'Host is not avaliable' errors to warnings (#12119) 2018-02-01 20:57:33 +01:00
Alok Saboo
be37bb14b7 Update jinja2 to 2.10 (#12118) 2018-02-01 19:21:15 +01:00
Craig J. Ward
53a99dc9fa Goalfeed channel (#12086)
* fix event channel name

* I guess accidentally added timeout here too.
2018-02-01 11:24:02 +01:00
jodur
2f07ffc4e4 added media_stop (#12100)
* added media_stop

VLC was missing the media_stop. The pause was present, but starting the same file result in resuming the file instead of start over new

* Corrected style issues

Style issues and added Support Flag to Support VLC

* fixed other style issues

* remove trailing whitespace
2018-02-01 09:49:39 +01:00
Philip Kleimeyer
8991690d53 update tahoma api to version 0.0.11 (#12099) 2018-02-01 08:15:13 +01:00
c727
764343dbf8 Fix detection of mobile browsers (#12075)
* Fix detection of mobile browsers

* Move break

* Add Mobile browsers to list

`Mobile Safari` is covered by iOS and `Opera Mini` does not support es6
... And Edge doesn't even work on desktop for me...
2018-01-31 10:44:33 -08:00
Philip Kleimeyer
e11e066684 updated sensor name (#12084)
* updated sensor name

* Lint
2018-01-31 10:10:35 -08:00
Phil Elson
40af9f2676 Correct use of middleware async handling. (#12078) 2018-01-31 09:04:32 -08:00
Fabian Affolter
424fe95ce4 Upgrade keyring to 11.0.0 (#12082)
* Upgrade keyring to 11.0.0

* Address the removal of 'keyring.__version__'
2018-01-31 09:03:20 -08:00
John Mihalic
81a6178931 Squeezebox Fix duplicate server from discovery (#12063)
* Fix duplicate server from discovery

* Use hass.data instead of global

* Simplify
2018-01-31 15:32:08 +01:00
escoand
e9508405bc Add conditions to forecast (#12074)
* add conditions to forecast chart

* Fix pylint issues
2018-01-31 13:05:15 +01:00
Gerben Meijer
6ae3fa40cf Set flux default stop time to dusk (#12062)
This is more in line with how one would expect light temperature
transitions to take place, but still allows for a user defined
stop_time.
2018-01-31 12:00:47 +01:00
Taylor Peet
434d2afbfc Influx import improvements (#11988)
* Influx import improvements

* fix line length issues

* fixing pylint spaces

* Added refined except clause

* Fix progress bar and exclude issues

* fix travis lint too many blank lines

* Minor changes
2018-01-31 11:39:15 +01:00
Ville Skyttä
0376cc0917 Handle more file closing using context manager (#11942) 2018-01-31 11:30:48 +01:00
escoand
4cb1f93019 fixed timestamp problem in firefox (#12073) 2018-01-31 11:26:35 +01:00
Craig J. Ward
ebfb380449 fix event channel name (#12077) 2018-01-30 21:46:47 -05:00
Marius
3e41422caa Fix demo platform support (#12070)
* Fixing demo platform to use support_flags

* Fixed tests as well

* Moved humidity low / high as always available based on defaults

* Updated demo platform to show more combinations
2018-01-30 14:59:43 -08:00
Ville Skyttä
cab6c694c5 Flake8 bugbear fixes (#12072)
* Don't use mutable argument defaults (bugbear B006)

* Use callable(x) instead of hasattr(x, '__call__') (bugbear B004)

* Remove/mark unused loop control variables (bugbear B007)

* Fix stripping protocol from kodi host name (bugbear B005)

* Fix plant daily history add default date (bugbear B008)
2018-01-30 14:44:05 -08:00
Kane610
37034a7450 Deconz use entity registry (#12067)
* Support for entity registry

* Not everything is a sensor...
2018-01-30 14:42:24 -08:00
Anders Melchiorsen
990fbdf3ca Unique ID for LIFX lights (#12064) 2018-01-30 14:40:44 -08:00
Pierre Ståhl
dfd2d631ae Publish errors on the event bus (#11964)
* Publish errors on the event bus

* Add block till done to test.

* Update test_system_log.py

* Remove old logger handlers
2018-01-30 11:25:58 -05:00
Alex Osadchyy
12182d6e49 Bumped up pymochad requirement to 0.2.0 as a fix for #11928 (#12014)
* Bumped up pymochad requirement to 0.2.0 as a fix for #11928

* requirements_all.txt updated to match pymochad requirements
2018-01-30 05:13:30 -08:00
Anders Melchiorsen
d7017f2138 Prepare for recorder purge to be active by default (#11976) 2018-01-30 12:41:33 +01:00
Paulus Schoutsen
ec1c395f09 Extract requirements (#12051) 2018-01-30 12:30:47 +01:00
Joe Lu
71cb4df817 Return all attributes that are not None in base lock entity class (#12049)
* Return all attributes that are not None in base lock entity class

* Update __init__.py
2018-01-30 12:20:20 +01:00
Paulus Schoutsen
e51427b284 Entity registry (#11979)
* Entity#unique_id defaults to None

* Initial commit entity registry

* Clean up unique_id property

* Lint

* Add tests to entity component

* Lint

* Restore some unique ids

* Spelling

* Remove use of IP address for unique ID

* Add tests

* Add tests

* Fix tests

* Add some docs

* Add one more test

* Fix new test…
2018-01-30 10:39:39 +01:00
Phil Kates
8e441ba03b Refactor Google Assistant query_device (#12022)
* google_assistant: Refactor query_device

The previous code had issues where domains could break out and end up
with weird brightness values and we weren't enforcing the `on` and
`oneline` keys in the response.

* google_assistant: Add media_player to query test
2018-01-30 01:19:24 -08:00
freol35241
5b1c51bdf6 Handling of payload not for this entity. (#11836)
* Handling of payload not for this entity.

The update state-method should not be called if the payload is not intended for this entity.

* Fixing linter errors

* Adding warning for case when no matching payload is found
2018-01-30 10:18:45 +01:00
Phil Frost
8624799c45 Refactor alexa smart_home tests (#12044)
* Refactor alexa smart_home tests

The previous tests had a lot of copy pasta due to a lack of expressions
for higher-level assertions. I'm hoping this makes it more reasonable to
extend all interfaces to support properties.

* Lint
2018-01-29 20:33:39 -08:00
Paulus Schoutsen
1aaf49d0c1 Merge pull request #12047 from home-assistant/release-0-62-1
0.62.1
2018-01-29 16:35:59 -08:00
Fabian Affolter
10263230f7 Upgrade astral to 1.5 (#12042) 2018-01-29 16:08:01 -08:00
Paulus Schoutsen
6f84fa4ce5 Bump frontend to 20180130.0 2018-01-29 16:06:00 -08:00
Anders Melchiorsen
a1c0544e35 Upgrade pyharmony to 1.0.20 (#12043) 2018-01-29 16:04:04 -08:00
c727
a59d26b1fa Fix 404 for Hass.io panel using frontend dev (#12039)
* Fix 404 for Hass.io panel using frontend dev

* Hound
2018-01-29 16:04:03 -08:00
Rene Nulsch
170a0c9888 Error handling, in case no connections are available (#12010)
* Error handling, in case no connections are available

* Fix elif to if
2018-01-29 16:04:03 -08:00
smoldaner
e084a260c6 Fix parameter escaping (#12008)
From rfc3986: The characters slash ("/") and question mark ("?") may represent data within the query component

See https://tools.ietf.org/html/rfc3986#section-3.4
2018-01-29 16:04:03 -08:00
Frantz
8709a397f6 Set default values for Daikin devices that don't support fan direction and fan speed features (#12000) 2018-01-29 16:04:02 -08:00
Ville Skyttä
9fed3acc90 Fix asuswrt AttributeError on neigh for unknown device (#11960) 2018-01-29 16:04:02 -08:00
tschmidty69
0713dbc7a3 Snips - (fix/change) remove response when intent not handled (#11929)
* Remove snips endSession response on unknownIntent

* Removed snips_response for unknown and error.
2018-01-29 16:04:01 -08:00
Anders Melchiorsen
5609b42863 Upgrade pyharmony to 1.0.20 (#12043) 2018-01-29 15:54:49 -08:00
Paulus Schoutsen
24c6285567 Bump frontend to 20180130.0 2018-01-29 15:51:43 -08:00
Paulus Schoutsen
5bdbf3dfc0 Version bump to 0.62.1 2018-01-29 15:40:08 -08:00
smoldaner
6d59dad1ce Fix parameter escaping (#12008)
From rfc3986: The characters slash ("/") and question mark ("?") may represent data within the query component

See https://tools.ietf.org/html/rfc3986#section-3.4
2018-01-29 15:02:26 -08:00
Frantz
99c6a10b99 Set default values for Daikin devices that don't support fan direction and fan speed features (#12000) 2018-01-29 14:56:55 -08:00
kennedyshead
7ad870c4ff Online state for samsungtv is jumping when TV is idle (#11998)
* Set timeout to offline

* Have to rewrite to use ping instead.
2018-01-29 14:55:39 -08:00
Rene Nulsch
89e0b26b73 Error handling, in case no connections are available (#12010)
* Error handling, in case no connections are available

* Fix elif to if
2018-01-29 14:49:38 -08:00
Otto Winter
8dcfd35b8b Spelling fixes (#12041)
* Spelling fixes

*Lots* of them.

* Spelling breaking changes

* Fix lint errors
2018-01-29 23:37:19 +01:00
Otto Winter
38fd9b65bf Fix MQTT cover availability subscription (#12036) 2018-01-29 23:19:08 +01:00
c727
105522f03f Fix 404 for Hass.io panel using frontend dev (#12039)
* Fix 404 for Hass.io panel using frontend dev

* Hound
2018-01-29 23:18:33 +01:00
akloeckner
8b9dc71cde sensor.deutsche_bahn: add only_direct option (#11999)
* sensor.deutsche_bahn: add only_direct option

This adds the `only_direct` option to the HA interface as provided by the schiene class.

* fix line length

as requested by @houndci-bot and @fabaff

* No line breaks needed
2018-01-29 23:17:58 +01:00
Dan Cinnamon
ff0fd71608 Bump upstream lib version. (#12021) 2018-01-29 12:35:13 +01:00
Andy Castille
12a53e2747 Fix DoorBird push notifications for installations with an API password (#12020) 2018-01-29 12:15:53 +01:00
Ville Skyttä
384f63dd1d Typing fixes (#12015)
* .gitignore: Add .mypy_cache

* Typing fixes
2018-01-29 00:24:08 -08:00
Ville Skyttä
78a3c01f27 Flake8 35 (#11972)
* Upgrade flake8 to 3.5

* Fix flake8 bare except errors

* Make flake8 and pylint cooperate
2018-01-29 00:23:53 -08:00
Jack Wilsdon
5426e5c875 emulated_hue: allow customization within emulated_hue configuration (#11981)
* emulated_hue: add entities configuration

* emulated_hue: update tests to include new entities attribute
2018-01-28 23:40:00 -08:00
Phil Kates
766875f702 alexa: Add media_player InputController support (#11946)
`media_player`s can support select_source so map that to an
InputController.

[1]: https://developer.amazon.com/docs/device-apis/alexa-inputcontroller.html
2018-01-28 22:22:04 -08:00
Phil Frost
7d6ef4445e Report states (#11973)
* Refactor Alexa Smart Home API

Having an object per interface will make it easier to support
properties.

Ideally, properties are reported in context in all responses. However
current implementation reports them only in response to a ReportState
request. This seems to work sufficiently. As long as the device is
opened in the Alexa app, Amazon will poll the device state every few
seconds with a ReportState request.

* Report properties for some Alexa interfaces

Fixes (mostly) #11874.

Other interfaces will need properties implemented as well.

Implementing properties for just PowerController seems sufficient to
eliminate the "There was a problem." error for any device that supports
it, even if other interfaces are supported. Of course the additional
properties will be reported incorrectly in the Alexa app.

Includes a minor bugfix: `reportable` was previously placed incorrectly
in the responses, so Amazon was ignoring it.
2018-01-28 17:00:34 -08:00
Phil Frost
84711aad90 Refactor Alexa Smart Home API (#12016)
Having an object per interface will make it easier to support
properties.

Ideally, properties are reported in context in all responses. However
current implementation reports them only in response to a ReportState
request. This seems to work sufficiently. As long as the device is
opened in the Alexa app, Amazon will poll the device state every few
seconds with a ReportState request.
2018-01-28 16:43:27 -08:00
Joe Lu
b3bf6c4be2 Fixed Canary temperature sensor and remapped air quality value (#11355)
* Fixed Canary temperature sensor and remapped air quality value

* Addressed review comment

* - Fixed canary tests and added more tests
- Removed py-canary requirements from tests

* Noop to trigger a build again

* - Removed py-canary requirements from tests

* Addressed PR comment

* - Updated tests
- Removed py-canary from gen_requirements_all.py

* - Fixed hound violation

* Added back py-canary to gen_requirements_all.py as it's still need in tests

* Added back py-canary to test requirements as it's still need in tests

* Address PR comment
2018-01-28 15:30:46 -08:00
Fabian Affolter
c7efe5b7dd Upgrade pyota to 2.0.4 (#11991) 2018-01-28 18:04:54 +01:00
Fabian Affolter
96f9a12541 Upgrade coinbase to 2.0.7 (#11992) 2018-01-28 18:04:40 +01:00
Kevin Goff
336bdb1889 Added support for hourly percent change in coinmarketcap component (#11996)
* Added support for hourly percent change (percent_change_1h)

* Fixed display of 1h percent change
2018-01-28 15:50:43 +01:00
Craig J. Ward
62d4f23833 Add Goalfeed platform (#11098)
* add goalfeed

* use pysher. begin auth

* auth!

* update params

* cleanup

* update library and gen requirements

* unused imports

* case-sensitive

* crazy train

* docstrings and some other fixes

* remove logging

* unused imports

* import in setup

* move import

* Update based on notes

* add timeout

* It's only a component

* Update docstrings
2018-01-28 14:04:40 +01:00
Emil Stjerneman
3c869c6ed6 Fix 11982 - uvc don't handle null as username (#11984) 2018-01-28 10:50:23 +01:00
Ville Skyttä
a3fc2c7fee Update panasonic_viera to 0.3 (#11989) 2018-01-28 09:16:06 +01:00
Ville Skyttä
2d3034be11 panasonic_viera: Set device name from discovery info (#11990) 2018-01-28 09:15:39 +01:00
MGWGIT
1419005082 Update xiaomi_aqara.py (#11969)
Sensor can measure temperature below -20, but maybe not so accurate, but no need to discard measurements.
2018-01-27 22:01:48 +01:00
Fabian Affolter
f43234b533 Bump dev to 0.63.0.dev0 (#11952) 2018-01-27 12:02:55 -08:00
Fabian Affolter
f08fd8182c Upgrade coinmarketcap to 4.2.1 (#11953) 2018-01-27 11:59:33 -08:00
Fabian Affolter
0c008663ad Upgrade sphinx-autodoc-typehints to 1.2.4 (#11954) 2018-01-27 11:59:19 -08:00
Fabian Affolter
63ae275182 Upgrade youtube_dl to 2018.01.21 (#11955) 2018-01-27 11:59:07 -08:00
Fabian Affolter
d8fde94763 Upgrade sqlalchemy to 1.2.2 (#11956) 2018-01-27 11:58:52 -08:00
Ville Skyttä
55ee8959ba Spelling fixes (#11940) 2018-01-27 11:58:27 -08:00
tschmidty69
94316f07a2 Snips - (fix/change) remove response when intent not handled (#11929)
* Remove snips endSession response on unknownIntent

* Removed snips_response for unknown and error.
2018-01-27 11:55:47 -08:00
Ville Skyttä
e750428e9d huawei_router: Fix documentation link (#11961) 2018-01-27 16:33:33 +01:00
Ville Skyttä
3af7c67bf1 Fix asuswrt AttributeError on neigh for unknown device (#11960) 2018-01-27 15:20:28 +01:00
Ville Skyttä
f1fc3c762a tests: Use assertEqual instead of deprecated assertEquals (#11943) 2018-01-27 12:18:02 +01:00
Ville Skyttä
b4d682ca75 Python 3.6 invalid escape sequence deprecation fixes (#11941)
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
2018-01-27 12:16:30 +01:00
Rene Nulsch
cad0bde95b Panel_Iframe - Allow relative urls in config (#11832)
* Panel_Iframe - Allow relative urls in config

* change regex to check for starting forward slash only

* Change error message and const name
2018-01-26 22:31:40 -08:00
Rene Nulsch
74b0740e1c Weblink - Allow relative urls in config (#11808)
* Allow relative url

* Allow absolute urls in config schema

* change after pylint build

* Add tests and change error message

* Change regex to check starting forward slash only

* Change error message and const name
2018-01-26 22:30:39 -08:00
Paulus Schoutsen
5bde72d490 Merge pull request #11921 from home-assistant/release-0-62
0.62
2018-01-26 21:07:57 -08:00
Daniel Perna
af69a307a8 Update pyhomematic to 0.1.38 (#11936) 2018-01-26 20:32:08 -08:00
Phil Frost
7bbef68b2a Implement Alexa temperature sensors (#11930) 2018-01-26 20:32:08 -08:00
Bas Schipper
abde8c40c9 Fixed rfxtrx binary_sensor KeyError on missing optional device_class (#11925)
* Fixed rfxtrx binary_sensor KeyError on missing optional device_class

* Fixed rfxtrx binary_sensor KeyError on missing optional device_class
2018-01-26 20:32:08 -08:00
Paulus Schoutsen
07b2f38046 Allow setting climate devices to AUTO mode via Google Assistant (#11923)
* Allow setting climate devices to AUTO mode via Google Assistant

* Remove cast to lower

* Clarify const name
2018-01-26 20:32:07 -08:00
kennedyshead
280c1601a2 fixes #11848 (#11915)
Adding tests to check the component after latest patch
2018-01-26 20:32:07 -08:00
Andrey
df24ecf395 Add "write" service to system_log (#11901)
* Add API to write error log

* Move write_error api to system_log.write service call

* Restore empty line
2018-01-26 20:32:06 -08:00
Daniel Perna
af5d0b3443 Update pyhomematic to 0.1.38 (#11936) 2018-01-26 21:41:43 +01:00
Robert Schütz
2b68bec428 check_config.py: allow colorlog==3.1. (#11927) 2018-01-26 10:43:55 -08:00
Phil Frost
ffcc41d6ef Implement Alexa temperature sensors (#11930) 2018-01-26 10:40:39 -08:00
kennedyshead
2d8ef36a6c fixes #11848 (#11915)
Adding tests to check the component after latest patch
2018-01-26 10:30:48 -08:00
Aaron Bach
5af7666a61 Adds allergy/disease sensor platform from Pollen.com (#11573)
* Base platform in place

* Logic in place

* Requirements and coverage

* Fixed some linting issues

* Small attribute reorganization

* Collaborator-requested changes round 1

* Updated documentation
2018-01-26 18:40:02 +01:00
Bas Schipper
bfe259f7a0 Fixed rfxtrx binary_sensor KeyError on missing optional device_class (#11925)
* Fixed rfxtrx binary_sensor KeyError on missing optional device_class

* Fixed rfxtrx binary_sensor KeyError on missing optional device_class
2018-01-26 13:45:02 +01:00
akloeckner
68d2851ecf Map media_stop to idle state (#11819)
adresses #11813
2018-01-26 12:57:54 +01:00
Andrey
8332d4e359 Add "write" service to system_log (#11901)
* Add API to write error log

* Move write_error api to system_log.write service call

* Restore empty line
2018-01-26 12:41:52 +01:00
Paulus Schoutsen
390b727869 Allow setting climate devices to AUTO mode via Google Assistant (#11923)
* Allow setting climate devices to AUTO mode via Google Assistant

* Remove cast to lower

* Clarify const name
2018-01-26 12:37:06 +01:00
Paulus Schoutsen
deb10a1c4d Update frontend to 20180126.0 2018-01-25 23:26:14 -08:00
Paulus Schoutsen
3d8e425113 Update frontend to 20180126.0 2018-01-25 23:26:02 -08:00
Paulus Schoutsen
a8ee11e732 Version 0.62 2018-01-25 23:17:07 -08:00
Nash Kaminski
748fff7ebc Allow separate command and state OIDs and payloads in SNMP switch (#11075)
* Allow separate command and state OIDs and payloads in SNMP switch

Follow PEP8 style properly

More PEP8 style fixes

Fully PEP8 compliant

* Fix pylint errors

* Remove comment to satisfy pylint

* Style changes/refactoring
2018-01-25 22:48:21 -08:00
Nolan Gilley
9a71717047 Add ERC20 tokens to etherscan.io sensor (#11916)
* upgrade python-etherscan-api

* add support for erc20 tokens
2018-01-25 21:08:08 -08:00
Phil Frost
920f9f132b Report scripts and groups as scenes to Alexa (#11900)
* Send Alexa Smart Home responses to debug log

* Report scripts and groups as scenes to Alexa

The Alexa API docs have a couple display categories that sound relevant
to scenes or scripts:

    ACTIVITY_TRIGGER: Describes a combination of devices set to a
    specific state, when the state change must occur in a specific
    order.  For example, a “watch Neflix” scene might require the: 1. TV
    to be powered on & 2. Input set to HDMI1.

    SCENE_TRIGGER: Describes a combination of devices set to a specific
    state, when the order of the state change is not important. For
    example a bedtime scene might include turning off lights and
    lowering the thermostat, but the order is unimportant.

Additionally, Alexa has a notion of scenes that support deactivation.
This is a natural fit for groups, and scripts with delays which can be
cancelled.

https://developer.amazon.com/docs/device-apis/alexa-discovery.html#display-categories

The mechanism to map entities to the Alexa Discovery response is
refactored since extending the data structures in MAPPING_COMPONENT to
implement supportsDeactivation would have added complication to what I
already found to be a confusing construct.
2018-01-25 21:06:57 -08:00
arcsur
3aa3130d05 Minor fix to configuration validation and related log line. (#11898) 2018-01-25 21:01:43 -08:00
David Fiel
caa16da5c5 Multi-Room Support for Greenwave Reality (#11364)
* Multi-Room Support for Greenwave Reality

* PEP8 Line Too Long

* Update requirements_all.txt

* Shared State Object

Shared State Object added, and implemented new function of greenwavereality to abstract complex runtimes.

* Update requirements_all.txt

* Lint issues

* Rewrite method to not trigger "Method could be a function"

* Remove unnecessary arguments for update call
2018-01-26 00:00:32 +01:00
Jerad Meisner
94e270f828 Added Xeoma camera platform (#11619)
* Added Xeoma camera platform

* Switch to dict.get() for optional config values with no default

* Minor changes
2018-01-25 23:48:38 +01:00
i-am-shodan
502ebd2a31 Improve foscam library exception support (#11701)
* Improve foscam library exception support

Catches foscam exceptions that otherwise pollute the log. Many of these exception can safely be ignored

* Fixed line length

Fixed line length

* Changed exception and log handling

changed logging and catched only the TypeError effecting the library

* Removed unused var

Removed var

* Fix remaining issue
2018-01-25 23:47:53 +01:00
Johannes Innerbichler
0db9c04f21 Iota wallet (#11398)
* worked on first version of IOTA wallet

* added sensor for IRI node

* added requirements

* ignored new component in test coverage

* changed length of line

* fixed linter issues

* changed requested changes

* moved attributes of IRI node

* change coverage definitions

* changed loading of platforms

* changed loading of platforms

* changed initial state of wallet sensor

* changed handling of config

* changed attribute handling for IOTA node sensor

* Follow the component style

* Fix ordering and docstring

* Fix pylint issue
2018-01-25 19:46:48 +01:00
Dan Cinnamon
72bb0e97e0 New venstar climate component (#11639)
* New venstar climate component

* Corrected items raised during the PR process.

* Corrected flak8 issues.

* Add support for venstar models without humidity control.

* Changed the idle operation mode to off.  Few other adjustments.

* Minor changes (log messages, sorting, etc.)
2018-01-25 18:34:53 +01:00
William Scanlon
5123487705 Update python-wink version and multiple wink fixes/updates. (#11833) 2018-01-25 11:31:38 -05:00
Paulus Schoutsen
3d9ff372fc Use API to discover Hue if no bridges specified (#11909)
* Use API to discover Hue if no bridges specified

* hide config file
2018-01-25 14:55:14 +01:00
Paulus Schoutsen
9123dfce6d Clarify emulated hue warning (#11910) 2018-01-25 11:20:37 +01:00
tschmidty69
27edbe5c0f Snips - (fix) removed endSession mqtt response on error and unknown intents (#11908)
* Remove snips endSession response on unknownIntent

* Removed snips_response for unknown and error.
2018-01-24 22:50:36 -08:00
tschmidty69
ffe832763d Pushbullet (fix) invalid keyword, added unittests (#11804)
* Fixed unittests

* revert requirements

* added pushbullet.py to requirements

* updated requirements
2018-01-24 21:06:35 +01:00
lich
becd94fe2f Add android option for linux_battery.py (#11852)
* Add android option for linux_battery.py

* Add system option for linux_battery.py, support android.
2018-01-24 13:51:39 +01:00
arcsur
a0a001db71 Bme680 (#11892)
* Added documentation reference to code

* Some code clean-ups suggested by @MartinHjelmare in PR#: 11695 after merging.

* fixed minor typo in docstring

* fixed another minor typo in same docstring...

* fixed another minor typo in same docstring...
2018-01-24 03:44:29 -08:00
Gregory Dosh
d65ac7421d device tracker - tomato https support (#11566)
* initial https support

* adding tests

* lint errors

* missing docstring

* fixing non-deterministic params

* fixing non-deterministic params

* Updating docstrings & added missing tests

* revert _LOGGER

* updating default port to reflect ssl/nonssl

* fixing docstrings for tests
2018-01-24 04:51:06 -05:00
Frantz
b43b542667 Handle Daikin AC adapters without fan mode and swing mode support (#11840)
* Handle daikin AC devices without FAN_MODE and SWING_MODE support

* Handle daikin AC devices without FAN_MODE and SWING_MODE support
2018-01-24 09:39:25 +01:00
Frantz
676c95ed2d [SMALL-PR] Don't make climate calls if feature is not supported (#11841)
* Don't make climate calls if feature is not supported

* Implemented suggested code review changes & cleanup

* Fix demo climate unit tests
2018-01-24 09:35:31 +01:00
Anders Melchiorsen
5b0a475197 Postpone "Z-wave not ready" warning (#11807)
* Release worker thread while waiting for Z-wave startup

* Increase zwave startup timeout

* Adjust test

* Use asyncio.sleep in _check_awaked

* Remove lint

* Name loop parameter
2018-01-24 09:27:58 +01:00
Sean Dague
4521d59bec Bump waterfurnace library to 0.3.0 (#11888)
Fixes in the library to handle transaction id which has to roll over
otherwise the server gets confused.
2018-01-24 08:24:54 +01:00
Rendili
8f083e17f8 Fix for hive aux_heat target temperature display (#11884) 2018-01-23 16:16:38 -08:00
Nolan Gilley
9a3895c79e upgrade ecobee (#11878) 2018-01-23 23:03:54 +01:00
Paul Annekov
eea7e2fa2d fixed async function called in a thread (#11882) 2018-01-23 22:44:07 +01:00
Phil Frost
990e076c2c Expose Alexa Smart Home via HTTP POST (#11859)
* Expose Alexa Smart Home via HTTP POST

Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.

* Expose Alexa Smart Home via HTTP POST

Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.
2018-01-23 10:45:28 -08:00
Sean Dague
73fa76d792 Add missing mock call for test_minimal_config (#11858)
In local testing py36 always fails on test_minimal_config on a wait
call that never completes. One difference between this test and others
in the class is the lack of a mock on `call`. With this added, the
test passes locally 100%.
2018-01-23 14:02:00 +01:00
Pascal Vizeli
6df1fae447 Hass.io panel v2 (#11860)
* Update hassio.py

* fix test

* Update test_hassio.py
2018-01-23 11:39:55 +01:00
Paul Annekov
3417c6ad8d Checking Xiaomi Aqara devices unavailability states (#11631)
* added unavailability tracker, updated sensor component

* change hass argument position according to position in binary_sensor

* added hass argument to binary_sensor, updated is_on(), it can be UNAVAILABLE now

* updated switch component to support unavailability feature

* updated light component to support unavailability feature

* updated cover component to support unavailability feature

* set _hass property

* added unavailability tracker, updated sensor component

* change hass argument position according to position in binary_sensor

* added hass argument to binary_sensor, updated is_on(), it can be UNAVAILABLE now

* updated switch component to support unavailability feature

* updated light component to support unavailability feature

* updated cover component to support unavailability feature

* set _hass property

* fixed error with wrong arguments number during callback call

* reset unavailability state on new message received from device

* use locks to fix race condition during managing _state property

* overriden state() method for some components to check for STATE_UNAVAILABLE and return it instead e.g. STATE_OFF

* fixed linter

* removed blank line

* use available() method instead of changing _state

* filter motion sensors 'heartbeat', was removed from PyXiaomiGateway

* remove self._hass, use self.hass set by HA on attach

* self.push_data now running in the event loop, use async_schedule_update_ha_state()

* merge fix

* removed accidentally added home-assistant-polymer

* bump PyXiaomiGateway version to 0.8.0

* bump PyXiaomiGateway to 0.8.0

* updated methods names and annotations
2018-01-23 10:22:43 +01:00
Phil Frost
95592d9283 Respond to Alexa scene activation correctly (#11869)
The API documentation[1] specifies that Alexa.SceneController Activate
must get a ActivationStarted response. Responding with just a `Response`
will elicit a "Hmm... $scene is not responding" from Alexa.

[1]: https://developer.amazon.com/docs/smarthome/provide-scenes-in-a-smart-home-skill.html
2018-01-23 00:01:18 -08:00
arcsur
09e3bf94eb BME680 Sensor Component (#11695)
* Adding BME680 Sensor Component

* Flake8 lint fixes

* PyLint fixes

* Fix for log line

* Updating requirements for testing

* Fix PyLint Log format errors and add to coveragerc ommisions as requires sensor connected

* Regenerated requirements_all.txt

* Added Pylint exception for import error of system specific library

* Refactored async_add_platform to move IO out to avoid heavy yield usage
2018-01-22 23:51:52 -08:00
Frantz
bc13c9db83 Allow exposing sensors as temperature or humidity 'climate' devices to Google Assistant (#11095)
* Allow exposing sensors as temperature or humidity as 'climate' to Google Assistant

* Fixed hound

* Fixed hound

* Handled correctly unit of measurement to fix humidity

* Fixed temperature conversion for Google climate components

* Fixed temperature conversion for Google climate components

* Fixed indentation

* Fixed hound

* Fixed tests

* Fixed conversion and unit tests

* Fix sync for custom unit temperature

* Implemented requested changes

* Fix hound

* Fix linting errors

* Added success tests for sensors as climate

* Fix lint errors
2018-01-22 23:23:33 -08:00
Paulus Schoutsen
183e0543b4 Clean up entity component (#11691)
* Clean up entity component

* Lint

* List -> Tuple

* Add Entity.async_remove back

* Unflake setting up group test
2018-01-22 22:54:41 -08:00
Sean Dague
d478517c51 Fix races on recorder test (#11857) 2018-01-22 15:21:56 +01:00
Pascal Vizeli
b224fd324d Fix new iframe panel url (#11850)
* Fix new iframe panel url

* fix tests
2018-01-22 14:45:48 +01:00
Oleksii Serdiuk
8c627e2b8b maxcube: Set MAX! Window Sensor's class to 'window' (#11799)
The sensors are meant to be put on windows to shut down the heating when
windows are open. Having 'window' device class instead of 'opening' is
much more logical here.
2018-01-22 12:32:27 +01:00
Marius
c8d26d99f0 Fix issues with generic thermostat (#11805)
* Fixes for #11757 #11798 #11763

* Adjustments based on feedback
2018-01-22 12:12:03 +01:00
kennedyshead
0f26ebe954 Use strict timeout when polling Samsung TV (Fix for #6375) (#11759) 2018-01-22 08:11:16 +00:00
andrewdolphin
5513ffc33c Change 'on' to 'heat' as fallback thermostat mode (#11377)
* Change 'on' to 'heat' as fallback thermostat mode

'on' isn't recognised as a mode by Google Assistant, rather is used as a method to return a thermostat to a previous mode. In the case where a thermostat doesn't support the standard google modes (e.g. A homematic radiator thermostat) this means the set_temperature doesn't get returned to the user on a request.

* Update test_google_assistant.py
2018-01-21 12:57:56 -08:00
William Scanlon
6a6ea263cf Fix Unifi direct errors caused by AP reboot. (#11835)
* Fix Unifi direct errors caused by AP reboot.

* Inverted logic in update
2018-01-21 18:13:28 +01:00
Teemu R
1a789a05db bump eq3bt version (#11834) 2018-01-21 11:45:20 +01:00
Fabian Affolter
47e31dc9ee Fixes for PEP257 (#11810)
* Fixes for PEP257

* More updates
2018-01-20 22:35:38 -08:00
Frantz
0100f87ff2 (Re)Enable Daikin autodiscovery (#11842) 2018-01-21 06:08:42 +01:00
Sean Dague
8c78a210ef Add waterfurnace platform (#11732)
Add waterfurnace platform

This adds support for waterfurnace geothermal systems. This is
implemented as a component as there will eventually be some active
control elements. This is not done as a climate platform because
geothermal systems work best when set at a constant temperature as
they are tuned to keep within 0.5 degrees F of a setpoint, and large
temperature shifts are slow and expensive.

This is done in the Data + Sensors model, with the Data component
having a regular update thread. That thread needs to call the read()
function at least every 30 seconds otherwise the underlying websocket
is closed by the server.
2018-01-20 16:51:59 -05:00
Sebastian Muszynski
dd81af4cd5 python-miio version bumped. Fixes all xiaomi_miio components. (Closes: #11768) (#11837) 2018-01-20 21:27:52 +01:00
Dan Nixon
2cfbd0dc1d Add missing availability schema to MQTT alarm panel (#11829)
* Add missing availability schema to MQTT alarm panel

* Add tests for default MQTT availability payloads
2018-01-20 17:11:04 +01:00
Filip Bednárik
a470cc212e Add more workday sensor countries and update holidays library to version 0.9.3 (#11826) 2018-01-20 17:09:05 +01:00
Michaël Arnauts
f7b129d790 Change telldus domain to download.telldus.com (#11825) 2018-01-20 17:07:45 +01:00
Jens Østergaard Nielsen
e02d5e7ff1 Ihc component and platforms (#10916)
* Added IHC platform

* Updated requirements for IHC platform

* Exclude IHC from test

* Correcting flake8 issues

* Fixing more flake8 issues

* Fixed flake8 issues

* Fixing pylint issues

* Fixed flake8 issues

* Changes from PR review.

* STATE_UNKNOWN changed to None

* Spelling mistake in comment

* Added IHC platform

* Updated requirements for IHC platform

* Exclude IHC from test

* Correcting flake8 issues

* Fixing more flake8 issues

* Fixed flake8 issues

* Fixing pylint issues

* Fixed flake8 issues

* Changes from PR review.

* STATE_UNKNOWN changed to None

* Spelling mistake in comment

* Updated requirements_all.txt with gen_requirements_app.py

* Pylint fix: No space allowed around keyword argument assignment

* PR review changes

* Moved auto setup from platforms to ihc component

* Do no auto setup if there are no IHC products found

* Changes from PR review
2018-01-20 16:29:50 +01:00
ChristianKuehnel
323992e224 MiFlora - use bluepy on linux systems (#11284)
* Updated bluepy to version 1.1.4 as some issues with the native code were fixed there.

* Miflora - Added support for bluepy backend.

* miflora - now using bluepy backend on linux platforms

* fixed pylint findings

* miflora now using bluepy as default bluetooth backend and gatttool as fallback

* fixed hound complaints

* fixed pylint warning

* updated requirements

* Update miflora.py
2018-01-20 08:50:25 +01:00
Spencer Oberstadt
f744467c5d bump roku version (#11816) 2018-01-19 21:56:56 -08:00
robhuls
7cbe017932 Nad (#11800)
* Update nad_receiver to 0.0.9

* Update nad_receiver to 0.0.9
2018-01-19 21:41:12 -08:00
Paulus Schoutsen
c1b0ab75e1 Update frontend to 20180119.0 2018-01-19 09:54:01 -08:00
Paulus Schoutsen
51c41ba4e3 Disable installing Telldus in Docker (#11806) 2018-01-19 09:47:45 -08:00
Lukas Barth
51dd9b6dde Fix recorder purge (#11802)
* Do proper largest-of query

* Fix error when event_id is NULL
2018-01-19 08:56:28 -08:00
Martin Rowan
d697e8e677 Correct inadvertent change to file permissions (#11755) 2018-01-19 16:28:47 +01:00
Paul Rabahy
d5df1c070d Make Google TTS secure (#11031)
* Make Google TTS secure

I noticed that my TTS queries were showing up in the log on my router, so I was curious if there was a way to make it secure. A quick search showed people using https instead of http (https://stackoverflow.com/questions/32053442/google-translate-tts-api-blocked), so I figure that should work. I am using hass.io, so I'm not actually sure how to test this, but its a pretty simple change.

* Fix the tts test.
2018-01-19 16:27:40 +02:00
Andrey
273db75248 Always load yr picture from https (#11796) 2018-01-19 13:06:34 +01:00
Andrey
5ef7a8d55a Fix sensibo function names (#11797) 2018-01-19 13:04:53 +01:00
starkillerOG
2ca4bde06a Hyperion: fix (#11793) 2018-01-19 10:50:12 +01:00
Daniel Høyer Iversen
4ceb13291f flux led version 0.20 (#11791) 2018-01-19 00:44:40 -08:00
Sebastian Muszynski
03a5d4e131 Additional attributes and services of the Xiaomi Air Purifier introduced (#11249)
* Attributes average_aqi and purify_volume introduced. Fixes https://github.com/syssi/xiaomi_airpurifier/issues/14.
New service light.xiaomi_miio_set_child_lock_{on,off} added. Fixes https://github.com/syssi/xiaomi_airpurifier/issues/13.

* Lazy loading of service descriptions.

* Merge conflict resolved.
2018-01-18 23:50:56 -08:00
Philip Kleimeyer
5de828d6e2 add generic rollershutter agian, was missing in last merge (#11788) 2018-01-18 23:47:35 -08:00
ChristianKuehnel
b84e551aea plant - check history for min_brightness (#9534)
* Added option to create a group for the plant and all of it's sensors so that they appear together in the UI

* fixed warnings from the hound

* added check for min_brightness over several days

* fixed hound complaints

* 1) added missing dependency on recorder
2) using group.Group instead of hass.states.async_set as requested by @pvizeli

* fixed pylint error in docstring

* changed the way the groups are created

* fixed requirements issue

* Changed the way the groups are implemented. This is proposal number 4...

* Data read from recorder only on startup.

We now only store one data point per day. If a recorder is configured, this data is initialized from the database. If not the list is empty on startup.

* added missing documentation

* fixed typo in comment

* removed group fature

* added group dependency since it's still needed

* fixed bug: now "None" is no longer added to the DailyHistory

* now also outputting unit of measurement if defined by the sensors

* removed iconss

* fixed line length

* Implemented changes requested in code reviews.

These changes affect the interface to the UI:
* renamed attribute for units of measurement to "unit_of_measurement_dict"
* renamed attribute for maximum in brightness history to "max_brightness"

* only loading the history if a brightness sensor was configured

* fixed testcase

* fixed stupid bug in check of brightness history

Also added test for this bug

* added missing docstring

* Fixed sporadic failure in test case.

Sometimes the component was created before the data was stored in the history. This lead to an empty history being read.

* removed unused import statement in testcase

* reverted change to test case

* Changed startup behavior of the component.

No failed tests after 20 local test runs.

* added missing docstring

* fixed tests

* added hass.start() to Setup
* fixed call parameters in constructor
* added time.sleep

* removed sleep

* fixed typo in variable name

* disabled loading from database as it's not stable at the moment and nobody knows why :(

* fixed flake8

* now using pytest.mark.skipif to skip test
2018-01-18 23:46:12 -08:00
Steaff
c48ef281ab Homematic ip tilt covers (#11650)
* add pyhomematic support for ip and tiltable covers

* use cached data in current_cover_tilt_position

* check for existance not for None

* reformatting

* check node for LEVEL_2
2018-01-18 23:20:05 -08:00
Sebastian Muszynski
b10fd172fd Service for setting a fixed scene of Xiaomi MIIO lights (#10819)
* Service for setting a fixed scene introduced.

Fixes https://github.com/syssi/philipslight/issues/6.
Fixes https://github.com/home-assistant/home-assistant/issues/10458.

* Service description added.

* Typo fixed.

* Error message updated and naming improved.

* Name ("scene") of the method parameter aligned.

* Hound error fixed: Spaces removed.

* async_setup_platform method simplified.

* Lazy loading of service descriptions.

* Unused import removed.
2018-01-18 22:52:30 -08:00
William Scanlon
314582ef0c Support for performance mode on Rheem water heaters. (#11786) 2018-01-18 22:37:24 -08:00
Fabian Affolter
b1fd9daf5f Fix typos (#11781) 2018-01-18 22:36:48 -08:00
Fabian Affolter
7fe2dafa04 Fix PEP8 and PEP257 issues (#11780) 2018-01-18 22:36:29 -08:00
tschmidty69
48619c9d7c Implemented event_data_template (new) (#11057)
* Implemented event_data_template

* The hound does not like my indentation

* Added passed variables to tests for event and svc template calls

* Moved recursive function to template.py

* Update template.py

* Update template.py

* Cleaned up service.py and fixed unit tests

* Blank lines

* Removed stray logger statement

* Blank lines again
2018-01-18 22:13:14 -08:00
tschmidty69
0e1cc05189 Snips: (change) Removed unknown intent speech response (#11776)
* Removed unknown intent speech response

* Fixed tests, doh!

* Woof
2018-01-18 22:01:04 -08:00
Anders Melchiorsen
ce9673b06d Limit service description loading to a single thread (#11733) 2018-01-18 21:59:03 -08:00
Kane610
a9634199e6 Axis discovery fails to save conf (#11769)
* Signal callback isnt JSON serializable so it has to be removed before saving to conf

* Remove filtered events list which is not a part of component configuration
2018-01-18 14:51:01 -08:00
karlkar
cf6f916ed4 Fix for Neato D3 and D5 (#11775) 2018-01-18 23:37:24 +01:00
Jean-Philippe Jodoin
8ca45acb4e Added support for TekSavvy bandwidth sensor (#11186)
* Added support for TekSavvy bandwidth sensor

* Variable name fix

* Units are Gigabytes and not Gigabits

* Change REST calls to use asyncio

* houndci violation fix

* pylint fix

* Fix for code review

* Import order asyncxxx:wq

* Tweak docstrings and log message
2018-01-18 23:15:13 +01:00
Fabian Affolter
23b2ca50e2 Update header and make it less verbose (#11774) 2018-01-18 23:04:18 +01:00
markferry
526405c83b Add a 'last' mode and attribute to min_max sensor (#11037)
* Add 'last' type to min/max sensor

Now supports types: min, max, mean, last
'last' is the most recently received value from all tracked entities.

* Min/max sensor 'last' type test

* Fix min/max sensor 'last' test
2018-01-18 23:03:41 +01:00
Conrad Juhl Andersen
536424b0c8 Owntracks: Use bluetooth_le as source_type if beacon was used for location change. (#11615)
* Use bluetooth_le source_type, if location was changed by beacon

* No reason to do nested ifs

* Added tests for source_type on owntracks

* Fixed The Hound

* Added test and fixed bug surfaced by test
2018-01-18 23:00:20 +01:00
Ioan Loosley
0859e38bd5 Unit should be mph as that is what the metoffices datapoint API returns (#11760) 2018-01-18 22:03:01 +01:00
Matthias Dötsch
46bbd78b23 Use localized forecast for openweathermap (#11770)
Use "detailed status" of forecast to get localized value
2018-01-18 21:59:50 +01:00
Fabian Affolter
5c474ec42d Update icon (fixes #11744) (#11758) 2018-01-18 21:48:21 +01:00
Alok Saboo
2df2f35423 Round off exchange rate (#11765) 2018-01-18 21:47:46 +01:00
Daniel Høyer Iversen
216075cc72 set default value for rfxtrx config (#11767) 2018-01-18 19:58:56 +01:00
Paulus Schoutsen
f5fba333d9 Upgrade netdisco (#11752) 2018-01-18 12:51:01 +01:00
Rene Nulsch
aad14b8b87 Xbox sensor - Extend error handling (#11637)
* Extend error handling fix #9016

* lint finding

* Implement requested changes

* Remove unneeded return statement
2018-01-17 21:26:23 -08:00
Kane610
8bcaf832ae Add deCONZ entities in a predicitive order (#11712)
* Make sure that entities names are created in a predicitive order

* Debug print for deconz config parameters

* Bump requirement to v25
2018-01-17 21:22:42 -08:00
Thijs de Jong
aac01cb096 Fix Tahoma device class (#11745)
* fix device class

* edit description
2018-01-17 21:20:23 -08:00
iliketoprogram14
e72fefa74d Fixed universal media player templated source_select bug (issue #10981) and corrected typo in test_universal (#11746) 2018-01-17 21:19:34 -08:00
karlkar
7617b8af52 Fix for None object access attempt (#11748)
* Fix NoneType access error

* Update lib dependencies

* Fix for line length
2018-01-17 21:10:15 -08:00
Martin Rowan
33fd9c7c8f Fix effects not appearing in UI due to missing attribute (#11738) 2018-01-17 22:00:46 +01:00
Pierre Ståhl
8703124c76 Add enable_output service to Yamaha platform (#11103)
* Add enable_output service to Yamaha platform

* Fix lint issues

* Fix review comment

* Check entity_ids instead of device
2018-01-17 19:34:21 +01:00
Pascal Vizeli
4ee2c311a7 Don't use None inside header (#11725) 2018-01-17 15:20:26 +01:00
Dan Nixon
020593d509 Override default name for TP-Link devices (#11710)
Fixes #11706

Corrects a bug introduced that prevents the names of TP-LInk devices
from being pulled from the devices themselves.
2018-01-17 00:52:32 -08:00
Åskar Andersson
1f118c4b84 Update mold_indicator.py (#11715) 2018-01-17 09:12:50 +01:00
Paulus Schoutsen
abbc6a2587 Merge branch 'master' into dev 2018-01-16 14:49:03 -08:00
Paulus Schoutsen
37eb6c90b6 Merge pull request #11716 from home-assistant/release-0-61-1
0.61.1
2018-01-16 14:33:12 -08:00
Lukas Barth
fc302186b2 Fix purge with MariaDB / MySQL (#11713) 2018-01-16 13:37:38 -08:00
Bob Anderson
903ca567c5 History order bugfix and opt-in option (#11686)
* make history view re-ordering optional and opt-in, also fix type bug

* use python false for default value

* whitespace cleanup
2018-01-16 13:37:37 -08:00
Daniel Høyer Iversen
fd75f157d6 Rfxtrx fix (#11678)
* fix voluptuous bug in rfxtrx

* fix voluptuous bug in rfxtrx

* fix voluptuous bug in rfxtrx
2018-01-16 13:37:37 -08:00
Anders Melchiorsen
f86224a64e Move several local services to their right domain (#11677)
* Move several local services to their right domain

* Fix lint
2018-01-16 13:37:37 -08:00
Russell Cloran
ed41252207 Fix zha color probe (#11670) 2018-01-16 13:37:36 -08:00
Paulus Schoutsen
6ec411b4bb Version bump to 0.61.1 2018-01-16 13:37:19 -08:00
Lukas Barth
5a26d4c039 Fix purge with MariaDB / MySQL (#11713) 2018-01-16 13:35:23 -08:00
Bob Anderson
94950cccc8 History order bugfix and opt-in option (#11686)
* make history view re-ordering optional and opt-in, also fix type bug

* use python false for default value

* whitespace cleanup
2018-01-16 11:48:10 -08:00
Sergey Isachenko
3a00077305 Tesla bug fix #11598 (#11707) 2018-01-16 17:34:41 +01:00
Wolf-Bastian Pöttner
4a82606ffb Feature/fritzdect errorhandling (#11490)
* Update to fritzhome 1.0.4

* Improved error handling, added autoreconnect on connection failure

* Move from STATE_UNKNOWN to None
2018-01-16 15:55:22 +01:00
Fabian Affolter
d5f63ebac4 Add attributes (#11698) 2018-01-16 12:32:08 +01:00
Åskar Andersson
dce079e711 fixed not to include spaces or dots in attribute names (#11694)
mold_indicator should be fixed not to include spaces or dots in attribute names

https://community.home-assistant.io/t/how-to-show-sensor-attribute-est-crit-temp-in-customize-template-and-extra-badge/39451
2018-01-16 10:59:20 +01:00
Fabian Affolter
632525f4d0 Enable probot move (#11690) 2018-01-16 09:25:13 +01:00
karlkar
98692523bf Added extra arguments to onvif platform config (#11680) 2018-01-16 09:23:48 +01:00
Anders Melchiorsen
87534692d0 Move several local services to their right domain (#11677)
* Move several local services to their right domain

* Fix lint
2018-01-15 14:53:56 -08:00
Daniel Høyer Iversen
a358174536 Rfxtrx fix (#11678)
* fix voluptuous bug in rfxtrx

* fix voluptuous bug in rfxtrx

* fix voluptuous bug in rfxtrx
2018-01-15 14:26:27 -08:00
Russell Cloran
ff32f90a29 Fix zha color probe (#11670) 2018-01-15 14:25:59 -08:00
Fabian Affolter
fb69620e49 Upgrade pylast to 2.1.0 (#11668) 2018-01-15 14:25:00 -08:00
Fabian Affolter
d219f244d2 Upgrade sqlalchemy to 1.2.1 (#11666) 2018-01-15 14:24:34 -08:00
Fabian Affolter
b0860ce5f0 Change line separator to LN (#11662) 2018-01-15 14:24:12 -08:00
Fabian Affolter
56a2c587ad Upgrade youtube_dl to 2018.01.14 (#11661) 2018-01-15 14:23:53 -08:00
Thom Troy
c43eceb2cb add temperature controls to eph-ember (#11400)
* add temperature controls to eph-ember

* fix linting
2018-01-15 23:13:48 +01:00
angel12
799e1f0469 Wemo Dimmer Support (#10882)
* Wemo Dimmer Support

Add support for the Wemo Dimmer Switch

* Add newline at end of file

Re: findings from hound

* Syntax for the hound

Sorry for the excess edits, new to python

* Change order of Models

Fixed order back to ABC order

* Changes as requested

I made the changes I was comfortable with at this point, the dimmer addition now very closely mirrors what is under the switch component, at least as far as the parts necessary for the dimmer.

Any changes past these with regards to the subscription registry / callback info is probably going to be over my head, but I will try to look deeper at them if required.

* Remove unnecessary lines

Removed self.schedule_update_ha_state() from turn off / turn on

* Remove update(self)

Removed update method

* Move subscription to async_added_to_hass

* Move subscription.
* Clean up.

* Wait until the job in the executor is done

* Run gen_requirements_all script

* Only update instance attributes via callback
2018-01-15 23:08:48 +01:00
Heiko Thiery
fdcf332a8a Add support for configuring jeelink RF parameters (#11620)
* add support for configuring jeelink ŔF parameters

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix houndci-bot error

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2018-01-15 22:49:17 +01:00
Ben
bf3329e9a9 update mypy commandline arguments (#11638) 2018-01-15 22:41:49 +01:00
Sean Dague
6b26154077 Add basic mychevy component (#11409)
* mychevy: added basic mychevy component

This implements a component using the mychevy library (which utilizes
selenium to webscrape the mychevy website for onstar for your
car). The architecture works by having a background thread doing
periodic polling of the website, and updating the sensors when new
data is found.

This requires rather more setup than most platforms, as you need
working selenium. Instructions will be provided on the component
list. All the sensors are spawned and coordinated from a single "hub"
as they are really just attributes of the same web scraping session.

* mychevy: only poll every 30 minutes

* mychevy: update sensors

* mychevy: better error handling

* mychevy: tweaking for refactor

* mychevy: bump version to handle odometer > 1000

* mychevy: great sensor reorg

* mychevy: add binary sensors

* mychevy: bump mychevy requirement

* mychevy: use dispatcher

Instead of directly modifying the sensors, this lets us use a
dispatcher to have sensors pull information from the car object when
there is a relevant update for them.

* mychevy: remove from coverage

* mychevy: dedicated constants for dispatch signals

This makes the dispatch signals dedicated topics, and fixes updating
the state on the sensors so that they are correctly updated.

* mychevy: updated with comments from martinhjelmare

* mychevy: set battery icon based with helper function

* Address additional review feedback

* Address additional review comments
2018-01-15 21:50:56 +01:00
covrig
5546ecd637 Round values to one decimal (#11673)
Temperature detection range: -20 - 60 Deg.C ( + / - 0.3 Deg.C )
Humidity detection range: 0 - 100pct RH ( + / - 0.3pct )
Atmospheric pressure detection range: 30 - 110KPa ( + / - 120Pa )
2018-01-15 20:40:12 +01:00
heydonms
079d4039a1 Add ability to specify a sender in the clicksend notification (#11046)
* Add ability to specify a sender in the clicksend notification

* Style fixes

* Fix remaining issue

* Add sender validation
2018-01-15 18:38:58 +01:00
Fabian Affolter
fc442361cd Bump release to 0.61.0 2018-01-15 13:27:54 +01:00
Fabian Affolter
1ed0c7d85d Bump dev to 0.62.0.dev0 (#11652) 2018-01-15 11:42:31 +01:00
Kane610
3979387c80 Add Deconz support for Zigbee green power devices like Hue Tap (#11455)
* Add support for Zigbee green power devices such as the Hue Tap

* Clarify that imported SWITCH is a DECONZ_REMOTE
2018-01-15 10:47:55 +01:00
Fabian Affolter
f86b645417 Merge branch 'master' into dev 2018-01-15 10:42:20 +01:00
Fabian Affolter
c3ff5de016 Merge pull request #11589 from home-assistant/release-0-61
0.61
2018-01-15 10:35:00 +01:00
Alok Saboo
9b15cfa5a5 Update Pyarlo to 0.1.2 (#11626) 2018-01-15 09:38:08 +01:00
Jesse Hills
7837b4893f Use kelvin/mireds correctly for setting iglo white (#11622)
* Use kelvin/mireds correctly for setting iglo white

* Update requirements_all.txt

* Fix line lengths
2018-01-15 09:38:07 +01:00
Thijs de Jong
d88edb0661 patch stop command (#11612) 2018-01-15 09:38:07 +01:00
Fabian Affolter
7a50450b92 Upgrade yarl to 0.18.0 (#11609) 2018-01-15 09:38:06 +01:00
Daniel Høyer Iversen
3afa4726bf Xiaomi lib upgrade (#11603)
* upgrade xiaomi lib

* xiaomi lib
2018-01-15 09:38:06 +01:00
Daniel Høyer Iversen
218e97d965 Bugfix and cleanup for Rfxtrx (#11600)
* rfxtrx clean up

* rfxtrx clean up

* rfxtrx clean up
2018-01-15 09:38:05 +01:00
Bob Anderson
8d19192c9c Concord232 alarm arm away fix (#11597)
* fix arming away cmd for concord232 client

* bump required version of concord232 to 0.15
2018-01-15 09:38:05 +01:00
tschmidty69
179d99381d Snips add say and say_actions services (new) (#11596)
* Added snips.say and snips.say_action services

* Added snips.say and snips.say_action services

* Merged services.yaml changes I missed

* added tests for new service configs

* Woof

* Woof Woof

* Changed attribute names to follow hass standards.

* updated test_snips with new attribute names
2018-01-15 09:38:04 +01:00
Adam Mills
b8dfa4c3d2 Fix state for trigger with forced updates (#11595) 2018-01-15 09:38:03 +01:00
tschmidty69
92bec562ab Pushbullet email support (fix) (#11590)
* Simplified push calls

* Cleaned up and added unittests

* Fixed email parameter

* Fixed email parameter
2018-01-15 09:38:03 +01:00
Thijs de Jong
1802c0a922 Fix Tahoma stop command for 2 types of shutters (#11588)
* add working stop command

This fixes the stop command for 2 types of roller shutters

* fix line too long

* fix indentation

* fix indentation
2018-01-15 09:38:02 +01:00
Pascal Vizeli
f2cc00cc64 Core support for hass.io calls & Bugfix check_config (#11571)
* Initial overwrites

* Add check_config function.

* Update hassio.py

* Address comments

* add hassio support

* add more tests

* revert core changes

* Address check_config

* Address comment with api_bool

* Bugfix check_config

* Update core.py

* Update test_core.py

* Update config.py

* Update hassio.py

* Update config.py

* Update test_config.py
2018-01-15 09:38:02 +01:00
Jack Fan
033e06868e Avoid returning empty media_image_url string (#11557)
This relates to issue
https://github.com/home-assistant/home-assistant/issues/11556
2018-01-15 09:37:57 +01:00
Fabian Affolter
688d706449 Upgrade coinmarketcap to 4.1.2 (#11634) 2018-01-14 22:31:47 +01:00
Pascal Vizeli
028597f774 Update CODEOWNERS 2018-01-14 15:03:39 +01:00
Lukas Barth
0550baaf4f Add templates to MQTT climate (#11623)
* Add templates

* Make pylint happy
2018-01-14 12:55:19 +01:00
Daniel Høyer Iversen
c33b171043 upgrade xiaomi lib (#11629) 2018-01-13 21:34:56 +01:00
Giuseppe
9d67d229fa Fixes and enhancements for the Tahoma platform (#11547)
* Strip off the RTS/IO ID from the entity ID

* Ignore exception thrown when the device does not provide an active state

* Send actions with a label for easier identification in the Tahoma log

* Linting

* Strip off the RTS/IO ID from the entity ID, take 2

As per suggestions, let HA do the standard initialization and assign
an appropriate entity_id, instead of overriding it with the lengthy
unique_id coming from the TaHoma devices.
2018-01-13 21:24:10 +01:00
starkillerOG
cdbf2f9293 Hyperion: Add brightness, HDMI and effect support (#11543)
* Hyperion: Add brightness, HDMI and effect support

- added brightness support to dim the hyperion light
- changed the "OFF" command to set the color to [0,0,0] after clearing all priorities.
  This is neccesary to keep the light turned off when an HDMI grabber is used for ambilight with hyperion.
- added HDMI ambilight mode recognition and control.
  by setting the "hdmi_priority" in your "configuration.yaml" file (defaults to 880), home assistant will now be able to recognize when the hyperion light is in HDMI ambilight mode and will change its icon to an HDMI symbol and set the status to ON.
Switching the hyperion light to HDMI ambilight mode can be done through the effect option (clears all priorities such that the HDMI grabber remains).
- added effect support for the default effects of hyperion, a custom list can be defined in the "configuration.yaml" file by using the "effect_list" option.

* Hyperion: Add brightness, HDMI and effect support

- added brightness support to dim the hyperion light
- changed the "OFF" command to set the color to [0,0,0] after clearing all priorities.
  This is neccesary to keep the light turned off when an HDMI grabber is used for ambilight with hyperion.
- added HDMI ambilight mode recognition and control.
  by setting the "hdmi_priority" in your "configuration.yaml" file (defaults to 880), home assistant will now be able to recognize when the hyperion light is in HDMI ambilight mode and will change its icon to an HDMI symbol and set the status to ON.
Switching the hyperion light to HDMI ambilight mode can be done through the effect option (clears all priorities such that the HDMI grabber remains).
- added effect support for the default effects of hyperion, a custom list can be defined in the "configuration.yaml" file by using the "effect_list" option.
- fixed some style issues with too long lines

* Hyperion: Add brightness, HDMI and effect support 

 - fixed some more indentation style issues

* Hyperion: Add brightness, HDMI and effect support 

- yet more fixed visuel indent issues

* Hyperion: Add brightness, HDMI and effect support 

- more visuel indents

* Hyperion: Add brightness, HDMI and effect support

- fixed invalid variable "A"

* Hyperion: Add brightness, HDMI and effect support

- remove unnececary brackets
- specify specific exceptions

* correct changing state holding attributes during a service method

Proccesed the comments of @MartinHjelmare: https://github.com/home-assistant/home-assistant/pull/11543#pullrequestreview-88328659

* indent correction

corrected tab instead of 4 spaces

* Hyperion: Add brightness, HDMI and effect support 

- changed 'none' to None
- renamed "self._skip_check" to "self._skip_update"

* Add brightness, HDMI and effect support 

changed checking if a list is empty from "list == []" to "not list"
2018-01-13 21:06:34 +01:00
Jesse Hills
5def6ebc3b Use kelvin/mireds correctly for setting iglo white (#11622)
* Use kelvin/mireds correctly for setting iglo white

* Update requirements_all.txt

* Fix line lengths
2018-01-13 20:07:39 +01:00
Alok Saboo
ea62deda59 Update Pyarlo to 0.1.2 (#11626) 2018-01-13 20:00:04 +01:00
Nicko van Someren
3e43f4e58e Adding support for Lutron covers (#11602)
* Adding support for Lutron Radio RA2 shades as cover components.

* Adding initial version of the Lutron shades component.

* Fixed line-length violation detected by Hound.
2018-01-13 19:11:20 +01:00
Jason Kölker
2e08766cb1 light/mqqt_json: allow brightness scaling (#11613) 2018-01-13 18:58:21 +01:00
Kees Schollaart
e476b9d225 Update Xiaomi Miio compontent broken URI (#11621) 2018-01-13 12:16:09 +01:00
Pascal Vizeli
b2b836d4c1 small sonos cleanup (#11607) 2018-01-13 09:59:50 +01:00
Thijs de Jong
5e81736f88 patch stop command (#11612) 2018-01-13 09:06:37 +01:00
Fabian Affolter
37427d052e Upgrad youtube_dl to 2017.12.31 (#11610) 2018-01-13 09:02:51 +01:00
Fabian Affolter
5656b0eb2c Upgrade keyring to 10.6.0 (#11608) 2018-01-13 09:02:25 +01:00
Fabian Affolter
b854cdb95b Upgrade yarl to 0.18.0 (#11609) 2018-01-13 09:01:05 +01:00
Daniel Høyer Iversen
be31a860d1 Xiaomi lib upgrade (#11603)
* upgrade xiaomi lib

* xiaomi lib
2018-01-12 13:35:32 -08:00
Daniel Høyer Iversen
0409192e64 Bugfix and cleanup for Rfxtrx (#11600)
* rfxtrx clean up

* rfxtrx clean up

* rfxtrx clean up
2018-01-12 11:52:53 -08:00
tschmidty69
c036141b37 Pushbullet email support (fix) (#11590)
* Simplified push calls

* Cleaned up and added unittests

* Fixed email parameter

* Fixed email parameter
2018-01-12 11:06:42 -08:00
tschmidty69
b8e4c2ff69 Snips add say and say_actions services (new) (#11596)
* Added snips.say and snips.say_action services

* Added snips.say and snips.say_action services

* Merged services.yaml changes I missed

* added tests for new service configs

* Woof

* Woof Woof

* Changed attribute names to follow hass standards.

* updated test_snips with new attribute names
2018-01-12 10:19:43 -08:00
Thijs de Jong
cc236529c4 Fix Tahoma stop command for 2 types of shutters (#11588)
* add working stop command

This fixes the stop command for 2 types of roller shutters

* fix line too long

* fix indentation

* fix indentation
2018-01-12 16:04:44 +01:00
Pascal Vizeli
dacd7cd8a4 Core support for hass.io calls & Bugfix check_config (#11571)
* Initial overwrites

* Add check_config function.

* Update hassio.py

* Address comments

* add hassio support

* add more tests

* revert core changes

* Address check_config

* Address comment with api_bool

* Bugfix check_config

* Update core.py

* Update test_core.py

* Update config.py

* Update hassio.py

* Update config.py

* Update test_config.py
2018-01-12 15:29:58 +01:00
Bob Anderson
8a301c6c59 Concord232 alarm arm away fix (#11597)
* fix arming away cmd for concord232 client

* bump required version of concord232 to 0.15
2018-01-12 08:45:01 +01:00
Adam Mills
6918993c75 Fix state for trigger with forced updates (#11595) 2018-01-11 22:06:09 -08:00
Jack Fan
88161cd5c9 Avoid returning empty media_image_url string (#11557)
This relates to issue
https://github.com/home-assistant/home-assistant/issues/11556
2018-01-11 20:14:37 -08:00
Paulus Schoutsen
4883036789 Update frontend 2018-01-11 15:50:50 -08:00
Andreas Björshammar
965bd8a2e0 Added support for enable/disable motion detection (#11583)
* Added support for enable/disable motion detection

* Changed name of variable for exception, lint error

* Moved motion_detection_enabled property to the other properties
2018-01-11 15:44:23 -08:00
Thijs de Jong
2224d05607 add velux roller shutter to tahoma (#11586)
With #11538 I forgot to add another type of Roller shutters that should be supported.
2018-01-11 15:43:31 -08:00
cgtobi
ed66c21035 Cast return values and add unit tests for the yahoo weather component. (#10699)
* Add unittest for yahoo weather component.

* Add requitements for tests.

* Update requirements.

* Revert "Update requirements."

This reverts commit 024b5cf8bf.

* Update requirements.

* Randomize sample data.

* Remove unnecessary methods.

* Remove dependency and replace with MockDependency.

* Add temporary fix for yahoo weather API issue.
2018-01-11 15:42:51 -08:00
Paulus Schoutsen
9384e2c963 Pr/11430 (#11587)
* Fix error when name is non-latin script

When the name is non-latin script (e.g. Japanese), slugify returns empty string and causes failure in a later stage. This commit fixes the issue by using default name.

* Add test
2018-01-11 15:26:48 -08:00
Bob Anderson
6af42b4372 Control ordering of display in history component (#11340)
* Make the order shown in the history component match the ordering given in the configuration of included entities (if any)

* return the sorted result

* optimize sorting.  since entities only appear once, we can break from a search on first find, and no copy of the list is needed
2018-01-11 15:21:23 -08:00
Laqoore
1235dae5b8 Changed device type of media player and cover to switch (#11483)
* Changed device type of media player and cover to switch

Covers and media players should not be of device type 'light'. Example: If user requests all lights to switch to off, covers are closed and media players are affected too.

* Fix test
2018-01-11 15:01:38 -08:00
Andrey
a35d05ac7e Remove aux_heat support from Sensibo now that UI supports on/off (#11579) 2018-01-11 23:25:15 +01:00
kennedyshead
6b103cc9b9 Fix for asuswrt, telnet not working and presence-detection for router mode (#11422)
* Fix for telnet mode
Fix for presence detection

closes #11349 #10231

* Optimisation when device is disconnected
2018-01-11 14:12:27 -08:00
Sean Wilson
a23f60315f Fix bluetooth tracker source (#11469)
* Add new sources for bluetooth and bluetooth_le trackers (rather than just using the generic 'gps' catch-all).

* Fix lint issues
2018-01-11 14:10:47 -08:00
Adam Mills
3bc6a7da32 Support OSRAM lights on ZHA (#11522) 2018-01-11 13:56:00 -08:00
hawk259
dc5b610ee5 Alarmdecoder add validation of the zone types (#11488)
* Alarmdecoder add validation of the zone types

* fix line length
2018-01-11 13:53:14 -08:00
Daniel Perna
7723db9e62 Update pyhomematic, support new devices (#11578) 2018-01-11 20:08:09 +01:00
Ulrich Dobramysl
cf612c3d5b Make the rpi_rf component thread-safe using an RLock (#11487)
* Make the rpi_rf component thread-safe

The previous implementation suffered from race conditions when two rpi_rf switches are triggered at the same time. This implementation uses an RLock to give one thread at a time exclusive access to the rfdevice object.

* cleanup

* fix lint
2018-01-11 13:47:05 +01:00
Josh Anderson
d2b6660881 Tado improvements - hot water zone sensors and climate precision (#11521)
* Add tado hot water zone sensors

* Set precision to match tado app/website
2018-01-11 10:49:41 +01:00
Dan Nixon
3972d1d4c6 Mark REST binary_sensor unavailable if request fails (#11506)
* Mark REST binary_sensor unavailable if request fails

* Add test suite for RESTful binary sensor
2018-01-11 10:48:15 +01:00
Anders Melchiorsen
5fda78cf91 Fix new squeezebox service descriptions for lazy loading (#11574) 2018-01-11 10:15:59 +01:00
randellhodges
60ce2b343d Tracking all groups to allow changing of existing groups (#11444)
* Tracking all groups to allow changing of existing groups

* Unit tests

* Fix flake8 warnings in test
2018-01-10 14:13:22 -08:00
Andrey
6cc285aea5 Add sensibo_assume_state service to Sensibo climate (#11567) 2018-01-10 14:04:35 -08:00
Pascal Vizeli
c5d5d57e9b Extend hass.io services / updater (#11549)
* Extend hass.io services

* Add warning for carfuly options with hass.io

* update tests

* finish tests

* remove update calls

* address comments

* address comments p2

* fix tests

* fix tests

* Use token also for proxy

* Add test for server_host

* Fix test

* Fix tests

* Add test for version

* Address comments
2018-01-10 19:48:31 +01:00
Thijs de Jong
02979db3d6 Add Velux Windows to Tahoma (#11538)
* Add Velux Windows to Tahoma

* fix linit

* add supported Tahoma devices by @glpatcern

* hound

* lint

* fix logging

* lint

* lint

* remove blank line after docstring

* changes based on notes by @armills

* fix logging
2018-01-10 09:41:16 -05:00
Paulus Schoutsen
0d06e8c1c9 Test tweaks (#11560)
* Fix is_allowed_path on OS X

* Move APNS2 inside func in test
2018-01-10 10:48:17 +01:00
Paulus Schoutsen
d793cfeb68 Update frontend to 20180110.0 2018-01-10 00:52:35 -08:00
Paulus Schoutsen
382a62346b Update frontend to 20180110.0 2018-01-10 00:52:12 -08:00
Anders Melchiorsen
9e0ca719ed Deprecate explicit entity_id in template platforms (#11123)
* Deprecate explicit entity_id in template platforms

* Use config validator for deprecation

* Fix copy/paste typos

* Also print the config value

* Add test for config validator

* Assert the module name that logged the message
2018-01-10 00:06:26 -08:00
Paulus Schoutsen
88b70e964c Remove execution file perm (#11563) 2018-01-09 23:55:14 -08:00
Andrea Campi
4dda842b16 Try to fix crashes after Hue refactoring (#11270)
* Try to fix crashes after Hue refactoring

Refs #11183

* Fix usage of dispatcher_send via helper.

* Address review feedback.
2018-01-10 08:05:04 +01:00
Nolan Gilley
3cba09c6f6 Coinbase.com sensor platform (#11036)
* coinbase sensors

use hass.data, load_platform

* add exchange rate sensors

dont pass complex object over event bus

* check for auth error
2018-01-10 07:47:22 +01:00
Fabian Affolter
c4bc42d527 Upgrade keyring to 10.3.2 (#11531) 2018-01-09 19:51:35 -08:00
Phil Kates
cf04a81f70 Fix error on entity_config missing (#11561)
If the `google_assistant` key exists in the config but has no
`entity_config` key under it you'll get an error.

```
  File "/Users/pkates/src/home-assistant/homeassistant/components/google_assistant/http.py", line 51, in is_exposed
    entity_config.get(entity.entity_id, {}).get(CONF_EXPOSE)
AttributeError: 'NoneType' object has no attribute 'get'
```
2018-01-09 19:47:24 -08:00
Eric Pignet
92014bf1d1 Add 2 media_player services and 1 custom service to Squeezebox platform (#10969)
* Add 2 media_player services and 1 custom service to Squeezebox platform

* Fix pylint error

* Remove apostrophe in example

* Split method into command and parameters

* Fix Lint error
2018-01-09 22:05:21 -05:00
cdce8p
cba55402b1 Improved test runtime (#11553)
* Remove redundent assert statements and cleanup

* Added 'get_date' function

* Replace 'freeze_time' with 'mock.patch'
* Tox in 185s (py35)

* Removed obsolete 'freeze_time' from test_updater
* Tox 162s (py35)

* Remove test requirement 'freezegun'

* Fixed flake8 errors

* Added 'mock.patch' for 'feedparser.parse'

* Made 'FUNCTION_PATH' a constant

* Remove debug statements.
2018-01-09 16:00:49 -08:00
Fabian Affolter
f56b3d8e9c Upgrade lightify to 1.0.6.1 (#11545) 2018-01-09 15:35:34 -08:00
Paulus Schoutsen
8313225b40 Move Google Assistant entity config out of customize (#11499)
* Move Google Assistant entity config out of customize

* CONF_ALIAS -> CONF_ALIASES

* Lint
2018-01-09 15:14:56 -08:00
Sean Wilson
13042d5557 ZoneMinder event sensor updates (#11369)
* Switch the ZoneMinder event sensor over to use the consoleEvents API, and add monitored_conditions for 'hour', 'day', 'week', 'month' and 'all'. 'all' is enabled by default to provide backward compatibility with the old behaviour.

* - Switch to new string formatting
- Remove redundant validator

* De-lint
2018-01-09 21:58:26 +01:00
Fabian Affolter
85858885c8 Upgrade Sphinx to 1.6.6 (#11534) 2018-01-09 15:30:54 +01:00
Fabian Affolter
10f48fbf6b Upgrade python-etherscan-api to 0.0.2 (#11535) 2018-01-09 15:30:36 +01:00
Fabian Affolter
8b267e3faf Upgrade numpy to 1.14.0 (#11542) 2018-01-09 15:30:00 +01:00
tschmidty69
13effee679 Snips: (fix) support new intentName format (#11509)
* support new intentName format

* Added tests for new and old format names

* pylint warning fixes
2018-01-08 13:00:21 -08:00
Cameron Llewellyn
903cda08b1 Insteon local update (#11088)
* trying to rework device discovery. now the main component will do the getlinked and pass it to the sub-components. no longer any config needed other than what is needed to connect to the hub. device names are no longer stored. core team told us to stop using configurator to ask for names. there should be a way to set names in hass...possibly this https://home-assistant.io/docs/configuration/customizing-devices/

* fix device types

* make device names just be the isnteon device id

* revert some config changes

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* update insteon client

* linting fixes

* Error Clean up

* Update to make requested changes

* more changes

* Finish requested changes to components

* Fixing Rebase Conflicts

* fix device types

* make device names just be the isnteon device id

* revert some config changes

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* Update insteon_local.py

* update insteon client

* linting fixes

* Error Clean up

* Update to make requested changes

* more changes

* Finish requested changes to components

* Update Insteon_Local for performance improvements

* Fix errors from get_linked

* Fix typo

* Requested changes

* Fix spacing

* Clean up

* Requested Changes
2018-01-08 18:18:10 +01:00
Yien Xu
e0e2f739ba Add options feature to Baidu TTS. (#11462)
* Add options feature to Baidu TTS.

Add options feature: supported_options() and default_options() added, get_tts_audio updated to accommodate options.

* Add options feature to Baidu TTS.

Add options feature: supported_options() and default_options() added, get_tts_audio updated to accommodate options.

* Fix style

* Fix style

Change the order of content of lists and dictionaries.

* Fix style

Changed order of imports, and fixed grammar errors.
2018-01-08 17:22:50 +01:00
Michael Kutý
0e710099e0 Support pushing all sensors and fix wrong metrics. (#11159)
For example all metrics with unit % match humidity.
This generate correct metrics like this
# HELP nut_ups_battery_charge sensor.nut_ups_battery_charge
# TYPE nut_ups_battery_charge gauge
nut_ups_battery_charge{entity="sensor.nut_ups_battery_charge",friendly_name="NUT UPS Battery Charge"} 98.0
nut_ups_battery_charge{entity="sensor.nut_ups_battery_charge_2",friendly_name="NUT UPS Battery Charge"} 97.0
2018-01-08 17:11:45 +01:00
timstanley1985
b1b0a2589e MQTT json attributes (#11439)
* MQTT json attributes

* Fix lint

* Amends following comments

* Fix lint

* Fix lint

* Add test

* Fix typo

* Amends following comments

* New tests

* Fix lint

* Fix tests
2018-01-08 17:07:39 +01:00
ChristianKuehnel
dff36b8087 Extension sensor alpha_vantage (#11427)
* Extended sensor alpha_vantage

* Improved error handling if symbol is not found. Now we add the symbols that were found,
* Added option to give names and currencies to symbols.
* Added support to read foreign exchange information.
* Icons are selected based on the currency (where MDI has a matching icon)

* added missing line at the end of the file...

* renamed variable as required by pylint

* Fix typos, ordering, and style
2018-01-08 16:58:34 +01:00
florianj1
46ad194097 Fix Kodi channels media type (#11505)
* Update kodi.py

* Update kodi.py

Fix code style
2018-01-08 16:57:50 +01:00
Alex Osadchyy
2ba9d825a0 Reconnect before mochad switch send command (#11296)
* Connection to mochad occasionally stalls on RPi and CM19A. Reconnect one switch send command.

* Formatting and exception hanling fixes

* Moved import inside the method. Logging outside the try-catch.

* Tailing whitespaces.

* MockDependency on pymochad in unit tests to resolve exceptions

* patch pymochad MochadException in unit tests to resolve exceptions

* patch pymochad MochadException in unit tests to resolve exceptions

* cleaned unused import

* lint issue fixed

* pylint issue fixed
2018-01-08 08:32:24 +01:00
Chris Cowart
8c0035c5b3 New features for Owntracks device_tracker (#11480)
* New features for Owntracks device_tracker

- Supporting a mapping of region names in OT to zones in HA, allowing
  separate namespaces in both applications. This is especially helpful
  if using one OT instance to update geofences for multiple homes.
- Creating a setting to ignore all location updates, allowing users to
  rely completely on enter and leave events. I have personally always
  used OT integrations with home automation this way and find it the
  most reliable.
- Allowing the OT topic to be overridden in configuration

* Fixing configuration of MQTT topic, related tests

* Tests for Owntracks events_only feature

* Tests for customizing mqtt topic, region mapping

* Fixing _parse and http for owntracks custom topic

* Making tests more thorough and cleaning up lint
2018-01-08 08:16:45 +01:00
Dan Nixon
c53fc94e84 Address missed review comments for Dark Sky weather (#11520)
See #11435
2018-01-07 19:54:27 -08:00
Paulus Schoutsen
bccd880395 Fix canary flaky test (#11519) 2018-01-07 15:05:19 -08:00
Anders Melchiorsen
8267a21bfe Lazy loading of service descriptions (#11479)
* Lazy loading of service descriptions

* Fix tests

* Load YAML in executor

* Return a copy of available services to allow mutations

* Remove lint

* Add zha/services.yaml

* Only cache descriptions for known services

* Remove lint

* Remove description loading during service registration

* Remove description parameter from async_register

* Test async_get_all_descriptions

* Remove lint

* Fix typos from multi-edit

* Remove unused arguments

* Remove unused import os

* Remove unused import os, part 2

* Remove unneeded coroutine decorator

* Only use executor for loading files

* Cleanups suggested in review

* Increase test coverage

* Fix races in existing tests
2018-01-07 14:54:16 -08:00
Dan Nixon
3cbd77f6ac Add Dark Sky weather component (#11435) 2018-01-07 13:59:32 -08:00
tschmidty69
4a6b5ba02b Snips (new) added speech response, parse snips/duration (#11513)
* Snips changed to using <username>:intentName instead of user_IDSTRING__intentName

* added response to snips

* blank line

* added unittests

* houndy

* sdtuff

* more stuff

* Update test_snips.py

* Update snips.py

* Split log tests to avoid dict ordering in py34

* Update test_snips.py

* Update test_snips.py

* still broken

* fixed tests

* fixed tests

* removed fix submitted in another PR
2018-01-07 13:42:08 -08:00
Julius Mittenzwei
efb83dde19 More tolerant KNX component if gateway cant be connected (#11511)
* Issue #11432: Do not stop initializing KNX when tunelling device cant be reached

*  Issue #11432: Mark devices as unavailable if gateway cant be connected
2018-01-07 13:39:14 -08:00
Julio Guerra
c20324793e timer: include the remaining time in the state attributes (#11510)
Add the amount of remaining time before a timer is finished in its state attributes, so that it is received when fetching a timer state.

In my particular case, it allows me to correctly implement a UI for a timer when it is paused and when the UI didn't received the pause state change (which happens when the UI is started after the pause). In this case, it is impossible to show the remaining amount of time before the timer ends.
2018-01-07 13:37:19 -08:00
Julian Kahnert
4496ee5af0 upgrade schiene to 0.20 (#11504) 2018-01-07 14:57:26 +01:00
Christopher Viel
e42c4859c2 Upgrade pywebpush to 1.5.0 (#11497)
This version includes a fix for the serialization errors that occurred
when updating push subscriptions.

Changes since version 1.3.0:
https://github.com/web-push-libs/pywebpush/compare/1.3.0...28d2b55f
2018-01-06 21:08:11 -08:00
Tom Waters
939d1b5ff6 Fix time functions would throw errors in python scripts (#11414)
* Fix time functions would throw errors in python scripts

* Added unit test for time.strptime, change variable name to satisfy lint

* Added docstring for time attribute wrapper method to satisfy lint

* Fixed line too long lint problem
2018-01-07 01:50:55 +01:00
Paulus Schoutsen
5c2cecde70 Clean up Alexa.intent and DialogFlow.intent (#11492)
* Clean up Alexa.intent

* Restructure dialogflow too

* Lint

* Lint
2018-01-07 01:39:32 +01:00
Fabian Affolter
c613585100 Add missing configuration variables (#11390)
* Add missing configuration variables

* Minor changes

* Sync platforms and other minor updates
2018-01-06 21:53:14 +01:00
Jesse Hills
3fbf09e7d9 Add new iGlo component (#11171)
* Add new iGlo component

* Missing comma
Add extra blank lines

* Dont change state in turn_on
Remove unused variables
Update before add

* Fixing some lint issues
2018-01-06 21:52:31 +01:00
Fabian Affolter
b22a26891e Upgrade pysnmp to 4.4.4 (#11485) 2018-01-06 19:54:15 +01:00
abondoe
a0df165011 Add Touchline climate platform (#10547)
* Add toucline platform

* Fix bugs suggested by houndci-bot

* Fix bugs suggested by houndci-bot

* Fix style based on comments and lint

* Remove target temperature

* Fix unexpected EOF

* Fix unexpected EOF

* Fix wrongfully named numberOfDevices variable

* Add target temperature

* Update requirements_all.txt

* Change after review

* Add supported features
* Remove update in constructor
* Set member variables to none in constructor

* Minor changes
2018-01-06 11:23:24 +01:00
Fabian Affolter
f6307a1523 Upgrade yarl to 0.17.0 (#11478) 2018-01-06 09:42:09 +01:00
Paulus Schoutsen
ff9688bb7a Fix vultr tests (#11477) 2018-01-05 16:34:03 -08:00
Fabian Affolter
c714658384 Upgrade alpha_vantage to 1.8.0 (#11476) 2018-01-05 16:05:51 -08:00
Fabian Affolter
f21914d1f3 Upgrade psutil to 5.4.3 (#11468) 2018-01-05 14:30:12 -08:00
hawk259
417c193c0d AlarmDecoder remove icon function as BinarySensorDevice handles it correctly now (#11467)
* remove icon function as BinarySensorDevice handles it correctly now

* removing _type, not used
2018-01-05 14:29:57 -08:00
Christopher Viel
455c629f47 Don't duplicate html5 registrations (#11451)
* Don't duplicate html5 registrations

If a registration is posted and another registration with the same
endpoint URL exists, update that one instead. That way, we preserve
the device name that has been configured. The previous behavior used to
append 'unnamed device' registrations over and over, leading to
multiple copies of the same registration. The endpoint URL is unique per
service worker so it is safe to update matching registrations.

* Refactor html5 registration view to not write json in the event loop
2018-01-05 14:29:27 -08:00
Paulus Schoutsen
01896786fb Merge branch 'master' into dev 2018-01-05 13:10:29 -08:00
Paulus Schoutsen
c526fcd40f Merge pull request #11470 from home-assistant/release-0-60-1
0.60.1
2018-01-05 12:55:13 -08:00
Paulus Schoutsen
8b57777ce9 Alexa to not use customize for entity config (#11461)
* Alexa to not use customize for entity config

* Test Alexa entity config

* Improve tests

* Fix test
2018-01-05 12:33:22 -08:00
Matt N
b61197196e iOS 10 should be served javascript_version:es5 (#11387)
* iOS 10 should be served javascript_version:es5

Fixes #11234

* Update min Safari version to 12
2018-01-05 11:29:20 -08:00
Pascal Vizeli
e0a1b87296 Don't block on sevice call for alexa (#11358)
* Don't block on sevice call for alexa

* fix tests
2018-01-05 11:29:19 -08:00
Greg Laabs
d3ed6d5242 Fix leak sensors always showing Unknown until Wet (#11313)
Leak sensors were using the "wet" node as a negative node, which prevented them from ever gettng a Dry status unless the user pressed the button on the hardware after every Hass reboot.

This change ignores the Wet node, as it is just always the exact inverse of the Dry node. We don't need to watch both.
2018-01-05 11:29:19 -08:00
Bob Anderson
5d6455415e Fix unpredictable entity names in concord232 binary_sensor (#11292) 2018-01-05 11:29:18 -08:00
maxlaverse
a27b37be59 Fix allday events in custom_calendars (#11272) 2018-01-05 11:29:18 -08:00
Zio Tibia
f6a67d99e4 Fix handling zero values for state_on/state_off (#11264) 2018-01-05 11:29:17 -08:00
CTLS
486263fff7 Fix inverted sensors on the concord232 binary sensor component (#11261)
* Fix inverted sensors on the concord232 binary sensor component

* Changed from == Tripped to != Normal
2018-01-05 11:29:17 -08:00
Andrea Campi
5a469f4d4b Support multiple Hue bridges with lights of the same id (#11259)
* Improve support for multiple Hue bridges with lights that have the same id.

The old code pre-refactoring kept a per-bridge list of lights in a closure; my refactoring moved that to hass.data, which is convenient but caused them to conflict with each other.

Fixes #11183

* Update test_hue.py
2018-01-05 11:29:16 -08:00
Pascal Vizeli
889eef78e4 Bugfix homematic available modus (#11256) 2018-01-05 11:29:16 -08:00
Greg Laabs
794cfb7976 Fix detection of if a negative node is in use (#11255)
* Fix detection of if a negative node is in use

Fix a problem where every negative node gets detected as in-use. Code was not checking the correct property.

* Allow protected access
2018-01-05 11:29:15 -08:00
Daniel Watkins
9055922153 Fix webostv select source (#11227)
* Fix reuse of variable name

This should fix #11224.

* Add tests for LgWebOSDevice.select_source
2018-01-05 11:29:15 -08:00
Janne Grunau
2330268842 homematic: add username and password to interface config schema (#11214)
Fixes #11191, the json-rpc name resolving method requires user account
and password.
2018-01-05 11:29:15 -08:00
maxlaverse
e81d17dae0 Fix webdav calendar schema (#11185) 2018-01-05 11:29:14 -08:00
Ben Randall
5820bab9b1 Fix async IO in Sesame lock component. (#11054)
* Call update on Sesame devices to cache initial state

* Switch to using async_add_devices

* Fix line length

* Fix Lint errors

* Fix more Lint errors

* Cache pysesame properties

* Updates from CR feedback
2018-01-05 11:29:14 -08:00
Paulus Schoutsen
3a00c3de64 Version bump to 0.60.1 2018-01-05 11:28:39 -08:00
Matt N
71fb7a6ef6 iOS 10 should be served javascript_version:es5 (#11387)
* iOS 10 should be served javascript_version:es5

Fixes #11234

* Update min Safari version to 12
2018-01-05 11:28:03 -08:00
Daniel Høyer Iversen
65d841c3a6 Update PULL_REQUEST_TEMPLATE.md (#11465)
* Update PULL_REQUEST_TEMPLATE.md

* Add period
2018-01-05 18:31:41 +01:00
William Scanlon
5236b720ab Catch everything when calling to OctoPrint API to fix #10557 (#11457) 2018-01-05 18:07:09 +01:00
Thibault Cohen
ebbdce1f42 Update hydroquebec component to use hass httpsession (#11412)
* Update hydroquebec component to use hass httpsession

* Remove blank line
2018-01-05 10:22:40 +01:00
cdce8p
1490ccf7fb Updated gitignore file (#11452) 2018-01-05 00:03:32 -08:00
cdce8p
642e9c53ba Input Boolean - Deleted 'DEFAULT_INITIAL' (#11453) 2018-01-05 00:03:00 -08:00
cdce8p
1e9e6927eb Input Select - Added service description (#11456) 2018-01-05 00:02:10 -08:00
Paulus Schoutsen
b7c7041873 Add some tests to the cloud component (#11460) 2018-01-04 21:40:18 -08:00
Thijs de Jong
35f35050ff Set tahoma cover scan interval to 60 seconds (#11447)
* Increase tahoma scan interval to 60

* import timedelta

* fix lint
2018-01-05 01:02:31 +01:00
PhracturedBlue
6cb02128b4 Reconnect to alarmdecoder on disconnect (#11383)
* Reconnect to alarmdecoder on disconnect

* Use track_point_in_time instead of call_later

* use alarmdecoder 1.13.2 which has a more robust reconnection fix
2018-01-04 20:10:56 +01:00
Marius
3436676de2 Updated generic thermostat to respect operation_mode and added away mode (#11445)
* Updated generic thermostat to respect operation_mode and added away mode

* Updated tests to include away mode and corrected init problem for sensor state
Added more tests to improve coverage and corrected again lint errors
Fixed new test by moving to correct package
Fixed bug not restoring away mode on restart

* Added support for idle on interface through state

* Added back initial_operation_mode and modified away_temp to be only one for now

* Fixed houndci-bot errors

* Added back check for None on restore temperature

* Fixed failing tests as well

* Removed unused definitions from tests

* Added use case for no initial temperature and no previously saved temperature
2018-01-04 19:05:11 +01:00
Frantz
04de22613c Added new climate component from Daikin (#10983)
* Added Daikin climate component

* Fixed tox & hound

* Place up the REQUIREMENTS var

* Update .coveragerc

* Removed unused customization

* Prevent setting invalid operation state

* Fixed hound

* Small refactor according to code review

* Fixed latest code review comments

* Used host instead of ip_address

* No real change

* No real change

* Fixed lint errors

* More pylint fixes

* Shush Hound

* Applied suggested changes for temperature & humidity settings

* Fixed hound

* Fixed upper case texts

* Fixed hound

* Fixed hound

* Fixed hound

* Removed humidity since even the device has the feature it cant be set from API

* Code review requested changes

* Fixed hound

* Fixed hound

* Trigger update after adding device

* Added Daikin sensors

* Fixed hound

* Fixed hound

* Fixed travis

* Fixed hound

* Fixed hound

* Fixed travis

* Fixed coverage decrease issue

* Do less API calls and fixed Travis failures

* Distributed code from platform to climate and sensor componenets

* Rename sensor state to device_attribute

* Fixed hound

* Updated requirements

* Simplified code

* Implemented requested changes

* Forgot one change

* Don't allow customizing temperature unit and take it from hass (FOR NOW)

* Additional code review changes applied

* Condensed import even more

* Simplify condition check

* Reordered imports

* Disabled autodiscovery FOR NOW :(

* Give more suggestive names to sensors
2018-01-04 11:05:27 +01:00
Paulus Schoutsen
2cf5acdfd2 Google Assistant -> Google Actions (#11442) 2018-01-03 17:26:58 -08:00
Andrey
4512a972d1 Climate: fix missing "|" (#11441)
* Add on/off supported feature to climate

* Lint

* Fix missing |

* lint
2018-01-04 02:26:11 +02:00
cdce8p
65df6f0013 Fix CONF_FRIENDLY_NAME (#11438) 2018-01-03 23:52:36 +01:00
Andrey
eb00e54eba Add on/off supported feature to climate (#11379)
* Add on/off supported feature to climate

* Lint
2018-01-03 23:10:54 +01:00
Steve Easley
ec700c2cd6 Fix errors in zigbee push state (#11386)
* Fix errors in zigbee push state

* Fix formatting

* Added comment
2018-01-03 12:48:36 -08:00
Daniel Claes
75a39352ff fix: hmip-etrv-2 now working with homeassistant (#11175)
* fix: hmip-etrv-2 now working with homeassistant (see also pull request at pyhomematic)

* fix linting issue and typo

* address comment @pvizeli

* Only use cached data in current operation mode

* fix linting issue
2018-01-03 19:36:25 +01:00
Ryan McLean
36c7fbe06a Plex api update (#11423)
* Updated plexapi to 3.0.5

* Removed removed server obj that was being used for the media URL generation as .url() is available in self._session
seasons() no longer exists -> renamed to season()
season() returns obj not list so corrected
season.index returns int, cast to str to zerofill

* Fixed Linting
2018-01-03 19:28:43 +01:00
Dave Finlay
bb2191b2b0 Add support for the renaming of Yamaha Receiver Zones via configuration file. Added a test to cover the change, plus previously untested options. (#11402) 2018-01-03 19:25:16 +01:00
Paulus Schoutsen
f314b6cb6c Cloud Updates (#11404)
* Verify stored keys on startup

* Handle Google Assistant messages

* Fix tests

* Don't verify expiration when getting claims

* Remove email based check

* Lint

* Lint

* Lint
2018-01-03 19:16:59 +01:00
Trevor Joynson
86e1d0f952 Account for User-Agent being non-existent, causing a TypeError (#11064)
* Account for User-Agent being non-existent, causing a TypeError

* Actually fix case of no user-agent with last resort

* Return es5 as last resort

* Update __init__.py

* Update __init__.py
2018-01-02 16:42:41 -08:00
Anders Melchiorsen
02c3ea1917 Silence redundant warnings about slow setup (#11352)
* Downgrade slow domain setup warning

* Revert "Downgrade slow domain setup warning"

This reverts commit 64472c006b.

* Remove warning for entity components

* Remove lint

* Fix original test with extra call
2018-01-02 12:16:32 -08:00
tomaszduda23
0a67195529 Fixing OpenWeatherMap Sensor. Current weather is 'unknown' if forecast: false. It was reported as #8640. (#11417) 2018-01-02 20:54:06 +01:00
Anders Melchiorsen
feb70b47df Performance optimization of TP-Link switch (#11416) 2018-01-02 19:31:33 +01:00
Lukas Barth
909f613324 Do not purge the most recent state for an entity (#11039)
* Protect states that are the most recent states of their entity

* Also protect events

* Some documentation

* Fix SQL
2018-01-01 18:43:10 -08:00
Dan Nixon
f0bf7b0def More support for availability reporting on MQTT components (#11336)
* Abstract MQTT availability from individual components

- Moved availability topic and payloads to MQTT base schema.
- Updated components that already report availability:
  - Switch
  - Binary sensor
  - Cover

* Add availability reporting to additional MQTT components

- Light
- JSON light
- Template light
- Lock
- Fan
- HVAC
- Sensor
- Vacuum
- Alarm control panel

* Annotate MQTT platform coroutines
2018-01-01 18:32:29 -08:00
Marius
541707c3e7 Removed status block to allow https://github.com/home-assistant/home-assistant-polymer/pull/766 with no impact (#11345) 2018-01-01 18:22:27 -08:00
Mitko Masarliev
add89d6973 Notify webos timeout error fix (#11027)
* use smaller icon

* add timeout option

* remove default icon, remove timeout option

* add image again
2018-01-01 18:19:49 -08:00
NotoriousBDG
e2cec9b3ae Move IMAP Email Content body to an attribute (#11096)
* Move IMAP Email Content body to an attribute

* Fix variable names
2018-01-01 18:09:40 -08:00
Paulus Schoutsen
0f914b4c20 Update frontend to 20180102.0 2018-01-01 17:20:27 -08:00
Paulus Schoutsen
1b4be0460c Log exceptions that happen during service call (#11394)
* Log exceptions that happen during service call

* Lint
2018-01-01 15:32:39 -08:00
Greg Dowling
cb899a9465 Bump pywemo to fix request include problems. (#11401) 2018-01-01 15:32:26 -08:00
Otto Winter
b362017206 Upgrade pychromecast to 1.0.3 (#11410) 2018-01-01 14:52:36 -08:00
Paulus Schoutsen
6e63a4ed8a Fix broken tests (#11395)
* Do not leave remember the milk config file behind

* Fix exception in service causing service timeout

* Change max service timeout to 9 to catch services timing out

* Fix Google Sync service test

* Update and pin test requirements
2018-01-01 14:30:09 -08:00
Kane610
b9c852392c Add deCONZ component (#10321)
* Base implementation of component, no sensors yet

* Added senor files

* First fully working chain of sensors and binary sensors going from hardware in to hass

* Clean up

* Clean up

* Added light platform

* Turning lights on and off and set brightness now works

* Pydeconz is now a proper pypi package
Stop sessions when Home Assistant is shutting down
Use a simpler websocket client

* Updated pydocstrings
Followed recommendations from pylint and flake8

* Clean up

* Updated requirements_all.txt

* Updated Codeowners to include deconz.py
Also re-added the Axis component since it had gotten removed

* Bump requirement

* Bumped to v2
Reran script/gen_requirements

* Removed global DECONZ since it wasn't relevant any more

* Username and password is only relevant in the context of getting a API key

* Add support for additional sensors

* Added support for groups

* Moved import of component library to inside of methods

* Moved the need for device id to library

* Bump pydeconz to v5

* Add support for colored lights

* Pylint and flake8 import improvements

* DATA_DECONZ TO DECONZ_DATA

* Add support for transition time

* Add support for flash

* Bump to v7

* ZHASwitch devices will now only generate events by default, instead of being a sensor entity

* Clean up

* Add battery sensor when device signals through an event

* Third-party library communicates with service

* Add support for effect colorloop

* Bump to pydeconz v8

* Same domain everywhere

* Clean up

* Updated requirements_all

* Generated API key will now be stored in a config file

* Change battery sensor to register to callback since library now supports multiple callbacks
Move DeconzEvent to hub
Bump to v9

* Improve entity attributes

* Change end of battery name to battery level
No need for static icon variable when using battery level helper

* Bump requirement to v10

* Improve pydocstring for DeconzEvent
Rename TYPE_AS_EVENT to CONF_TYPE_AS_EVENT

* Allow separate brightness to override RGB brightness

* Expose device.reachable in entity available property

* Bump requirement to 11 (it goes up to 11!)

* Pylint comment

* Binary sensors don't have unit of measurement

* Removed service to generate API key in favor of just generating it as a last resort of no API key is specified in configuration.yaml or deconz.conf

* Replace clear text to attribute definitions

* Use more constants

* Bump requirements to v12

* Color temp requires xy color support

* Only ZHASwitch should be an event

* Bump requirements to v13

* Added effect_list property

* Add attribute to battery sensor to easy find event id

* Bump requirements to v14

* Fix hound comment

* Bumped requirements_all information to v14

* Add service to configure devices on deCONZ

* Add initial support for scenes

* Bump requirements to v15

* Fix review comments

* Python doc string improvement

* Improve setup and error handling during setup

* Changed how to evaluate light features

* Remove 'ghost' events by not triggering updates if the signal originates from a config event
Bump requirement to v17

* Fix pylint issue by moving scene ownership in to groups in requirement pydeconz
Bump requirement to v18

* Added configurator option to register to deCONZ when unlocking gateway through settings
Bump requirement to v20

* Improve async configurator

* No user interaction for deconz.conf

* No file management in event loop

* Improve readability of load platform

* Fewer entity attributes

* Use values() instead of items() for dicts where applicable

* Do one add devices per platform

* Clean up of unused attributes

* Make sure that discovery info is not None

* Only register configure service and shutdown service when deconz has been setup properly

* Move description

* Fix lines longer than 80

* Moved deconz services to a separate file and moved hub to deconz/__init__.py

* Remove option to configure switch as entity

* Moved DeconzEvent to sensor since it is only Switch buttonpress that will be sent as event

* Added support for automatic discovery of deconz
Thanks to Kroimon for adding support to netdisco

* Use markup for configuration description

* Fix coveragerc

* Remove deCONZ support from Hue component

* Improved docstrings and readability

* Remove unnecessary extra name for storing in hass.data, using domain instead

* Improve readability by renaming all async methods
Bump to v21 - improved async naming on methods

* Fix first line not being in imperative mood

* Added logo to configurator
Let deconz.conf be visible since it will be the main config for the component after initial setup

* Removed bridge_type from new unit tests as part of removing deconz support from hue component

* Capitalize first letters of Battery Level

* Properly update state of sensor as well as reachable and battery
Bump dependency to v22

* Fix flake8 Multi-line docstring closing quotes should be on a separate line

* Fix martinhjelmares comments

Bump dependency to v23
Use only HASS aiohttp session
Change when to use 'deconz' or domain or deconz data
Clean up unused logger defines
Remove unnecessary return values
Fix faulty references to component documentation
Move callback registration to after entity has been initialized by HASS
Less inception style on pydocs ;)
Simplify loading platforms by using a for loop
Added voluptous schema for service
Yaml file is for deconz only, no need to have the domain present
Remove domain constraint when creating event title
2018-01-01 17:08:13 +01:00
Jeroen ter Heerdt
976a0fe38c Adding support for Egardia / Woonveilig version GATE-03 (#11397) 2018-01-01 02:10:52 +01:00
Paulus Schoutsen
fc8b25a71f Clean up Google Assistant (#11375)
* Clean up Google Assistant

* Fix tests
2017-12-31 15:04:49 -08:00
Dan Nixon
fcbf7abdaa Reverts unit conversions in TP-Link bulb (#11381)
Reverts energy and power unit conversions added in #10979 as they break
early devices.

A proper fix should be implemented in the pyhs100 library which should
return common units across all devices/firmwares.
2017-12-31 15:58:22 +01:00
ChristianKuehnel
7759ab6919 Remember the Milk - updating and completing tasks (#11069)
* Remember the Milk - updating and completing tasks

Added new feature so that tasks can be updated and completed.
For this feature a task id must be set when creating the task.

* fixed hould complaints

* fixed review comments by @MartinHjelmare

* removed unnecessary check as proposed by @MartinHjelmare
2017-12-29 19:20:36 +01:00
William Scanlon
3fd620198e Support for EcoNet water heaters (#11260)
* Support for EcoNet water heaters.

* Fixed requested changes.

* Added logging when temp or operation mode are None

* More fixes from PR review.

* Updated pyeconet version to fix natural gas water heater error. Last PR review fix.
2017-12-29 19:05:58 +01:00
Pascal Vizeli
49bc95549b Don't block on sevice call for alexa (#11358)
* Don't block on sevice call for alexa

* fix tests
2017-12-29 09:44:06 -08:00
Thibault Cohen
ba0f7a4101 Fido component use now asyncio (#11244)
* Fido component use now asyncio

* Fix comments

* Fix comments 2

* Fix assertion for test error

* Update to pyfido 2.1.0
2017-12-29 18:33:11 +01:00
tschmidty69
4914ad1dd9 Ping device tracker now respects interval_seconds (#11348)
* Ping device tracker now respects interval_seconds
2017-12-29 16:18:39 +01:00
Dan Nixon
f07a4684e0 Fix RGB template ordering in MQTT Light (#11362)
* Use different colour channel intensities in tests

Uses a different value for each colour channel in MQTT light tests to
properly differentiate between colour channels.

* Correct ordering of RGB channels in MQTT light
2017-12-29 15:28:20 +01:00
Paulus Schoutsen
cfd78f7b02 Add HTTP endpoint for resending email confirmation (#11354) 2017-12-29 14:46:10 +01:00
Dan Nixon
2a2e6b6334 Correct units used in TP-Link energy monioring (#10979)
* Correct units used in TP-Link energy monioring

- Energy is measured in kWh for swtches
- Power is reported in mW for bulbs
- Energy is reported in Wh for bulbs

* TP-Ling energy: store units in attribute names

Stores the unit in the attrbute names for TP-Link devices that support
energy monitoring.
2017-12-29 13:13:15 +01:00
Fabian Affolter
b635637541 Upgrade youtube_dl to 2017.12.28 (#11357) 2017-12-29 10:16:18 +01:00
Fabian Affolter
a7ebba6863 Upgrade python-telegram-bot to 9.0.0 (#11341) 2017-12-29 10:08:14 +01:00
Fabian Affolter
1f8acb49bc Upgrade mypy to 0.560 (#11334) 2017-12-29 10:07:25 +01:00
Fabian Affolter
5a4bca9780 Upgrade sqlalchemy to 1.2.0 (#11333) 2017-12-29 10:07:04 +01:00
Fabian Affolter
d7e52d8014 Upgrade pyowm to 2.8.0 (#11332) 2017-12-29 10:06:52 +01:00
Fabian Affolter
391a8901c8 Upgrade fuzzywuzzy to 0.16.0 (#11331) 2017-12-29 10:06:39 +01:00
Fabian Affolter
b98e03b5bc Upgrade aiohttp to 2.3.7 (#11329) 2017-12-29 10:06:25 +01:00
Andy Castille
6b586c268a DoorBird feature update (#11193)
* Allow disabling the DoorBird camera live view

* Support for push notifications from DoorBird devices

* use DoorBirdPy 0.1.1 instead of 0.1.0

* Fix lint errors in DoorBird binary sensor

* Change DoorBird push notifications from binary sensor to event

* Remove DoorBird camera options

* use DoorBirdPy 0.1.2 to fix history image urls

* clean up doorbird event code and remove unused doorbird camera imports

* use async for doorbird doorbell events

* Minor changes

* Update file header

* Fix my mess

* Fix docstring
2017-12-29 10:05:45 +01:00
goldminenine
9a34e7174c Update modbus.py (#11238)
Support of MODBUS RTU over TCP ethernet mode. See more description here:  https://www.eltima.com/modbus-over-ethernet/
2017-12-29 09:19:34 +01:00
Fabian Affolter
3203849b60 Move data instance to setup (#11350) 2017-12-29 09:03:03 +01:00
Thom Troy
2e582a4597 pass stops_at to get_station_by_name (#11304) 2017-12-28 22:37:51 +01:00
Gregory Benner
5d38eec37d Sochain cryptocurrency sensor (#11335)
* add required files

* add sochain sensor

* add missing schema

* end first sentence with a period to make travis happy

* upgrade to python-sochain-api 0.0.2 and use asyncio

* add missing _LOGGER and fix long line

* move object setup to async_setup_platform

* rename chainSo variable to chainso
2017-12-28 21:39:24 +01:00
Dan Nixon
a6c7fe04da Add default names and validation for TP-Link devices (#11346)
Adds missing platform schema for TP-Link smart sockets and adds default
names for smart sockets and bulbs.
2017-12-28 21:22:46 +01:00
Jeroen ter Heerdt
966ab20f26 Remove need for separate EgardiaServer setup (#11344)
* Removing need for separate Egardiaserver setup

* Fixing linting errors

* Updating egardia component based on review

* Updating egardia component based on review

* Updating egardia component based on review

* Removed return False twice based on review
2017-12-28 20:20:44 +01:00
Matt Schmitt
b2e9dc5c8f Additional device classes for binary sensors (#11280)
* Add additional device classes for binary sensor
2017-12-28 18:55:22 +01:00
Lukas Barth
fc3a8e4e79 Merge pull request #10535 from broox/nuheat
Adding a Nuheat Thermostat component
2017-12-28 09:14:27 +01:00
Derek Brooks
00352d41a7 remove return value as requested 2017-12-27 18:20:12 -08:00
Derek Brooks
29c26e0015 fix bad nuheat component test 2017-12-27 13:06:04 -08:00
Derek Brooks
63d9bd4a9c test resume program service 2017-12-27 12:42:56 -08:00
Bob Igo
cb23549af6 closes #11314 by not restricting the voice to anything but a string (#11326) 2017-12-27 19:49:06 +01:00
Rene Nulsch
e5cc5a58e1 Bugfix for HA Issue 7292, 9412 - switch to gamertag to receive ssl image url (#11315) 2017-12-27 09:24:37 +01:00
Greg Laabs
aa8db784d5 Fix leak sensors always showing Unknown until Wet (#11313)
Leak sensors were using the "wet" node as a negative node, which prevented them from ever gettng a Dry status unless the user pressed the button on the hardware after every Hass reboot.

This change ignores the Wet node, as it is just always the exact inverse of the Dry node. We don't need to watch both.
2017-12-27 09:23:21 +01:00
Fabian Affolter
d68d4d1129 Upgrade alpha_vantage to 1.6.0 (#11307) 2017-12-27 09:21:28 +01:00
Fabian Affolter
8d32e883bd Upgrade youtube_dl to 2017.12.23 (#11308) 2017-12-27 09:21:07 +01:00
Fabian Affolter
7826b9aa72 Upgrade python-digitalocean to 1.13.2 (#11311) 2017-12-27 09:20:44 +01:00
Fabian Affolter
e91d47db96 Upgrade distro to 1.2.0 (#11312) 2017-12-27 09:20:08 +01:00
Fabian Affolter
e92e433805 Upgrade yahooweather to 0.10 (#11309) 2017-12-27 09:19:46 +01:00
Fabian Affolter
40e1d35268 Upgrade luftdaten to 0.1.3 (#11316) 2017-12-27 09:19:02 +01:00
Fabian Affolter
af6c39f4d1 Upgrade pysnmp to 4.4.3 (#11317) 2017-12-27 09:17:43 +01:00
Fabian Affolter
5be949f00f Upgrade aiohttp_cors to 0.6.0 (#11310) 2017-12-27 09:17:03 +01:00
Mitko Masarliev
169459b57f Fix for track_new_devices BC (#11202)
* BC fix

* more tests

* inline if change

* inline if change
2017-12-26 14:49:24 -08:00
Conrad Juhl Andersen
05926b1994 xiaomi_aqara: Fix covers never being closed (#11319)
Bug in equality testing
2017-12-26 23:35:48 +01:00
awkwardDuck
54b4142530 Fix typo in bitcoin.py component for mined blocks. (#11318) 2017-12-26 22:02:59 +01:00
Derek Brooks
f0244d7982 add a bit more test coverage 2017-12-26 11:12:28 -08:00
Paulus Schoutsen
7a600ea064 Add heartbeat to websocket connections (#11298) 2017-12-26 10:59:41 +01:00
Greg Laabs
d687bc073e Huge ISY994 platform cleanup, fixes support for 5.0.10 firmware (#11243)
* Huge ISY994 platform cleanup, fixes support for 5.0.10 firmware

# * No more globals - store on hass.data
# * Parent ISY994 component handles categorizing nodes in to Hass components, rather than each individual domain filtering all nodes themselves
# * Remove hidden string, replace with ignore string. Hidden should be done via the customize block; ignore fully prevents the node from getting a Hass entity
# * Removed a few unused methods in the ISYDevice class
# * Cleaned up the hostname parsing
# * Removed broken logic in the fan Program component. It was setting properties that have no setters
# * Added the missing SUPPORTED_FEATURES to the fan component to indicate that it can set speed
# * Added better error handling and a log warning when an ISY994 program entity fails to initialize
# * Cleaned up a few instances of unecessarily complicated logic paths, and other cases of unnecessary logic that is already handled by base classes

* Use `super()` instead of explicit base class calls

* Move `hass` argument to first position

* Use str.format instead of string addition

* Move program structure building and validation to component

Removes the need for a bunch of duplicate exception handling in each individual platform

* Fix climate nodes, fix climate names, add config to disable climate

Sensor platform was crashing when the ISY reported climate nodes. Logic has been fixed. Also added a config option to prevent climate sensors from getting imported from the ISY. Also replace the underscore from climate node names with spaces so they default to friendly names.

* Space missing in error message

* Fix string comparison to use `==`

* Explicitly check for attributes rather than catch AttributeError

Also removes two stray debug lines

* Remove null checks on hass.data, as they are always null at this point
2017-12-26 09:26:37 +01:00
Mike Megally
a59b02b6b4 Removed error log used as debug (#11301)
An error was being logged to display debug info. Removed it
2017-12-25 20:49:02 +01:00
Frantz
14919082a3 Better error handling (#11297)
* Better error handling

* Fixed hound
2017-12-25 17:46:42 +01:00
Bob Anderson
802a95eac5 Fix unpredictable entity names in concord232 binary_sensor (#11292) 2017-12-25 13:26:22 +01:00
Michael Irigoyen
a44181fd35 Add Chime status and control to Alarm Decoder component (#11271)
* Enable more alarm decoder attributes, including chime status and ready status

* Expose chime service in the alarm decoder component

* Fix line length linting issue

* Fix spacing lint issue

* Update PR based on reviewer requests

* Update based on linting catches

* Fix descriptions include from async to sync
2017-12-25 11:34:07 +01:00
PhracturedBlue
b280a791a6 Store raw state of RF sensors from alarmdecoder (#10841)
* Store raw state of RF sensors from alarmdecoder

* Fix resync.  Fix issue with RFID not being truly optional

* Breakdown RF attributes per bit

* Preserve import style
2017-12-25 10:52:33 +01:00
Jordy
7269070d97 Added rainsensor (#11023)
* Added rainsensor

Added rainsensor

* Added to coverage ignore

* Fixed issues

* script\gen_requirements_all.py

script\gen_requirements_all.py

* Gen requirements

* requirements

* requirements

* Fix docstring

* Fix log message

* Revert change
2017-12-25 10:07:17 +01:00
Phil Kates
94ac0b5ed8 alexa: Add handling for covers (#11242)
* alexa: Add handling for covers

Covers don't support either cover.turn_on or homeassistant.turn_on so
use cover.[open|close]_cover.

* alexa: Add tests for covers
2017-12-24 15:05:56 -08:00
Derek Brooks
8ef8dbc868 pleasin the hound 2017-12-24 11:15:50 -07:00
Derek Brooks
7de3c62846 register nuheat_resume_program service 2017-12-24 11:10:22 -07:00
Derek Brooks
fb90dab471 add ability to change the Nuheat thermostat hold mode 2017-12-24 10:09:27 -07:00
Derek Brooks
419ec7f7a7 bump to python-nuheat 0.3.0 2017-12-24 09:43:56 -07:00
Derek Brooks
bdf64ccbbb Merge branch 'dev' into nuheat 2017-12-24 09:40:21 -07:00
Ryan McLean
3fa45375d9 Plex refactor (#11235)
* Cleaned up '_clear_media()'

* Moved media Type to new method

* renamed "clear_media()' to ' clear_media_details()'
reset 'app_name' (Library Name) in clear_media_details
moved thumbs to '_set_media_image()'

* Moved playback info into setmedia type as it was just used for the next anyway

* Moved library name & image download to only happen if session and player active as else no point anyway

* Fixed Linting issue

* Some tweaks to clean up unintended complexity

* Removed redundant declarations

* Fixed whitespace

* Revert "Fixed whitespace"

This reverts commit 0985445c47.

* Revert "Removed redundant declarations"

This reverts commit 6f9d5a85b0.
2017-12-24 11:18:31 -05:00
Aaron Bach
5566ea8c81 Adds support for disabled Tiles and automatic session renewal (#11172)
* Adds support for disabled Tiles and automatic session renewal

* Updated requirements

* Collaborator-requested changes

* Collaborator-requested changes
2017-12-24 01:19:04 +01:00
Andrea Campi
8c303bf48c Support multiple Hue bridges with lights of the same id (#11259)
* Improve support for multiple Hue bridges with lights that have the same id.

The old code pre-refactoring kept a per-bridge list of lights in a closure; my refactoring moved that to hass.data, which is convenient but caused them to conflict with each other.

Fixes #11183

* Update test_hue.py
2017-12-24 01:12:54 +01:00
David Fiel
8683d75aa1 Greenwave Reality (TCP Connected) Lighting Component (#11282)
* Create greenwave.py

* Update .coveragerc

* Update requirements_all.txt

* Update greenwave.py

Line too long

* Update greenwave.py

* Update requirements_all.txt

* Update greenwave.py

* Update greenwave.py

* fix style
2017-12-24 01:11:45 +01:00
Andrey Kupreychik
4f5d7cea11 Added password for GPS logger endpoint (#11245)
* Added password for GPS logger endpoint

* Fixed lint error

* Update gpslogger.py

* fix lint

* fix import
2017-12-24 00:15:06 +01:00
Andrey
ab9ffc4f05 Report Sensibo as off when it is off (#11281) 2017-12-23 11:10:54 +01:00
Paulus Schoutsen
6e2bfcfe65 Update frontend to 20171223.0 2017-12-22 21:31:31 -08:00
Andrey
240098dd7e Change manifest path to /states as this is the path / actually sets. (#11274) 2017-12-22 21:05:15 -08:00
Daniel Watkins
353bb62687 Fix webostv select source (#11227)
* Fix reuse of variable name

This should fix #11224.

* Add tests for LgWebOSDevice.select_source
2017-12-22 18:38:00 +01:00
maxlaverse
46df91ff45 Fix allday events in custom_calendars (#11272) 2017-12-22 14:08:34 +01:00
Ben Randall
295caeb065 Fix async IO in Sesame lock component. (#11054)
* Call update on Sesame devices to cache initial state

* Switch to using async_add_devices

* Fix line length

* Fix Lint errors

* Fix more Lint errors

* Cache pysesame properties

* Updates from CR feedback
2017-12-22 10:28:51 +01:00
Egor Tsinko
eeb309aea1 Functinality to save/restore snapshots for monoprice platform (#10296)
* added functionality to save/restore snapshots to monoprice platform

* renamed monoprice_snapshot, monoprice_restore to snapshot, restore

This is to simplify refactoring of snapshot/restore functionality for monoprice, snapcast and sonos in the future
2017-12-22 10:26:34 +01:00
Pascal Vizeli
9e0a765801 Revert "Backup configuration files before overwriting" (#11269)
* Revert "Adding MotionIP to BinarySensors for HMIP-SMI (#11268)"

This reverts commit c94cc34a8f.

* Revert "Bugfix: 10509 - http is hard coded in plex sensor (#11072)"

This reverts commit 901d4b5489.

* Revert "Fix handling zero values for state_on/state_off (#11264)"

This reverts commit 2e4e3a42cc.

* Revert "Fix inverted sensors on the concord232 binary sensor component (#11261)"

This reverts commit b866687cd7.

* Revert "Proper Steam game names and small fixes (#11182)"

This reverts commit 7faa94046c.

* Revert "Bugfix homematic available modus (#11256)"

This reverts commit 1d579587c1.

* Revert "Fix detection of if a negative node is in use (#11255)"

This reverts commit b28bfad496.

* Revert "added myself to become code owner for miflora and plant (#11251)"

This reverts commit e0682044f0.

* Revert "Add workaround for running tox on Windows platforms (#11188)"

This reverts commit 81f1a65fae.

* Revert "Upgrade to new miflora version 0.2.0 (#11250)"

This reverts commit 8efc4b5ba9.

* Revert "homematic: add username and password to interface config schema (#11214)"

This reverts commit b4e2537de3.

* Revert "Backup configuration files before overwriting (#11216)"

This reverts commit 90e25a6dfb.
2017-12-21 22:33:37 +01:00
schnoetz
c94cc34a8f Adding MotionIP to BinarySensors for HMIP-SMI (#11268)
* Adding MotionIP to BinarySensors for HMIP-SMI

My HmIP-SMI (Homematic IP Motion Sensor) only shows "ILLUMINATION" and no MOTION, because the binary values are not recognized. The "old" homematic-motion detectors are working well showing motion, too. 
I found out that "MotionIP" was missing at the binary_sensors - after adding "Motion" and "Motion Detection Activated" are shown.

* Removed trailing blanks

removed trailing blanks from my previous change
2017-12-21 21:46:42 +01:00
Ryan McLean
901d4b5489 Bugfix: 10509 - http is hard coded in plex sensor (#11072)
* Fix for sensor no ssl

* Line length Fixes

* Removed unneeded schema extensions

* Removed unrequired variable

* Added defaults for SSL & SSL Verify

* Moved Defaults to Variables

Corrected SSL Defaults to match the other Defaults style

* Fixed Typo

* Removed option to disable verify ssl

* Removed unused import

* Removed unused CONST

* Fixed error handling

* Cleanup of unneeded vars & logging

* Fix for linting
2017-12-21 10:24:57 -05:00
Zio Tibia
2e4e3a42cc Fix handling zero values for state_on/state_off (#11264) 2017-12-21 14:24:19 +01:00
CTLS
b866687cd7 Fix inverted sensors on the concord232 binary sensor component (#11261)
* Fix inverted sensors on the concord232 binary sensor component

* Changed from == Tripped to != Normal
2017-12-21 06:29:42 +01:00
Frank Wickström
7faa94046c Proper Steam game names and small fixes (#11182)
* Use constant for offline state

* Use constant for no game name

* Rename trade and play constant their proper names

Trade and Play are not the correct names for the states. For instance
Play might be seens as the user is actually is playing, which is not
correct as there is no such state is returned from the Steam API.
Just having "trade" does not say much about what is happening and
might be misintepreted that the user is currently trading, which is not
correct either.

We instead use the names from the underlying library for naming the
states [1]

[1] 2e518ad84f/steam/user.py (L109)

* Get the proper game name if no extra info is given from the api

The third `current_game` parameter that was used before hold
extra information about the game that is being played. This might
contain the game name, it might also be empty. The correct way to
get the game name is to fetch it from the API depending on the
game id that might be returned in the `current_game` attribute if
the user is playing a game.

To not break existing implementations we keep the functionality
to first go with the extra information and only then fetch the proper
game name.

* Refactor getting game name to its own function

This cleans up the code and removed "ugly" else statements
from the sensor and makes the game fetching easier to read.

* Let state constant values be lower snake case

* Return None instead of 'None' when no current game exists

* Initialize steam app list only once to benefit form caching

* Return None as state attributes if no current game is present
2017-12-20 22:32:33 -05:00
Pascal Vizeli
1d579587c1 Bugfix homematic available modus (#11256) 2017-12-20 23:59:11 +01:00
Greg Laabs
b28bfad496 Fix detection of if a negative node is in use (#11255)
* Fix detection of if a negative node is in use

Fix a problem where every negative node gets detected as in-use. Code was not checking the correct property.

* Allow protected access
2017-12-20 23:58:22 +01:00
ChristianKuehnel
e0682044f0 added myself to become code owner for miflora and plant (#11251) 2017-12-20 12:11:56 +01:00
Ben Randall
81f1a65fae Add workaround for running tox on Windows platforms (#11188)
* Add workaround for running tox on Windows platforms

* Remove install_command override
2017-12-20 11:50:31 +01:00
ChristianKuehnel
8efc4b5ba9 Upgrade to new miflora version 0.2.0 (#11250) 2017-12-20 11:35:03 +01:00
Janne Grunau
b4e2537de3 homematic: add username and password to interface config schema (#11214)
Fixes #11191, the json-rpc name resolving method requires user account
and password.
2017-12-20 00:38:59 +01:00
Charles Garwood
90e25a6dfb Backup configuration files before overwriting (#11216)
* Backup configuration files before overwriting

* Changed timestamp format from epoch to iso8601 (minus punctuation)
2017-12-19 17:55:24 +01:00
Dan Chen
3d90855ca6 Bump python-miio version (#11232) 2017-12-19 08:22:13 +01:00
Dan Nixon
200c927087 Extend Threshold binary sensor to support ranges (#11110)
* Extend Threshold binary sensor to support ranges

- Adds support for ranges
- Threshold type (lower, upper, range) is defined by supplied
  thresholds (lower, upper)
- Adds verbose status/position relative to threshold as attribute
  (position)

* Minor changes (ordering, names, etc.)

* Update name

* Update name
2017-12-19 01:52:19 +01:00
markferry
ef22a6e18d Fix statistics sensor mean and median when only one sample is available. (#11180)
* Fix statistics sensor mean and median when only one sample is available.

With only one data point stddev and variance throw an exception.
This would clear the (valid) mean and median calculations.

Separate the try..catch blocks for one-or-more and two-or-more stats so
that this doesn't happen.

Test this with a new sampling_size_1 test.

* test_statistics trivial whitespace fix
2017-12-18 21:21:27 +01:00
Thibault Maekelbergh
061395d2f8 Add Discogs Sensor platform (#10957)
* Add Discogs Sensor platform

* Add discogs module to requirements_all

* Fix wrong style var name

* PR Feedback (scan interval, mod. docstring)

* Added sensor.discogs to coveragerc

* Use SERVER_SOFTWARE helper for UA-String

* Don't setup platform if token is invalid

* Fix trailing whitespace for Hound CI

* Move client setup to setup()
2017-12-18 19:10:54 +01:00
Khole
05258ea4bf Hive Component Release Two (#11053)
* Add boost functionality to climate devices

* Update boost target temperature rounding

* Update with Colour Bulb Support

* colour bulb fix

* Requirements Update and colorsys import

* Add RGB Attribute - ATTR_RGB_COLOR

* Hive release-2

* add boost support for hive climate platform

* Colour Bulb - Varible update

* Boost - Tox error

* Convert colour to color

* Correct over indentation

* update version to 0.2.9 pyhiveapi

* Updated pyhiveapi to version 2.10 and altertered turn_n on fuction to 1 call

* Update climate doc string

* Update to is_aux_heat_on

* update to is_aux_heat_on
2017-12-18 18:15:41 +01:00
Thibault Cohen
8742ce035a Hydroquebec component use now asyncio (#10795)
* Hydroquebec component use now asyncio

* Add tests

* Improve coverage

* fix tests

* Remove useless try/except and associated tests
2017-12-17 22:11:48 +01:00
maxlaverse
0664bf31a2 Fix webdav calendar schema (#11185) 2017-12-17 20:53:40 +01:00
Fabian Affolter
0ec1ff642d Bump dev to 0.61.0.dev0 2017-12-17 16:29:36 +01:00
Fabian Affolter
cd44824233 Merge branch 'master' into dev 2017-12-17 16:24:52 +01:00
Fabian Affolter
79240a0d47 Merge pull request #11153 from home-assistant/release-0-60
0.60
2017-12-17 15:44:41 +01:00
Brad Dixon
c03d04d826 Revbump to SoCo 0.13 and add support for Night Sound and Speech Enhancement. (#10765)
Sonos Playbar and Playbase devices support Night Sound and Speech Enhancement
effects when playing from sources such as a TV. Adds a new service "sonos_set_option"
whichs accepts boolean options to control these audio features.
2017-12-17 13:09:48 +01:00
Brad Dixon
dfb8b5a3c1 Revbump to SoCo 0.13 and add support for Night Sound and Speech Enhancement. (#10765)
Sonos Playbar and Playbase devices support Night Sound and Speech Enhancement
effects when playing from sources such as a TV. Adds a new service "sonos_set_option"
whichs accepts boolean options to control these audio features.
2017-12-17 13:08:35 +01:00
Mike Megally
432304be82 Remove logging (#11173)
An error was being log that seems more like debug info
2017-12-17 13:07:23 +01:00
PhracturedBlue
294d8171a2 convert alarmdecoder interface from async to sync (#11168)
* convert alarmdecoder interface from async to sync

* Convert he rest of alarmdecoder rom async to sync

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py
2017-12-17 13:07:23 +01:00
Pascal Vizeli
a46ddcf6dd Add install mode to homematic (#11164) 2017-12-17 13:07:23 +01:00
Paulus Schoutsen
5ca006cc9c Don't connect to cloud if subscription expired (#11163)
* Final touch for cloud component

* Fix test
2017-12-17 13:07:23 +01:00
Adam Mills
564ed26aeb Perform logbook filtering on the worker thread (#11161) 2017-12-17 13:07:22 +01:00
Pascal Vizeli
5860267410 Resolve hostnames (#11160) 2017-12-17 13:07:22 +01:00
Pascal Vizeli
ec9638f4d1 Homematic next (#11156)
* Cleanup logic & New gen of HomeMatic

* fix lint

* cleanup

* fix coverage

* cleanup

* name consistenc

* fix lint

* Rename ip

* cleanup wrong property

* fix bug

* handle callback better

* fix lint

* Running now
2017-12-17 13:07:22 +01:00
Matthew Treinish
7db8bbf385 Fix X10 commands for mochad light turn on (#11146)
* Fix X10 commands for mochad light turn on

This commit attempts to address issues that a lot of people are having
with the x10 light component. Originally this was written to use the
xdim (extended dim) X10 command. However, not every X10 dimmer device
supports the xdim command. Additionally, it turns out the number of
dim/brighness levels the X10 device supports is device specific and
there is no way to detect this (given the mostly 1 way nature of X10)

To address these issues, this commit removes the usage of xdim and
instead relies on using the 'on' command and the 'dim' command. This
should work on all x10 light devices. In an attempt to address the
different dim/brightness levels supported by different devices this
commit also adds a new optional config value, 'brightness_levels', to
specify if it's either 32, 64, or 256. By default 32 levels are used
as this is the normal case and what is documented by mochad.

Fixes #8943

* make code more readable

* fix style

* fix lint

* fix tests
2017-12-17 13:07:22 +01:00
Przemek Więch
024f1d4882 Try multiple methods of getting data in asuswrt. (#11140)
* Try multiple methods of getting data in asuswrt.

Solves #11108 and potentially #8112.

* fix style

* fix lint
2017-12-17 12:46:47 +01:00
PhracturedBlue
3375261f51 convert alarmdecoder interface from async to sync (#11168)
* convert alarmdecoder interface from async to sync

* Convert he rest of alarmdecoder rom async to sync

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py

* Update alarmdecoder.py
2017-12-17 00:52:59 +01:00
Matthew Treinish
640d58f0a8 Fix X10 commands for mochad light turn on (#11146)
* Fix X10 commands for mochad light turn on

This commit attempts to address issues that a lot of people are having
with the x10 light component. Originally this was written to use the
xdim (extended dim) X10 command. However, not every X10 dimmer device
supports the xdim command. Additionally, it turns out the number of
dim/brighness levels the X10 device supports is device specific and
there is no way to detect this (given the mostly 1 way nature of X10)

To address these issues, this commit removes the usage of xdim and
instead relies on using the 'on' command and the 'dim' command. This
should work on all x10 light devices. In an attempt to address the
different dim/brightness levels supported by different devices this
commit also adds a new optional config value, 'brightness_levels', to
specify if it's either 32, 64, or 256. By default 32 levels are used
as this is the normal case and what is documented by mochad.

Fixes #8943

* make code more readable

* fix style

* fix lint

* fix tests
2017-12-17 00:52:40 +01:00
Mike Megally
793b8b8ad3 Remove logging (#11173)
An error was being log that seems more like debug info
2017-12-16 22:29:40 +01:00
Pascal Vizeli
39af43eb5c Add install mode to homematic (#11164) 2017-12-16 14:22:23 +01:00
Paulus Schoutsen
b56675a7bb Don't connect to cloud if subscription expired (#11163)
* Final touch for cloud component

* Fix test
2017-12-16 00:42:25 -08:00
Adam Mills
c4d71e934d Perform logbook filtering on the worker thread (#11161) 2017-12-16 00:04:27 -08:00
Paulus Schoutsen
f4d7bbd044 Update frontend 2017-12-15 23:36:04 -08:00
Paulus Schoutsen
3d5d90241f Update frontend 2017-12-15 23:35:37 -08:00
Pascal Vizeli
a7c8e202aa Resolve hostnames (#11160) 2017-12-15 22:54:54 +01:00
Pascal Vizeli
a63658d583 Homematic next (#11156)
* Cleanup logic & New gen of HomeMatic

* fix lint

* cleanup

* fix coverage

* cleanup

* name consistenc

* fix lint

* Rename ip

* cleanup wrong property

* fix bug

* handle callback better

* fix lint

* Running now
2017-12-15 21:22:36 +01:00
Fabian Affolter
ca81180e6d Bump release to 0.60.0 2017-12-15 10:06:06 +01:00
Daniel Perna
de4c8adca2 Upgrade Homematic (#11149)
* Update pyhomematic

* Update pyhomematic
2017-12-15 00:34:27 +01:00
Paulus Schoutsen
823e260c2a Disable html5 notify dependency (#11135) 2017-12-14 00:15:25 -08:00
Greg Laabs
1c8b5838cd ISY994 sensor improvements (#10805)
* Fire events for ISY994 control events

This allows hass to react directly to Insteon button presses (on switches and remotes), including presses, double-presses, and long holds

* Move change event subscription to after entity is added to hass

The event handler method requires `self.hass` to exist, which doesn't have a value until the async_added_to_hass method is called. Should eliminate a race condition.

* Overhaul binary sensors in ISY994 to be functional "out of the box"

We now smash all of the subnodes from the ISY994 in to one Hass binary_sensor, and automatically support both paradigms of state reporting that Insteon sensors can do. Sometimes a single node's state represents the sensor's state, other times two nodes are used and only "ON" events are sent from each. The logic between the two forunately do not conflict so we can support both without knowing which mode the device is in.

This also allows us to handle the heartbeat functionality that certain sensors have - we simply store the timestamp of the heartbeat as an attribute on the sensor device. It defaults to Unknown on bootup if and only if the device supports heartbeats, due to the presence of subnode 4.

* Parse the binary sensor device class from the ISY's device "type"

Now we automatically know which sensors are moisture, motion, and openings! (We also reverse the moisture sensor state, because Insteon reports ON for dry on the primary node.)

* Code review tweaks

The one material change here is that the event subscribers were moved to the `async_added_to_hass` method, as the handlers depend on things that only exist after the entity has been added.

* Handle cases where a sensor's state is unknown

When the ISY first boots up, if a battery-powered sensor has not reported in yet (due to heartbeat or a change in state), the state is unknown until it does.

* Clean up from code review

Fix coroutine await, remove unnecessary exception check, and return None when state is unknown

* Unknown value from PyISY is now -inf rather than -1

* Move heartbeat handling to a separate sensor

Now all heartbeat-compatible sensors will have a separate `binary_sensor` device that represents the battery state (on = dead)

* Add support for Unknown state, which is being added in next PyISY 

PyISY will report unknown states as the number "-inf". This is implemented in the base ISY994 component, but subcomponents that override the `state` method needed some extra logic to handle it as well.

* Change a couple try blocks to explicit None checks

* Bump PyISY to 1.1.0, now that it has been published!

* Remove -inf checking from base component

The implementation of the -inf checking was improved in another branch which has been merged in to this branch already.

* Restrict negative-node and heartbeat support to known compatible types

Not all Insteon sensors use the same subnode IDs for the same things, so we need to use different logic depending on device type. Negative node and heartbeat support is now only used for leak sensors and open/close sensors.

* Use new style string formatting

* Add binary sensor detection for pre-5.x firmware

Meant to do this originally; writing documentation revealed that this requirement was missed!
2017-12-13 20:14:56 -08:00
BryanJacobs
3473ef63af Allow using more than one keyboard remote (#11061)
* Allow using more than one keyboard remote

This sets up one thread per keyboard remote, listening for events.

* Remove enclosing block in keyboard_remote

* Remove unnecessary semantic check for keyboard_remote
2017-12-13 20:07:23 -08:00
Michael Pollett
2cced1dac3 set default utc offset to 0 (#11114) 2017-12-13 20:03:41 -08:00
Adam Mills
b5d3a4736b Add problem device class (#11130) 2017-12-13 20:02:24 -08:00
Andrea Campi
e627544479 Always consume the no_throttle keyword argument. (#11126)
The current code relies on the assumption that the first invocation will never specify no_throttle=True.
However that puts us in a pickle when writing unit tests: if we had a fictitious:

  def setup_platform():
    update()

  @Throttle(MIN_TIME_BETWEEN_SCANS)
  def update():
    pass

Then given multiple tests, the second and some of subsequent tests would be throttled (depending on timing).
But we also can't change that code to call `update(no_throttle=True)' because that's not currently accepted.

This diff shouldn't change the visibile behavior of any component, but allows this extra flexibility.
2017-12-13 20:01:59 -08:00
Andrea Campi
d547345f90 Skip HASS emulated Hue bridges from detection. (#11128)
When refactoring the Hue support we lost a check for HASS bridges; restore that.
2017-12-13 20:00:30 -08:00
Nolan Gilley
4ec3289f9c update pyripple (#11122) 2017-12-13 21:21:14 +01:00
Philipp Schmitt
638dd25aff Add media position properties (#10076)
* Add media progress information

* Remove unnecessary comments

* Remove datetime import

* Remove pysonyavr dependency

* Fix doc syntax (D205)

* Lint fix: no-else-return

* Don't attempt to set media progress info if program is None

* Fix Python 3.4 compatibility

* Explicitely depend on pyteleloisirs

* Only update remaining play time when it changed

* Fix floot state table
2017-12-13 10:58:49 +01:00
Ryan McLean
37efd5a5cd Fixed typo in automation.py (#11116) 2017-12-13 10:17:12 +01:00
Paulus Schoutsen
168065b9bc Update Warrant (#11101)
* Update Warrant

* Lint
2017-12-12 21:12:41 -08:00
Eitan Mosenkis
95cd2035b6 Fix incorrect comment. (#11111) 2017-12-13 00:04:42 +01:00
Dan Nixon
aeba81e193 Report availability for TP-Link smart bulbs (#10976) 2017-12-12 17:18:46 +01:00
Pierre Ståhl
c7e327ea87 Bump pyatv to 0.3.9 (#11104) 2017-12-12 16:52:39 +01:00
Fabian Affolter
ed06b8cead Use luftdaten module (#10970)
* Use luftdaten module

* Refactoring

* Check meta data

* Make name consistent

* Remove try block
2017-12-12 08:09:47 +01:00
Jan Almeroth
a79c7ee217 Bump pymusiccast to version 0.1.6 (#11091) 2017-12-11 22:29:52 +01:00
Pascal Vizeli
6bf23f9167 Update tellcore-net to 0.4 (#11087)
* Update tellcore-net to 0.4

* Update requirements_all.txt
2017-12-11 18:32:48 +01:00
Fabian Affolter
1b3963299d Upgrade shodan to 1.7.7 (#11084) 2017-12-11 16:44:14 +01:00
Fabian Affolter
c461a7c7e2 Upgrade youtube_dl to 2017.12.10 (#11080) 2017-12-11 13:53:01 +01:00
Fabian Affolter
0cfff13be1 Upgrade psutil to 5.4.2 (#11083) 2017-12-11 13:52:43 +01:00
Fabian Affolter
0245189670 Upgrade yarl to 0.16.0 (#11078) 2017-12-11 13:52:22 +01:00
Fabian Affolter
7777d5811f Upgrade aiohttp to 2.3.6 (#11079) 2017-12-11 13:50:55 +01:00
Pascal Vizeli
7259cc878e Allow tradfri to read the available state of the device (#11056)
* Allow tradfri to read the available state of the device

* Update tradfri.py
2017-12-11 11:34:48 +01:00
Erik Eriksson
a4214afddb Volvo on call: Optional use of Scandinavian miles. Also add average fuel consumption property (#11051) 2017-12-10 13:57:44 -08:00
uchagani
b078f6c342 add custom bypass status to total connect (#11042)
* add custom bypass status to total connect

* remove logger line
2017-12-10 16:02:12 -05:00
Andrea Campi
81974885ee Refactor hue to split bridge support from light platform (#10691)
* Introduce a new Hue component that knows how to talk to a Hue bridge, but doesn't actually set up lights.

* Refactor the hue lights platform to use the HueBridge class from the hue component.

* Reimplement support for multiple bridges

* Auto discover bridges.

* Provide some migration support by showing a persistent notification.

* Address most feedback from code review.

* Call load_platform from inside HueBridge.setup passing the bridge id.

Not only this looks nicer, but it also nicely solves additional bridges being added after initial setup (e.g. pairing a second bridge should work now, I believe it required a restart before).

* Add a unit test for hue_activate_scene

* Address feedback from code review.

* After feedback from @andrey-git I was able to find a way to not import phue in tests, yay!

* Inject a mock phue in a couple of places
2017-12-10 10:15:01 -08:00
Adde Lovein
b2c5a9f5fe Add GPS coords to meraki (#10998) 2017-12-10 09:47:14 -08:00
maxlaverse
04cb893d10 Add a caldav calendar component (#10842)
* Add caldav component

* Code review - 1

* Code review - 2

* Sort imports
2017-12-10 17:44:28 +01:00
perfalk
3b228c78c0 Added support for cover in tellstick (#10858)
* Added support for cover in tellstick

* Fixed comments from PR

* Fixed comments from PR

* Address comments
2017-12-10 17:35:10 +01:00
tringler
4e91e6d103 This change fixes the error OSError: [WinError 193] on Windows debuggers (i.e. PyCharm) (#11034) 2017-12-09 16:58:52 -08:00
Paulus Schoutsen
cb4e886a4f Make notify.html5 depend on config (#11052) 2017-12-09 13:14:16 -08:00
GreenTurtwig
bee80c5b79 Add support for Logitech UE Smart Radios. (#10077)
* Add support for Logitech UE Smart Radios.

* Removed full stops to please Hound's line limit.

* Updated with requested changes.

* Fix Pylint Flake8 problem.

* Updated with requested changes.
2017-12-09 20:01:23 +01:00
Andrey Kupreychik
4479761131 Added force_update for REST sensor (#11016)
* Added force_update for REST sensor

* Linting error
2017-12-09 08:18:45 +01:00
Andrey
20f1e1609f In dev mode expose only relevant sources (#11026) 2017-12-08 17:25:16 -08:00
Matthew Treinish
1f1115f631 Serialize mochad requests (#11029)
All mochad devices are sharing a single socket interface. When multiple
threads are issuing requests to the mochad daemon at the same time the
write read cycle might get crossed between the threads. This is normally
not an issue for 1-way X10 devices because as long as the request issued
successfully and data is read over the socket then we know as much as
mochad will tell us (since there is no ACK from the request for most
X10 devices). However, where it does matter is on the device __init__()
because we're relying on the mochad daemon's internal state to take an
educated guess at the device's state to intialize things with. When
there are multiple devices being initialized at the same time the wires
can get crossed between and the wrong device state may be read.

To address this potential issue this commit adds locking using a
semaphore around all pairs of send_cmd() and read_data() (which is what
pymochad.device.Device.get_status() does internally) calls to the mochad
controller to ensure we're only ever dealing with a single request at a
time.

Fixes mtreinish/pymochad#4
2017-12-08 09:18:52 -08:00
Andrey
f7c2ec19ef Change default js version to auto (#10999) 2017-12-08 09:16:26 -08:00
tschmidty69
fed7bd9473 Update snips to listen on new mqtt topic and utilize rawValue (#11020)
* Updated snips to listen on new mqtt topic and use rawValue if value not present in slot

* Too late at night

* Trying to make minor changes via web

* Update test_snips.py

* Update __init__.py

* Updated wrong branch cause I'm a monkey
2017-12-08 09:16:08 -08:00
Anders Melchiorsen
4d6070e33a Support LIFX Mini products (#10996)
* Support new LIFX products

* Remove lint
2017-12-08 08:43:37 -08:00
Anders Melchiorsen
0a7e6ac222 Ignore Sonos players with unknown hostnames (#11013) 2017-12-08 12:01:10 +01:00
Joe Lu
f892c3394b Add support for Canary component and platforms (#10306)
* Add Canary component

* Made some change to how canary data is updated and stored

* Updated to use py-canary:0.1.2

* Addressed flake8 warnings

* Import canary API locally

* Import canary API locally again

* Addressed pylint errors

* Updated requirements_all.txt

* Fixed incorrect unit of measurement for air quality sensor

* Added tests for Canary component and sensors

* Updated canary component to handle exception better when initializing

* Fixed tests

* Fixed tests again

* Addressed review comments

* Fixed houndci error

* Addressed comment about camera force update

* Addressed comment regarding timeout when fetching camera image

* Updated to use py-canary==0.2.2

* Increased update frequency to 30 seconds

* Added support for Canary alarm control panel

* Address review comments

* Fixed houndci error

* Fixed lint errors

* Updated test to only test setup component / platform

* Fixed flake error

* Fixed failing test

* Uptake py-canary:0.2.3

* canary.alarm_control_panel DISARM is now mapped to canary PRIVACY mode

* Fixed failing tests

* Removed unnecessary methods

* Removed polling in canary camera component and update camera info when getting camera image

* Added more tests to cover Canary sensors

* Address review comments

* Addressed review comment in tests

* Fixed pylint errors

* Excluded canary alarm_control_panel and camera from coverage calculation
2017-12-08 10:40:45 +01:00
Marcus Schmidt
929d49ed6f Shuffle support in Sonos (#10875)
* initial commit of shuffle option for sonos

* added test

* Small adjustments to adhere to review requests

* Removed unnessesary setting of variable. Use shuffle state from soco instead
2017-12-07 14:44:06 -05:00
Lewis Juggins
3c1f8cd882 Handle OSError when forcibly turning off media_player.samsungtv (#10997) 2017-12-07 16:30:51 +00:00
Jeroen ter Heerdt
f21da7cfdc Fix Egardia alarm status shown as unknown after restart (#11010) 2017-12-07 12:39:34 +01:00
Alan Fischer
39d33c97ff Added Vera scenes (#10424)
* Added Vera scenes

* Fixed flake8 issues

* Fixed comments

* Moved vera to use hass.data

* Made requested changes
2017-12-07 07:47:19 +01:00
Derek Brooks
3193e825d5 remove nuheat away functionality. :( 2017-12-06 22:34:13 -06:00
Derek Brooks
c262a387dc add supported_features functionality 2017-12-06 22:24:54 -06:00
Derek Brooks
36d5fff8e0 address feedback on log lines 2017-12-06 21:52:44 -06:00
Derek Brooks
72aa722c33 Merge branch 'dev' into nuheat 2017-12-06 21:49:13 -06:00
Richard Leurs
c952f2e18a Ensure Docker script files uses LF line endings to support Docker for Windows. (#10067) 2017-12-06 15:00:58 +01:00
Daniel Watkins
0fc7f37185 webostv: Ensure source exists before use (#10959)
In a case where either (a) an incorrect source name is used, or (b) the
TV isn't currently queryable (e.g. it's off), we get tracebacks because
we assume the source that we are being asked to select exists in
self._source_list.

This makes the lookup code a little more rugged, and adds in a warning
message (in place of the current exception).
2017-12-06 14:48:17 +01:00
Pascal Vizeli
9cff6c7e6a Update tradfri.py (#10991) 2017-12-06 12:44:41 +01:00
Mitko Masarliev
e66268dffe Meraki AP Device tracker (#10971)
* Device tracker for meraki AP

* styles fix

* fix again

* again

* and again :)

* fix hide if away

* docs and optimization

* tests and fixes

* styles

* styles

* styles

* styles

* styles fix. Hope last

* clear track new

* changes

* fix accuracy error and requested changes

* remove meraki from .coveragerc

* tests and minor changes

* remove location
2017-12-06 09:24:20 +01:00
Paulus Schoutsen
c13b510ba3 Update frontend to 20171206.0 2017-12-05 23:40:31 -08:00
Dan Nixon
5f4baa67dc Allow disabling the LEDs on TP-Link smart plugs (#10980) 2017-12-06 08:38:27 +01:00
Paulus Schoutsen
1db7e2c9d6 Merge branch 'master' into dev 2017-12-05 23:36:08 -08:00
Paulus Schoutsen
fa324dce9c Merge pull request #10990 from home-assistant/release-0-59-2
0.59.2
2017-12-05 22:17:27 -08:00
Paulus Schoutsen
56c694b477 Revert pychromecast update (#10989)
* Revert pychromecast update

* Update cast.py
2017-12-05 22:11:23 -08:00
Craig J. Ward
3f764f1981 Reload closest store on api menu request (#10962)
* reload closest store on api request

* revert change from debugging
2017-12-05 22:11:22 -08:00
William Scanlon
63d6734612 Allow chime to work for wink siren/chime (#10961)
* Allow Wink siren/chimes to work

* Updated requirements_all.txt
2017-12-05 22:11:22 -08:00
Erik Eriksson
f9743c29cd Upgrade tellduslive library version (closes https://github.com/home-assistant/home-assistant/issues/10922) (#10950) 2017-12-05 22:11:22 -08:00
Mateusz Drab
bdb7a29586 Fix linksys_ap.py by inheriting DeviceScanner (#10947)
As per issue #8638, the class wasn't inheriting from DeviceScanner, this commit patches it up.
2017-12-05 22:11:21 -08:00
Andrey
22c36f0ad3 Require FF43 for latest js (#10941)
* Require FF43 for latest js

`Array.prototype.includes` added in Firefox 43

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes

* Update __init__.py
2017-12-05 22:11:20 -08:00
Paulus Schoutsen
fd6373c7aa Version bump to 0.59.2 2017-12-05 22:10:47 -08:00
Andrey
87fe674c70 Require FF43 for latest js (#10941)
* Require FF43 for latest js

`Array.prototype.includes` added in Firefox 43

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes

* Update __init__.py
2017-12-05 22:09:41 -08:00
Paulus Schoutsen
ddec566e10 Revert pychromecast update (#10989)
* Revert pychromecast update

* Update cast.py
2017-12-05 22:08:09 -08:00
William Scanlon
454d8535f8 Allow chime to work for wink siren/chime (#10961)
* Allow Wink siren/chimes to work

* Updated requirements_all.txt
2017-12-05 22:07:59 -08:00
Mitko Masarliev
8e4942088e Add option to set default hide if away for new devices (#10762)
* Option to change hide_if_away

* tests fix

* change new device defaults

* tests and requested changes

* fix assert
2017-12-05 21:56:43 -08:00
Adam Mills
3af527b1b5 Use new build path for dev translations (#10937) 2017-12-05 09:13:09 -05:00
ziotibia81
69d5738e47 Generic thermostat initial_operation_mode (#10690)
* Generic thermostat restore operation mode

* Test restore operation mode

* Fix trailing whitespace

* Fix line too long

* Fix test duplicate entity_id

* Fix test

* async_added_to_hass modify modify internal state

* Test inital_operation_mode

* More restore state tests

* Fix whitespace

* fix test_custom_setup_param

* Test "None" target temp
2017-12-05 15:00:33 +01:00
Menno Blom
379c10985b Add Ziggo Mediabox XL media_player (#10514)
* Add Ziggo Mediabox XL media_player

* Using pypi module ziggo-mediabox-xl now.

* Code review changes
2017-12-05 14:22:27 +01:00
Roman
821cf7135d Gearbest sensor (#10556)
* Added Gearbest Sensor

* Updated required files

* Fixed houndci-bout findings

* Fix tox lint errors

* Changed code according to review
Implemented library version 1.0.5

* Fixed houndci-bot findings

* Fixed tox lint issues

* Updated item schema to use has_at_least_one_key
Added conf constants

* Remove CONF_ constants and import them from homeassistant.const

* Removed CurrencyConverter from hass
Fixed couple of issues found by MartinHjelmare
2017-12-05 12:32:43 +01:00
Craig J. Ward
d986bdab98 Reload closest store on api menu request (#10962)
* reload closest store on api request

* revert change from debugging
2017-12-05 10:47:48 +01:00
Stefan Lehmann
53d9fd18b7 Add ADS component (#10142)
* add ads hub, light and switch

* add binary sensor prototype

* switch: use adsvar for connection

* fix some issues with binary sensor

* fix binary sensor

* fix all platforms

* use latest pyads

* fixed error with multiple binary sensors

* add sensor

* add ads sensor

* clean up after shutdown

* ads component with platforms switch, binary_sensor, light, sensor

add locking

poll sensors at startup

update state of ads switch and light

update ads requirements

remove update() from constructors on ads platforms

omit ads coverage

ads catch read error when polling

* add ads service

* add default settings for use_notify and poll_interval

* fix too long line

* Fix style issues

* no pydocstyle errors

* Send and receive native brightness data to ADS device to prevent issues with math.floor reducing brightness -1 at every switch

* Enable non dimmable lights

* remove setting of self._state in switch

* remove polling

* Revert "remove polling"

This reverts commit 7da420f823.

* add service schema, add links to documentation

* fix naming, cleanup

* re-remove polling

* use async_added_to_hass for setup of callbacks

* fix comment.

* add callbacks for changed values

* use async_add_job for creating device notifications

* set should_poll to False for all platforms

* change should_poll to property

* add service description to services.yaml

* add for brigthness not being None

* put ads component in package

* Remove whitespace

* omit ads package
2017-12-05 09:44:22 +01:00
Mateusz Drab
38a1f06d14 Fix linksys_ap.py by inheriting DeviceScanner (#10947)
As per issue #8638, the class wasn't inheriting from DeviceScanner, this commit patches it up.
2017-12-04 18:58:52 +01:00
Paul Annekov
2e2d0f48fb don't ignore voltage data if sensor data changed (#10925) 2017-12-04 17:26:41 +01:00
Erik Eriksson
4652b8aea1 Upgrade tellduslive library version (closes https://github.com/home-assistant/home-assistant/issues/10922) (#10950) 2017-12-04 17:26:07 +01:00
dasos
ef1cbd3aea Tado ignore invalid devices (#10927)
* Ignore devices without temperatures

* Typo

* Linting

* Removing return false

* Another typo. :(

* Spelling received correctly
2017-12-04 14:55:04 +01:00
drop table USERS; --
31cedf83c7 Export climate status and target temperature to Prometheus (#10919)
* Export climate metrics to Prometheus.

This adds climate_state and temperature_c metrics for each climate
device.

* Add more climate states to state_as_number
2017-12-04 13:39:26 +01:00
Nicolas Bougues
19a97580fc Set percent unit for battery level so that history displays properly; edited variable name for consistency (#10932) 2017-12-04 08:34:42 +01:00
Dan Nixon
17f3cf0389 Report availability of TP-Link smart sockets (#10933)
* Report availability of TP-Link smart sockets

* Changes according to our style guide
2017-12-04 08:33:22 +01:00
Paulus Schoutsen
4e02300cbc Merge remote-tracking branch 'origin/master' into dev 2017-12-03 20:15:34 -08:00
Paulus Schoutsen
015cdd155c Merge pull request #10936 from home-assistant/release-0-59-1
0.59.1
2017-12-03 20:08:04 -08:00
Craig J. Ward
d4e603cc6a Dominos no order fix (#10935)
* check for none

* fix error from no store being set

* typo

* Lint

* fix default as per notes. Lint fix and make closest store None not False

* update default
2017-12-03 19:36:49 -08:00
Paulus Schoutsen
7ae374e11f Update frontend to 20171204.0 (#10934) 2017-12-03 19:36:49 -08:00
Will Boyce
292b403dc3 fix ios component config generation (#10923)
Fixes: #19020
2017-12-03 19:36:49 -08:00
Daniel Perna
b815898ddb Fix Notifications for Android TV (#10798)
* Fixed icon path, added dynamic icon

* Addressing requested changes

* Using DEFAULT_ICON

* Using CONF_ICON from const

* Getting hass_frontend path via import

* Lint

* Using embedded 1px transparent icon

* woof -.-

* Lint
2017-12-03 19:36:48 -08:00
Paulus Schoutsen
b1855f1d1d Version bump to 0.59.1 2017-12-03 19:36:41 -08:00
Craig J. Ward
bd6a17a3a5 Dominos no order fix (#10935)
* check for none

* fix error from no store being set

* typo

* Lint

* fix default as per notes. Lint fix and make closest store None not False

* update default
2017-12-03 19:34:58 -08:00
Paulus Schoutsen
29fad3fa3c Update frontend to 20171204.0 (#10934) 2017-12-03 17:59:58 -08:00
Paulus Schoutsen
0c43466225 Update coveragerc (#10931)
* Sort coveragerc

* Add climate.honeywell and vacuum.xiaomi_miio to coveragerc
2017-12-03 16:42:18 -08:00
Daniel Perna
0d6c95ac44 Fix Notifications for Android TV (#10798)
* Fixed icon path, added dynamic icon

* Addressing requested changes

* Using DEFAULT_ICON

* Using CONF_ICON from const

* Getting hass_frontend path via import

* Lint

* Using embedded 1px transparent icon

* woof -.-

* Lint
2017-12-03 15:08:10 -08:00
Will Boyce
6776e942d7 fix ios component config generation (#10923)
Fixes: #19020
2017-12-03 14:59:22 -08:00
Brent Hughes
879e32f670 Add Min and Event Count Metrics To Prometheus (#10530)
* Added min and Events sensor types to prometheus

* Updated prometheus client and fixed invalid swith state

* Added metric to count number of times an automation is triggered

* Removed assumption that may not apply to everybody

* Fixed tests

* Updated requirements_test_all

* Fixed unit tests
2017-12-03 23:39:54 +01:00
Oliver
3a246df544 Don't repeat getting receiver name on each update / pushed to denonavr 0.5.5 (#10915) 2017-12-03 21:51:32 +01:00
Fabian Affolter
9577525b0b Add Alpha Vantage sensor (#10873)
* Add Alpha Vantage sensor

* Remove data object

* Remove unused vars and change return

* Fix typo
2017-12-03 21:34:59 +01:00
Touliloup
6b410d8076 Correction of Samsung Power OFF behaviour (#10907)
* Correction of Samsung Power OFF behaviour

Addition of a delay after powering OFF a Samsung TV, this avoid status
update from powering the TV back ON.
Deletion of update() return statement, return value not used.

* Rename self._end_of_power_off_command into self._end_of_power_off

* Removal of unused line break in Samsung TV component
2017-12-03 18:34:45 +01:00
Ludovico de Nittis
9e82433a3e Add iAlarm support (#10878)
* Add iAlarm support

* Minor fixes to iAlarm

* Rename ialarmpanel to ialarm and add a check for the host value

* corrections in the value validation of ialarm

* add a missing period on ialarm
2017-12-03 16:48:12 +01:00
Erik Eriksson
8ceaa72ba3 Update eliqonline.py (#10914)
Channel id is now required (change in API)
2017-12-03 16:48:07 +01:00
Fabian Affolter
fce994ea76 Bump dev to 0.60.0.dev0 (#10912) 2017-12-03 16:47:21 +01:00
Nicko van Someren
4390fed168 Unpacking RESTful sensor JSON results into attributes. (#10753)
* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* sensor.envirophat: add missing requirement (#7451)

Adding requirements that is not explicitly pulled in by the library
that manages the Enviro pHAT.

* PyPI Openzwave (#7415)

* Remove default zwave config path

PYOZW now has much more comprehensive default handling for the config
path (in src-lib/libopenzwave/libopenzwave.pyx:getConfig()). It looks in
the same place we were looking, plus _many_ more. It will certainly do a
much better job of finding the config files than we will (and will be
updated as the library is changed, so we don't end up chasing it). The
getConfig() method has been there for a while, but was subsntially
improved recently.

This change simply leaves the config_path as None if it is not
specified, which will trigger the default handling in PYOZW.

* Install python-openzwave from PyPI

As of version 0.4, python-openzwave supports installation from PyPI,
which means we can use our 'normal' dependency management tooling to
install it. Yay.

This uses the default 'embed' build (which goes and downloads
statically sources to avoid having to compile anything locally). Check
out the python-openzwave readme for more details.

* Add python-openzwave deps to .travis.yml

Python OpenZwave require the libudev headers to build. This adds the
libudev-dev package to Travis runs via the 'apt' addon for Travis.

Thanks to @MartinHjelmare for this fix.

* Update docker build for PyPI openzwave

Now that PYOZW can be install from PyPI, the docker image build process
can be simplified to remove the explicit compilation of PYOZW.

* Add datadog component (#7158)

* Add datadog component

* Improve test_invalid_config datadog test

* Use assert_setup_component for test setup

* Fix object type for default KNX port

#7429 describes a TypeError that is raised if the port is omitted in the config for the KNX component (integer is required (got type str)). This commit changes the default port from a string to an integer. I expect this will resolve that issue...

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Fixed breaks cause by manual upstream merge.

* Added one extra blank line to make PyLint happy.

* Switched json_attributes to be a list of keys rather than a boolean.

The value of json_attributes can now be either a comma sepaated list
of key names or a YAML list of key names. Only matching keys in a
retuned JSON dictionary will be mapped to sensor attributes.

Updated test cases to handle json_attributes being a list.

Also fixed two minor issues arrising from manual merge with 0.58 master.

* Added an explicit default value to the json_attributes config entry.

* Removed self.update() from __init__() body.

* Expended unit tests for error cases of json_attributes processing.

* Align quotes
2017-12-03 16:30:25 +01:00
Paolo Bonzini
0f8e48c26d More declarative timeout syntax for manual alarm control panel. (#10738)
More declarative timeout syntax for manual alarm control panel
2017-12-03 13:52:31 +01:00
Fabian Affolter
2d556486bf Merge branch 'master' into dev 2017-12-03 13:28:25 +01:00
Fabian Affolter
850a20a626 Merge pull request #10898 from home-assistant/release-0-59
0.59
2017-12-03 13:24:22 +01:00
John Arild Berentsen
68dc0d4d99 Bugfix #10902 (#10904) 2017-12-03 10:09:44 +01:00
PhracturedBlue
58e66c947b Fix issues from review of ecobee weather component (#10903)
* Fix issues from review

* Don't use STATE_UNKNOWN
2017-12-03 10:09:40 +01:00
John Arild Berentsen
29f47d58bc Bugfix #10902 (#10904) 2017-12-03 00:15:57 +01:00
PhracturedBlue
8947052405 Fix issues from review of ecobee weather component (#10903)
* Fix issues from review

* Don't use STATE_UNKNOWN
2017-12-02 22:44:55 +01:00
raymccarthy
475b7896e2 Pybotvac multi (#10843)
* Update requirements_all.txt

* Update neato.py
2017-12-02 15:44:24 +01:00
PhracturedBlue
b2a2cb3fd8 Update ecobee version to fix stack-trace issue (#10894) 2017-12-02 07:56:35 +02:00
Fabian Affolter
462a438f89 Version bump to 0.59.0 2017-12-02 01:09:43 +01:00
Andrey
4ebc52ab52 Reload groups after saving a change via config API (#10877) 2017-12-01 12:53:46 -08:00
Andrey
8afeef2f36 Serve latest extra_html in dev mode (#10863) 2017-12-01 12:53:15 -08:00
Adam Cooper
c2525782aa Refactored WHOIS sensor to resolve assumed key errors (#10662)
* Refactored WHOIS sensor to resolve assumed key errors

Altered it to now set an attribute key and value only if the attribute
is present in the WHOIS response. This prevents assumed keys (registrar)
from raising a KeyError on WHOIS lookups that don't contain registrar
information (onet.pl, wp.pl, for example).

* Removed non-used self._data

* WHOIS sensor now creates a new local attributes dict and overrides

* Corrected typos, refactored error cases to clear state adn attributes

* Resolved double return and refactored error logging
2017-12-01 11:36:15 -05:00
Pascal Vizeli
bc4de4e769 Fix tests (#10891) 2017-12-01 15:49:56 +01:00
Fabian Affolter
9f324205cb Upgrade yarl to 0.15.0 (#10888) 2017-12-01 13:37:14 +01:00
Fabian Affolter
fff85ab392 Upgrade youtube_dl to 2017.11.26 (#10890) 2017-12-01 12:38:46 +01:00
Jeroen ter Heerdt
29f4b73230 Microsoft Text-to-speech: Fixing missing en-gb support bug (#10429)
* Fixing missing en-gb support bug

* Microsoft TTS adding support for rate, volume, pitch and contour.

* Microsoft TTS fixing support for jp-jp.

* Fixing linting error on line 67

* make impossible things possible 🎉
2017-12-01 12:38:20 +01:00
PhracturedBlue
606fa34792 Create ecobee weather platform (#10869)
* Create ecobee weather component

* Update requirements_all for ecobee

* Fix missed lint issue
2017-12-01 12:30:45 +01:00
Teemu R
7b452208b6 Xiaomi Vacuum: remove deprecated calls (#10839)
* vacuum.xiaomi_miio: read dnd status properly instead of using imprecise dnd flag from vacuum_state

* vacuum.xiaomi_miio: use miio package instead of mirobo

* check only that wanted calls have taken place, ignore order of calls

* Fix linting issues

* Remove empty line after docstring
2017-12-01 12:28:59 +01:00
Fabian Affolter
493de295ac Upgrade schiene to 0.19 (#10887) 2017-12-01 12:26:15 +01:00
Fabian Affolter
d2106c40e1 Upgrade fastdotcom to 0.0.3 (#10886) 2017-12-01 12:25:54 +01:00
Fabian Affolter
9a0a5b7867 Upgrade aiohttp to 2.3.5 (#10889) 2017-12-01 12:22:28 +01:00
Paulus Schoutsen
d8003c4d87 Update frontend to 20171130.0 2017-11-30 20:46:21 -08:00
Pascal Vizeli
f7380dc927 tellstick fix DEPENDENCIES and update tellcore-net (#10859)
* Update requirements_all.txt

* Update tellstick.py

* Fix DEPENDENCIES

* Update requirements_all.txt

* fix format

* fix lint

* fix lint

* Update tellstick.py

* update tellcore-net

* update tellcore-net

* besser validate
2017-11-30 21:13:18 +01:00
Pascal Vizeli
ea6ca9252c Bugfix trigger state with multible entities (#10857)
* Bugfix trigger state with multible entities

* Fix numeric state

* fix lint

* fix dict

* fix unsub

* fix logic

* fix name

* fix new logic

* add test for state

* add numeric state test for unsub

* add test for multible entities

* Update numeric_state.py

* Update numeric_state.py

* Update state.py

* Fix logic for triple match

* Add clear to numeric state

* clear for state trigger
2017-11-30 21:03:52 +01:00
Fabian Affolter
bfc61c268a Upgrade distro to 1.1.0 (#10850) 2017-11-30 15:58:50 +01:00
Julius Mittenzwei
1c227bc0d9 Revert "KNX: Added config option for broadcasting current time to KNX bus. (#10654)" (#10874)
This reverts commit cadd797200.

As discussed within #10708 we should chose a different implementation. Therefore we should revert this change to avoid a breaking change.
2017-11-30 15:52:57 +01:00
Aaron Bach
bb870a688d Updated codeowner for Tile device tracker (#10861) 2017-11-29 19:13:31 +01:00
Fabian Affolter
40a98d56fa Upgrade mutagen to 1.39 (#10851) 2017-11-29 11:04:28 +01:00
Lukas Barth
373508693a Climate component: add supported_features (#10658)
* Implement supported_features for the climate component

* Test supported features

* Convert generic thermostat to supported features

* Max / min temperature are not features

* Fix lint

* Min / max humidity are not features

* Linting

* Remove current temperature / humidity

* Move c-hacker-style constants to boring integers. Booo!

* Refactor all the climate platforms to use the new supported_features

* Force all climate platforms to implement supported_features

* Fix mistakes

* Adapt hive platform

* Move flags into a constant

* Calm the hound
2017-11-29 11:01:28 +01:00
Daniel Perna
59fa4f18e4 Upgrade HomeMatic, add devices (#10845) 2017-11-28 23:16:47 -08:00
Per Osbäck
253d5aea6e add support for multiple execution per execute request (#10844) 2017-11-28 23:16:29 -08:00
Andrey
99ea2c17a1 Add useragent-based detection of JS version (#10776)
* Add useragent-based detection of JS version

* Keep es5 as default meanwhile

* Update test
2017-11-28 22:53:12 -08:00
Erik Eriksson
7ab15c0e79 Tellduslive: Use magic constants for battery level. Also, the previous formula for battery level was wrong. (#10788) 2017-11-28 15:32:36 +01:00
Matt Schmitt
4e4d4365a0 Add device class for low battery (#10829) 2017-11-28 15:25:32 +01:00
Cameron Bulock
1f82bb033d Ecobee set humidity level (#10780)
* Add the ability to set humidity levels on ecobee thermostats

* use the latest version of python-ecobee-api

* Lint fixes
2017-11-28 10:39:30 +01:00
Julius Mittenzwei
cadd797200 KNX: Added config option for broadcasting current time to KNX bus. (#10654) 2017-11-27 23:15:57 -08:00
Fredrik Erlandsson
6df5e712f7 Tellduslive update with support for auto config and Local api (#10435)
* Add support for local api connection found in TellStick Znet Lite/Pro.
Added auto discovery support for all TelldusLive devices,
changed authentication method. Breaking change!
Upgraded tellduslive dependency
Update CODEOWNERS.

* Close any open configurator when configuration done

* Add support for Telldus Local API via config (#2)

* Updated dependency (addresses issue raised by @rasmusbe in https://github.com/home-assistant/home-assistant/pull/10435#issuecomment-344719714)

* Fix requested changes
2017-11-27 23:13:30 -08:00
Zach
282e37ef14 Changing handling for google_assistant groups to treat them as lights. (#10111)
* Fixed aliases warning message

* Fixed test cases

* Changing handling for google_assistant groups to treat them as lights - amending to include user info.

* Enable brightness, RGB, etc for groups in Google Assistant

* Revert color/hue/temp settings

* Change servce from light to homeassistant

* Fixed config_units

* Convert from light to switch

* Change group to switch

* Update tests to switch instead of light for group
2017-11-27 21:43:01 -08:00
Odin Ugedal
0668fba7bd Add support for logarithm in templates (#10824)
* Add support for logarithm in templates

This adds a 'log' filter that takes the logarithm of the given value,
with an optional base number. The base defaults to 'e' - the natural
logarithm

* Remove usage of log10 in template filter 'log'

* Add logarithm as a global

This makes it possible to write:
'{{ log(4, 2) }}'
2017-11-27 21:29:01 -08:00
Dan Ferrante
27270b49b4 upgrade somecomfort to 0.5.0 (#10834)
* upgrading somecomfort to 0.5.0

* upgrade somecomfort to 0.5.0 in requirements files
2017-11-27 21:09:04 -08:00
Andrey
8c5d6ee9c3 Fix for Sensibo with missing temperature (#10801)
* Fix for sensibo woth missing temperature

* Use new temperatureUnit API field
2017-11-27 21:05:43 -08:00
chocomega
934c19445d Fixed Yeelight's color temperature conversion to RGB (#10831) 2017-11-27 20:54:56 -08:00
Stephen Yeargin
72251e0375 Fix "recently pair device" (#10832)
Noticed a minor grammar mistake.
2017-11-27 20:54:18 -08:00
Diogo Gomes
b1e2275b47 Add debug (#10828) 2017-11-27 21:25:00 +01:00
Maciej Sokołowski
af1bde6619 Single LEDs in Blinkt support (#10581)
* Single LEDs in Blinkt support

* Review remarks
2017-11-27 21:14:03 +01:00
Per Osbäck
2daea92379 make RGB values consistent as int. fixes #10766 (#10782)
* make RGB consitant as int. fixes #10766

* fix rounding and only change for hex convertion
2017-11-27 11:31:35 +01:00
zhujisheng
6cd9ca018a Add tts.baidu platform (#10724)
* Add tts.baidu platform

* Update baidu.py

* changed to sync

get_engine and get_tts_audio changed to sync.
2017-11-27 10:13:25 +01:00
Rasmus
eb282b3bb3 Added sensor types from telldus server src (#10787)
Added from https://github.com/telldus/tellstick-server/blob/master/telldus/src/telldus/Device.py
2017-11-27 10:11:00 +01:00
Paulus Schoutsen
fe0a9529ed Cloud cognito switch (#10823)
* Allow email based cognito instance

* Fix quitting Home Assistant while reconnecting

* Lint
2017-11-27 10:09:17 +01:00
Paulus Schoutsen
1b7a64412d Bump frontend to 20171127.0 2017-11-26 17:48:11 -08:00
Fabian Affolter
a187bd5455 Add missing docstring (#10812)
* Add missing docstring

* Revert isort change
2017-11-26 21:12:47 +01:00
Paulus Schoutsen
3e962808e6 Bump frontend to 20171126.0 2017-11-25 21:54:51 -08:00
bcl1713
3d5a9b5e91 Add away_mode_name to arlo alarm control panel (#10796)
* Update arlo.py

Include variables for custom away mode specification

* fixed line too long style problem

* fix trailing white space

* fix sending away mode command
2017-11-26 01:13:14 +01:00
Milan V
ba43218a73 Fix WUnderground error handling, rework entity methods (#10295)
* WUnderground sensor error handling and sensor class rework

* WUnderground error handling, avoid long state, tests

* Wunderground - add handling ValueError exception on parsing

* Changes to address review comments - part 1

* Tests lint

* Changes to address review comments - part 2
2017-11-25 15:19:52 -05:00
Andrey
d8bf15a2f5 system_log improvements (#10709)
* system_log improvements

* Don't use ModuleNotFoundError which is 3.6+

* Don't use FrameSummary which was added in 3.5

* Don't trace stack for exception logs

* Handle test error in Python 3.4
2017-11-25 16:22:41 +02:00
Marcelo Moreira de Mello
dbbbe1ceef Load Ring camera only with Ring Protect plan activated (#10739)
* Added ability to only load Ring camera
if the Ring Protect plan is activated.

* Fixed notification for all invalid cameras

* Fixed attribute name

* Using asyncio for persistent notifications
2017-11-25 12:15:12 +01:00
uchagani
2817f03378 Fixes #10773: Demo Alarm Broken (#10777)
* Fixes #10773: Demo Alarm Broken

* Added test for platform setup

* Remove unused import

* Lint fix

* Rework assert to work with python 3.5
2017-11-24 20:30:57 -08:00
Paulus Schoutsen
fcc164c31e Fix scene description formatting. (#10785) 2017-11-24 15:52:59 -08:00
uchagani
65d5b64d8d Bump total-connect-client version (#10769) 2017-11-25 00:21:31 +01:00
Rendili
f6547ec157 Update CODEOWNERS with hive Component / Platforms (#10775) 2017-11-24 16:31:37 +01:00
Nathan Henrie
61cddaa441 Make shell_command async (#10741)
* Make shell_command async

Use `asyncio.subprocess` instead of `subprocess` to make the
`shell_command` component async.

Was able to migrate over existing component and tests without too many
drastic changes.

Retrieving stdout and stderr paves the way for possibly using these in
future feature enhancements.

* Remove trailing comma

* Fix lint errors

* Try to get rid of syntaxerror

* Ignore spurious pylint error
2017-11-23 17:28:31 -08:00
Bart S
b03c024f74 Fix name collision when using multiple Hue bridges (#10486)
* Fix name collision when using multiple Hue bridges

See https://github.com/home-assistant/home-assistant/issues/9393

* Use new style of string formatting

* Removed creating of "All Hue Lights" group
2017-11-23 17:26:36 -08:00
Craig J. Ward
1a7522a594 Add Dominos Pizza platform (#10379)
* add dominos service

* change require

* dump to log

* component fixes

* clean-up use updated library

* remove unnecessary import

* fix hound errors

* more lint fixes

* Coverage rc

* update requirements

* cleanup as per notes

* missing message

* linting...

* schema validation and reducing requests

* fixlint

* spacing

* unused variable

* fix docstrings

* update req

* notes updates, pypi package, front-end panel

* stale import

* fix constant name

* docstrings

* fix library import

* lint fixes

* pylint bug

* remove built-in panel

* Make synchronous

* unused import and use throttle

* Handle exceptions properly and update client

* Import exceptions properly

* unused import

* remove bloat from start-up, readability fixes from notes, retrieve menu on request, not on startup

* whitespace on blank line
2017-11-23 17:21:24 -08:00
Jan Losinski
d0b9f08bf2 InfluxDB send retry after IOError (#10263)
* Implement data write retry for InfluxDB

This adds an optional max_retries parameter to the InfluxDB component
to specify if and how often the component should try to send the data
if the connection failed due to an IOError.

The sending will be scheduled for a retry in 20 seconds as often as the
user specified. This can be handy for flaky getwork connections between
the DB and Homeassistant or outages like daily DSL reconnects.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Add unittest for influx write retries

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Add RetryOnError as helper decorator in util

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Add unittests for RetryOnError

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Use RetryOnError decorator in InfluxDB

This replaces the scheduling logic in the InfluxDB component with the
RetryOnError decorator from homeassistant.util

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Make the linters happy

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Implement a queue limit for the retry decorator.

This adds a queue limit to the RetryOnError handler. It limits the
number of calls waiting for be retried. If this number is exceeded,
every new call will discard the oldest one in the queue.

* influxdb: Add the retry queue limit option.

* Make the linter happy.

* Make pylint happy

* Log exception of dropped retry

* Move RetryOnError decorator to influxdb component.

* Fix bug in logging usage

* Fix imports

* Add newlines at the end of files.

* Remove blank line

* Remove blank line
2017-11-23 16:58:18 -08:00
Marcelo Moreira de Mello
3dd49b2b95 Protect sensitive information for Amcrest cameras (#10569)
*  Creates a AmcresHub object to protect some private attributes on the logs

* Uses hass.data to pass AmcrestHub to components

* Prefer constants

* Removed serializer since it's using hass.data and simplified camera entity constructor

* small cleanup
2017-11-23 16:38:53 -08:00
braddparker
3ef9c99003 Google assistant climate mode fix (#10726)
* Changed supported climate modes lookup to be case insensitive by forcing to lower-case

* Fixed style errors. (Blank line and line too long)
2017-11-23 12:57:30 -08:00
cgtobi
47183ce02e Temporarily fix yahoo weather API issue and add unit test. (#10737)
* Temporarily fix yahoo weather API issue and add unit test.

* Add test data.
2017-11-23 12:45:56 -08:00
Rendili
f2dea4615f New Hive Component / Platforms (#9804)
* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms

* Changes

* Changes

* Changes

* changes

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Sensor code updates

* Sensor code updates

* Move sensors to binary sensors

* Quack

* Updates - Removed climate related sensors

* sensor fix

* binary_sensor updates

* New Hive Component / Platforms

* New Hive Component / Platforms

* New Hive Component / Platforms
2017-11-23 13:10:23 +01:00
Ted Drain
b4635db5ac Add fan and reduce I/O calls in radiotherm (#10437)
* Added fan support.  Reduced number of calls to the thermostat to a minimum

* Move temp rounding to config schema

* Fixed pep8 errors

* Fix for review comments.

* removed unneeded if block

* Added missing precision attr back

* Fixed pylint errors

* Code review fixes.  Fan support by model number.

* Defined circulate state
2017-11-22 21:59:49 +01:00
Andy Castille
b668b19543 Use new DoorBirdPy (v0.1.0) (#10734)
* Use new DoorBirdPy (v0.1.0)

* Update requirements_all for DoorBirdPy 0.1.0
2017-11-22 11:40:15 +01:00
Lewis Juggins
cfb1853bbd Update pytradfri to 4.1.0 (#10521) 2017-11-22 09:37:20 +00:00
Sven-Hendrik Haase
b784d80973 Add transmission rate (#10740)
* Add transmission rate

* Rename transmission rate attributes to shorter names
2017-11-22 08:39:45 +01:00
Guillaume Rischard
2084ad2164 Optimised images. Saved 80 KB out of 656 KB. 12.3% overall (up to 32.1% per file) (#10735) 2017-11-21 21:19:13 -08:00
Bryan York
9c77f5f5a9 Fix unit conversion for Sensibo A/C units (#10692)
* Fix unit conversion for Sensibo A/C units

When the Sensibo component was released, there was a provision to not convert the temperature units unless "nativeTemperatureUnit" was returned with the API. I'm not sure if the API changed on Sensibo's side, but I do not get this key passed back with API requests.

This causes my current temperature to be returned in CELSIUS instead of FAHRENHEIT.

Removing this fixes it, and I can confirm the units are shown properly now.

* Update adding comment showing temperature is always in C
2017-11-21 20:48:36 +02:00
Otto Winter
8a750eba68 Bump pychromecast to 1.0.2 (#10728)
Fixes home-assistant/home-assistant#9965
2017-11-21 09:04:44 -08:00
bigwoof
5dbd554a10 Adding Queue count sensor (#10723)
Adding another sensor to output the numeber of items in the SABnabd queue.  This is an alternative to displaying filesize, just a preference thing, as it is more meaningfull for me the way I use SABnzdb. 

Note this is my first time coding on github and I have no idea if I am doing things right, I assume that all I needed to do is add a couple of lines to the sensors available and also another line as to what to extract from the SABnzdb API, in this case I have called the sensor "queue_count" and it gets the value from the noofslots_total which as I understand - each slot is a separate download item. 

hope I did this correctly - also I don't have a separate instance of home assistant running for testing so I have no way to test this code (and I don't know how I would switch to the dev channel either).  As I said I am a newb!
2017-11-21 15:35:23 +01:00
Sebastian Muszynski
d0296561f6 python-miio version bumped for improved device support. (#10720) 2017-11-21 09:23:39 +01:00
Paulus Schoutsen
db212cfb00 Fix tests 2017-11-20 22:38:12 -08:00
Paulus Schoutsen
6db5afe597 Update frontend to 20171121.1 2017-11-20 22:00:48 -08:00
Alok Saboo
2ba83655bb Add presence device_class (#10705) 2017-11-20 21:45:00 -08:00
Paulus Schoutsen
6e27e73474 Shopping list: add item HTTP API (#10674)
* Shopping list: add item HTTP API

* Fix order of decorators
2017-11-20 21:44:22 -08:00
Paulus Schoutsen
f0fe8cb2fe Merge branch 'master' into dev 2017-11-20 21:36:30 -08:00
Paulus Schoutsen
3d9f03d4f1 Merge pull request #10716 from home-assistant/release-0-58-1
0.58.1
2017-11-20 21:32:12 -08:00
Egor Tsinko
235707d31c Fix for time_date sensor (#10694)
* fix to time_date sensor

* cleaned up the code and added unit tests

* fixed lint errors
2017-11-20 20:58:28 -08:00
Thibault Cohen
8cb87d5e64 Handle the new version of HydroQuebec website (#10682)
* Handle the new version of HydroQuebec website

* Update requirements_all.txt
2017-11-20 20:58:27 -08:00
Anders Melchiorsen
4cb0e4b3c2 Properly initialize Harmony remote (#10665)
The delay_secs variable was not initialized if discovery was active and no
matching configuration block existed (i.e. override was None).
2017-11-20 20:58:27 -08:00
Lukas Barth
2ba5f1f45e Fix yweather (#10661) 2017-11-20 20:58:26 -08:00
Paulus Schoutsen
d7f9be9640 Version bump to 0.58.1 2017-11-20 20:50:12 -08:00
Paulus Schoutsen
34f06e8eef Bump frontend to 20171121.0 2017-11-20 20:49:58 -08:00
Paulus Schoutsen
efd45549e4 Bump frontend to 20171121.0 2017-11-20 20:48:52 -08:00
Paulus Schoutsen
34a4db57db Fix conversation (#10686)
* Fix conversation

* Lint
2017-11-20 20:26:36 -08:00
uchagani
e62ef067cc Add Arm Custom Bypass to alarm_control_panel (#10697) 2017-11-20 18:34:21 +01:00
Thibault Cohen
df37cb11fa Handle the new version of HydroQuebec website (#10682)
* Handle the new version of HydroQuebec website

* Update requirements_all.txt
2017-11-20 18:02:05 +01:00
Paulus Schoutsen
857d6b5b49 index.html improvements (#10696) 2017-11-20 15:16:36 +01:00
Paulus Schoutsen
62a740ba22 Convert configurator to use markdown (#10668) 2017-11-20 14:11:55 +01:00
Markus Nigbur
a83e741dc7 Refactored to new global json saving and loading (#10677)
* Refactored to new global json saving and loading

* Fixed emulated_hue tests

* Removed unnecassary error handling

* Added missing newline

* Remove unused imports

* Fixed linting error

* Moved _load_json wrapper out of the config class
2017-11-19 19:47:55 -08:00
Egor Tsinko
7695ca2c8b Fix for time_date sensor (#10694)
* fix to time_date sensor

* cleaned up the code and added unit tests

* fixed lint errors
2017-11-19 19:41:30 -08:00
Paulus Schoutsen
3f5c748560 Reorganize lint travis builds (#10670)
* tox cleanup

* 1 tox step

* Revert pytest sugar changes

* Tox: make pylint its own task

* Bump Travis to 30 minutes timeout
2017-11-19 17:39:24 -08:00
PeteBa
fb32cc39e1 Populate measurement state field for HA states like home/not_home (#9833) 2017-11-19 23:49:49 +01:00
Philip Kleimeyer
b548116f9b Tahoma platform for Somfy Covers and Sensors (#10652)
Tahoma platform for Somfy Covers and Sensors
2017-11-19 21:35:13 +01:00
PeteBa
2031b2803f Include unit_of_measurement as InfluxDb field (#9790) 2017-11-19 21:30:47 +01:00
Fabian Affolter
50775ce509 Bump dev to 0.59.0.dev0 (#10675) 2017-11-19 14:37:07 +01:00
Anders Melchiorsen
709df1e844 Properly initialize Harmony remote (#10665)
The delay_secs variable was not initialized if discovery was active and no
matching configuration block existed (i.e. override was None).
2017-11-19 05:20:31 +01:00
Giel Janssens
09d826edf4 Netatmo httperror403 fix (#10659)
* Update lnetatmo

* updated zip

* updated zip
2017-11-18 14:36:01 -08:00
Lukas Barth
086f64b06c Fix yweather (#10661) 2017-11-18 14:33:18 -08:00
frittes
6ad62a2ccb Added cycles config option to LaMetric notifications (#10656)
* Added cycles config option to lametric.py

Added cycles config option, changed display_time to lifetime, code cleanup

* Update lametric.py

* Update lametric.py
2017-11-18 21:12:16 +01:00
Charles Garwood
92fe9aadc8 Change some warnings to info (#10386) 2017-11-18 20:04:09 +01:00
Derek Brooks
a9feafd571 add nuheat to coverage reports 2017-11-18 10:26:36 -06:00
Paulus Schoutsen
d9a6d9ee73 Merge pull request #10630 from home-assistant/release-0-58
0.58
2017-11-17 22:27:35 -08:00
Robbie Trencheny
425c027085 Implement entity and domain exclude/include for Alexa (#10647)
* Implement entity and domain exclude/include for Alexa

* Switch to using generate_filter

* Use proper domain for turn on/off calls except for groups where we must use the generic homeassistant.turn_on/off

* travis fixes

* Untangle

* Lint
2017-11-17 22:00:11 -08:00
Pierre Ståhl
35699273da Bump pyatv to 0.3.8 (#10643)
Fixes AirPlay issues on newer versions of tvOS.
2017-11-17 22:00:11 -08:00
Andrey
b86110a15d Print entity type in "too slow" warnings (#10641)
* Update entity.py

* Update entity.py
2017-11-17 22:00:10 -08:00
Robbie Trencheny
e449ceeeff Alexa improvements (#10632)
* Initial scene support

* Initial fan support

* ordering

* Initial lock support

* Scenes cant be deactivated; Correct the scene display category

* Initial input_boolean support

* Support customization of Alexa discovered entities

* Initial media player support

* Add input_boolean to tests

* Add play/pause/stop/next/previous to media player

* Add missing functions and pylint

* Set manufacturerName to Home Assistant since the value is displayed in app

* Add scene test

* Add fan tests

* Add lock test

* Fix volume logic

* Add volume tests

* settup -> setup

* Remove unused variable

* Set required scene description as per docs

* Allow setting scene category (ACTIVITY_TRIGGER/SCENE_TRIGGER)

* Add alert, automation and group support/tests

* Change display categories to match docs

* simplify down the display category props into a single prop which can be used on any entity

* Fix tests to expect proper display categories

* Add cover support

* sort things

* Use generic homeassistant domain for turn on/off
2017-11-17 22:00:10 -08:00
Cezar Sá Espinola
bf8e2bd77e Make MQTT reconnection logic more resilient and fix race condition (#10133) 2017-11-17 22:00:10 -08:00
Aaron Bach
0202e966ea Fixes AirVisual bug regarding incorrect location data (#10054)
* Fixes AirVisual bug regarding incorrect location data

* Owner-requested changes
2017-11-17 22:00:09 -08:00
Derek Brooks
e1d1cf76ca Add Facebook Notification tests (#10642)
* test the facebook notification component

* respond to hound feedback

* remove unnecessary line breaks

* parse_qs not needed with requests_mock

* remove facebook notifier from .coveragerc
2017-11-17 21:12:36 -08:00
Robbie Trencheny
1317297191 Implement entity and domain exclude/include for Alexa (#10647)
* Implement entity and domain exclude/include for Alexa

* Switch to using generate_filter

* Use proper domain for turn on/off calls except for groups where we must use the generic homeassistant.turn_on/off

* travis fixes

* Untangle

* Lint
2017-11-17 21:10:24 -08:00
Paulus Schoutsen
b3d66e5881 Update frontend to 20171118.0 2017-11-17 19:09:47 -08:00
Pierre Ståhl
64a393b377 Bump pyatv to 0.3.8 (#10643)
Fixes AirPlay issues on newer versions of tvOS.
2017-11-18 00:00:15 +01:00
Aaron Bach
3ad64b0a66 Fixes AirVisual bug regarding incorrect location data (#10054)
* Fixes AirVisual bug regarding incorrect location data

* Owner-requested changes
2017-11-17 21:11:05 +01:00
William Scanlon
2664ca498e Support for Unifi direct access device tracker (No unifi controller software) (#10097) 2017-11-17 14:47:40 -05:00
Giel Janssens
5b44e83c0f Update lnetatmo (#10631) 2017-11-17 10:31:08 -08:00
Cezar Sá Espinola
b8b4e32758 Make MQTT reconnection logic more resilient and fix race condition (#10133) 2017-11-17 10:29:23 -08:00
Robbie Trencheny
2b60fca08d Alexa improvements (#10632)
* Initial scene support

* Initial fan support

* ordering

* Initial lock support

* Scenes cant be deactivated; Correct the scene display category

* Initial input_boolean support

* Support customization of Alexa discovered entities

* Initial media player support

* Add input_boolean to tests

* Add play/pause/stop/next/previous to media player

* Add missing functions and pylint

* Set manufacturerName to Home Assistant since the value is displayed in app

* Add scene test

* Add fan tests

* Add lock test

* Fix volume logic

* Add volume tests

* settup -> setup

* Remove unused variable

* Set required scene description as per docs

* Allow setting scene category (ACTIVITY_TRIGGER/SCENE_TRIGGER)

* Add alert, automation and group support/tests

* Change display categories to match docs

* simplify down the display category props into a single prop which can be used on any entity

* Fix tests to expect proper display categories

* Add cover support

* sort things

* Use generic homeassistant domain for turn on/off
2017-11-17 09:14:22 -08:00
Andrey
f43092c563 Print entity type in "too slow" warnings (#10641)
* Update entity.py

* Update entity.py
2017-11-17 17:36:18 +01:00
Lukas Barth
68d2076b56 Restore target temperature for generic thermostat (#10635)
* Restore target temp for generic thermostat

* Fix lint
2017-11-17 17:32:58 +01:00
cgtobi
be5f0fb3ac Add hddtemp sensor device even if unreachable. (#10623)
* Add hddtemp sensor device even if unreachable.

* Removed old commented code.

* Move unit detection logic into update.
2017-11-17 09:21:27 -05:00
Milan V
e9b691173a Change generic thermostat - any toggle device as heater switch (#10597)
* Change generic thermostat - any toggle device as heater

* Heater switch state method

* Tests

* Debug log, lint

* Debug code remove, cleanup

* Change generic thermostat to control heating on mode change Off -> Auto

* Fix typo

* Review fixes, tests

* Merge and fix tests
2017-11-17 12:47:54 +01:00
Alok Saboo
2a77883146 Added unit_of_measurement to Currencylayer (#10598)
* Added unit_of_measurement to Currencylayer

* Updated based on comments

* Remove quote from name
2017-11-17 08:58:46 +01:00
Paulus Schoutsen
eb8a8f6d0b Version bump to 0.58.0 2017-11-16 22:10:40 -08:00
Paulus Schoutsen
62c8843956 Update frontend to 20171117.1 2017-11-16 22:08:19 -08:00
John Arild Berentsen
1bb37aff0c Add loglinefetch for frontend API call (#10579)
* Add loglinefetch for frontend API call

* Too many blank lines

* Review changes

* review changes

* Only return a text

* Use aiohttp

* Don't do I/O in event loop

* Move lines to query and default to 0

* Small fixes
2017-11-16 22:07:08 -08:00
Egor Tsinko
f052a0926b Added sorted() to python_script (#10621)
* added sorted() to python_script

* fixed lint errors
2017-11-16 22:06:02 -08:00
Anders Melchiorsen
24aeea5ca3 Adjust logging in downloader component (#10622) 2017-11-16 22:05:08 -08:00
Paulus Schoutsen
5c20cc32b5 Update frontend to 20171117.0 2017-11-16 22:03:31 -08:00
Corey Pauley
6cf2e758a8 Alexa slot synonym fix (#10614)
* Added logic to the alexa component for handling slot synonyms

* Moved note with long url to the top of the file

* Just made a tiny url instead of messing with Flake8

* Refactored to be more Pythonic

* Put trailing comma back
2017-11-16 21:09:00 -08:00
Adam Mills
aa6b37912a Fix async missing decorators (#10628) 2017-11-16 21:03:05 -08:00
Jan Losinski
693d32fa68 Snapcast: bump version and enable reconnect. (#10626)
This bumps the used snapcast version to 2.0.8 and enables the new
reconnect feature that causes the component to reconnect to a server if
the connection was lost.

This fixes the ned to restart Home Assstant after a snapcast reboot, as
described in issue #10264.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
2017-11-16 20:32:26 -05:00
Andrey
072ed7ea13 Allow to pass YandexTTS options via sevice call (#10578) 2017-11-16 09:10:25 -08:00
Mitko Masarliev
bd5a16d70b update hbmqtt to 0.9.1 (#10611) 2017-11-16 07:47:37 -08:00
Milan V
eb7643e163 Improve WUnderground config validation (#10573)
* Fix WUnderground config validation

* Fix indentation
2017-11-16 10:26:23 -05:00
Milan V
79ca93f892 Change generic thermostat to control heating on mode change Off -> Auto (#10601)
* Change generic thermostat to control heating on mode change Off -> Auto

* Fix typo
2017-11-16 13:11:46 +01:00
Colin Dunn
3dbae5ca5b Correct input_datetime initial value parsing (#10417)
* Correct input_datetime initial value parsing

* Correct input_datetime initial value parsing
2017-11-15 23:16:22 -08:00
Pascal Vizeli
1719fa7008 Cleanup old stale restore feature (#10593)
* Cleanup old stale restore feature

* cleanup

* Update __init__.py

* Update test_demo.py

* Lint
2017-11-15 23:03:41 -08:00
Per Osbäck
d4bd4c114b add support for color temperature and color to Google Assistant (#10039)
* add support for color temperature and color; also add some extra deviceInfo attributes

* change so that default behaviour doesn't turn off device if the action isn't handled

* add tests

* fix lint

* more lint

* use attributes were applicable

* removed debug logging

* fix unassigned if only None returned

* report more data in QUERY

* better tests for color and temperature

* fixes after dev merge

* remove deviceInfo as not part of a device state (PR #10399)

* fix after merge
2017-11-15 23:00:43 -08:00
boltgolt
f494c32866 Small fix to be able to use mac and vendor in "device_tracker_new_device" event. (#10537)
* Small fix to be able to use mac and vendor in EVENT_NEW_DEVICE event

* Missed device_tracker test
2017-11-15 22:41:39 -08:00
Fabian Affolter
e20fd3b973 Upgrade mypy to 0.550 (#10591) 2017-11-15 22:35:18 -08:00
ziotibia81
270846c2f5 Modbus switch register support (#10563)
* Update modbus.py

* Fix blank linea and whitespaces

* Fix visual indent

* Fix visual indent

* fix multiple statements on one line

* Typo

* Disable pylint check

# pylint: disable=super-init-not-called

* Fix code style
2017-11-15 22:17:10 -08:00
Fabrizio Furnari
b2ab4443a7 New sensor viaggiatreno. (#10522)
* New sensor viaggiatreno.

I've messed up the previous PR so here it is in a new one.
Should include also all corrections from @pvizeli

* fixes from PR 10522

* fixed import order

* requested changes from MartinHjelmare
2017-11-15 22:07:16 -08:00
Craig J. Ward
17cd64966d bump client version (#10610) 2017-11-15 22:04:26 -08:00
Michael Chang
48181a9388 Support script execution for Alexa (#10517)
* Support script execution for Alexa

* Use PowerController for the script component
2017-11-15 21:44:27 -08:00
Andrey
d5cba0b716 Allow unicode when dumping yaml (#10607) 2017-11-15 18:24:08 -08:00
Alok Saboo
3a0c749a12 Fix Hikvision (motion) switch bug (#10608)
* Fix Hikvision switch bug

* Added comment about last working version
2017-11-16 01:15:45 +01:00
ziotibia81
d652d793f3 Fix ValueError exception (#10596)
* Fix ValueError exception

structure = '>{:c}'.format(data_types[register.get(CONF_DATA_TYPE)][register.get(CONF_COUNT)])
give:
ValueError: Unknown format code 'c' for object of type 'str'

* Minor typo
2017-11-15 18:17:17 -05:00
Pierre Ståhl
87995ad62c Do not add panel from system_log (#10600)
The frontend will not have this panel.
2017-11-15 23:45:08 +01:00
Jeremy Williams
c2d0c8fba4 Arlo - Fixes for updated library (#9892)
* Reduce update calls to API. Add signal strength monitor.

* Fix lint errors

* Fix indent

* Update pyarlo version and review fixes

* Fix lint errors

* Remove staticmethod

* Clean up attributes

* Update arlo.py
2017-11-15 23:33:50 +01:00
On Freund
c7b0f25eae Fix Yahoo Weather icons over SSL (#10602) 2017-11-15 22:27:26 +02:00
Fabian Affolter
d5b170f761 Upgrade youtube_dl to 2017.11.15 (#10592) 2017-11-15 12:41:25 +01:00
Paulus Schoutsen
ea7ffff0ca Cloud updates (#10567)
* Update cloud

* Fix tests

* Lint
2017-11-15 08:16:19 +01:00
Paulus Schoutsen
0cd3271dfa Update frontend to 20171115.0 2017-11-14 22:48:31 -08:00
Paulus Schoutsen
7920ddda9d Add panel build type (#10589) 2017-11-14 22:39:06 -08:00
NovapaX
1e493dcb8a Tradfri unique identities (#10414)
* Unique identity
Use unique ID for generating keys and store them in config. Fallback to
old id so existing installs will still work.

* Remove Timeouts
they don't really work. this should be fixed in pytradfri I think.

* import uuid only when necessary

* more selective import

* lint

* use load_json and save_json from util.json

* remove unnecessary imports

* use async configurator functions

* async configurator calls

* thou shalt not mixup the (a)syncs

* again: no asyncs in the syncs!
last warning...

* Update tradfri.py
2017-11-14 22:16:21 -08:00
Pierre Ståhl
8111e3944c Add basic backend support for a system log (#10492)
Everything logged with "warning" or "error" is stored and exposed via
the HTTP API, that can be used by the frontend.
2017-11-14 20:35:56 -08:00
NovapaX
8d91de877a turn service call handler into coroutine (#10576) 2017-11-14 20:32:48 -08:00
Eitan Mosenkis
0b4de54725 Google Assistant for climate entities: Support QUERY and respect system-wide unit_system setting. (#10346) 2017-11-14 20:19:42 -08:00
marthoc
309e493e76 Add code to enable discovery for mqtt cover (#10580)
* Add code to enable discovery for mqtt cover

* Fix pylint error
2017-11-14 20:19:15 -08:00
Marcelo Moreira de Mello
95c831d5bc Bump ring_doorbell to 0.1.7 (#10566) 2017-11-14 15:56:42 +01:00
Andreas Björshammar
061253fded Verisure: Added option to set installation giid (#10504)
* Added option to set installation giid

* Changed where giid config var is being checked

* Style fix

* Fix style
2017-11-14 15:53:26 +01:00
Eugenio Panadero
e947e6a143 Use a template for the Universal media player state (#10395)
* Implementation of `state_template` for the Universal media_player

* add tracking to entities in state template

* use normal config_validation

* fix tests, use defaults in platform schema, remove extra keys

* and test the new option `state_template`

* lint fixes

* no need to check attributes against None

* use `async_added_to_hass` and call `async_track_state_change` from `hass.helpers`
2017-11-14 11:41:19 +01:00
Martin Hjelmare
dc6e50c39d Fix lametric sound (#10562)
* Fix sound for lametric notify

* Remove not used method
2017-11-14 10:40:44 +01:00
Abílio Costa
637b058a7e webostv: Reduce default timeout to prevent log spamming (#10564)
With the default timeout of 10 seconds, the log gets filled up with "component is taking more than 10 seconds" errors.
This should probably be fixed in some other way, but for now this reduces the problem a bit.
2017-11-14 10:37:52 +01:00
Fabian Affolter
d25f676711 Move temperature display helper from components to helpers (#10555) 2017-11-14 10:36:18 +01:00
Steve Edson
b1afed9e52 pad packets to multiple of 4 characters (#10560)
* pad packets to multiple of 4 characters

This fixes sending commands, see #7669

* Update broadlink.py

* removed whitespace
2017-11-14 09:18:06 +01:00
Kenny Millington
7c24d77031 Don't use the 'id' field since it can be autogenerated (fixes #10551). (#10554) 2017-11-13 22:46:26 -08:00
Derek Brooks
a3c6211c04 python 3.5 seems to not like assert_called_once() 2017-11-13 23:20:16 -06:00
Derek Brooks
afcb0b8767 fix up some docstrings 2017-11-13 23:13:04 -06:00
Derek Brooks
c0c439c549 that int() casting was redundant 2017-11-13 22:45:29 -06:00
Derek Brooks
959f6386b4 shorten that long line 2017-11-13 22:43:11 -06:00
Derek Brooks
f1fe8e95ba clean up a couple away temperature settings 2017-11-13 22:40:18 -06:00
ziotibia81
e33451e2b9 Better support for int types (#10409)
* Better int types support

* type

* Added optional register order

* Fix white spaces

* Fix line length

* Fix line too long

* Fix trailing whitespace

* Stylistc code fixes
2017-11-13 23:27:15 +01:00
Ari Lotter
2dcde12d38 Support presence detection using Hitron Coda router (#9682)
* Support presence detection using Hitron Coda router

* at least 2 spaces before inline comment

* Update hitron_coda.py

* rewrote authentication code, it actually works now

* make line slightly shorter to comply with hound

* Removed hardcoded IP address

* Fix string formatting, add timeout, and use generator

* Update hitron_coda.py

* Update hitron_coda.py

* Update hitron_coda.py

* typo

* update .coveragerc

* Update stale URL
2017-11-13 23:10:39 +01:00
Martin Hjelmare
3c135deec8 Fix and clean lametric (#10391)
* Fix and clean lametric

* Add missing DEPENDENCIES in notify platform.
* Remove not needed method in component manager class.
* Don't overwrite notify DOMAIN.
* Return consistently depending on found devices in setup of component.

* Get new token if token expired

* Add debug log for getting new token

* Clean up
2017-11-13 21:12:15 +01:00
Derek Brooks
6892033556 remove that unused constant 2017-11-13 12:31:15 -06:00
Derek Brooks
766893253a make sure is_away_mode_on supports user-defined minimum away temps 2017-11-13 12:28:09 -06:00
Derek Brooks
ef5edb95ba Update home/auto hold mode to be consistent with current documentation 2017-11-13 11:38:08 -06:00
Fabian Affolter
6974f2366d Upgrade pysnmp to 4.4.2 (#10539) 2017-11-13 09:24:07 -08:00
Ruslan Sayfutdinov
a6d9c7a621 webostv: set current source correctly (#10548) 2017-11-13 09:23:42 -08:00
Anders Melchiorsen
46fe9ed200 Optimize concurrent access to media player image cache (#10345)
We now do locking to ensure that an image is only downloaded and added
once, even when requested by multiple media players at the same time.
2017-11-13 09:03:12 -08:00
Derek Brooks
f21b9988e9 allow for the configuring of a minimum away temperature 2017-11-13 11:00:33 -06:00
Derek Brooks
7859b76429 kill target_temperature_low and high. They don't make sense here 2017-11-13 10:35:48 -06:00
r4nd0mbr1ck
f6d511ac1a Google Assistant request sync service (#10165)
* Initial commit for request_sync functionality

* Fixes for Tox results

* Fixed all tox issues and tested locally with GA

* Review comments - api_key, conditional read descriptions

* Add test for service
2017-11-13 08:32:23 -08:00
Diogo Gomes
bc23799c71 Change to device state attributes (#10536)
* Following the suggestion of @MartinHjelmare
2017-11-12 15:25:44 +01:00
Per Osbäck
59e943b3c1 notify.html5: use new json save and load functions (#10416)
* update to use new save_json and load_json

* it is no longer possible to determine if the json file contains valid or empty data.

* fix lint
2017-11-11 15:57:11 -08:00
Paulus Schoutsen
c8648fbfb8 Pre-construct frontend index.html (#10520)
* Pre-construct frontend index.html

* Cache templates

* Update frontend to 20171111.0

* Fix iframe panel test
2017-11-11 15:22:05 -08:00
Vignesh Venkat
96e7944fa8 telegram_bot: Support for sending videos (#10470)
* telegram_bot: Support for sending videos

Telegram python library has a sendVideo function that can be used
similar to sending photos and documents.

* fix lint issue

* fix grammar
2017-11-12 00:13:35 +01:00
Derek Brooks
2c44e4fb12 address initial houndbot suggestions 2017-11-11 16:47:12 -06:00
Derek Brooks
9b373901fa add documentation links 2017-11-11 16:31:35 -06:00
Derek Brooks
37be81c20c add ability to resume program... and add in a forgotten test 2017-11-11 16:21:14 -06:00
Aaron Bach
79001fc361 Adds support for Tile® Bluetooth trackers (#10478)
* Initial work in place

* Added new attributes + client UUID storage

* Wrapped up

* Collaborator-requested changes
2017-11-11 23:21:03 +01:00
Paulus Schoutsen
2310b791f9 Merge branch 'master' into dev 2017-11-11 13:04:55 -08:00
Paulus Schoutsen
d814d40330 Merge pull request #10534 from home-assistant/release-0-57-3
0.57.3
2017-11-11 13:00:19 -08:00
William Scanlon
b6e098d1c2 Fixed Wink Quirky Aros bugs. (#10533)
* Fixed Wink Quirky Aros bugs.
2017-11-11 15:49:20 -05:00
Martin Berg
db56748d88 Add attribute to show who last un/set alarm (SPC) (#9906)
* Add attribute to show who last un/set alarm.

This allows showing the name of the SPC user who last
issued an arm/disarm command and also allows for
automations to depend on this value.

* Optimize

* Update spc.py

* Update spc.py

* fix

* Fix test.

* Fix for removed is_state_attr.
2017-11-11 12:36:03 -08:00
Kane610
68fb995c63 Update axis.py (#10412) 2017-11-11 12:30:18 -08:00
Andrey
4420f11d9d Fix import in tests (#10525) 2017-11-11 22:24:43 +02:00
Erik Eriksson
75836affbe Support configuration of region (no service url neccessary (#10513) 2017-11-11 12:21:25 -08:00
Lukas Barth
b284cc54df Pin yarl (#10528)
* Pin yarl

* Update requirements
2017-11-11 12:15:13 -08:00
Paulus Schoutsen
547e089185 Version bump to 0.57.3 2017-11-11 12:14:28 -08:00
Marcelo Moreira de Mello
fe2e0c44c8 Fixed update() method and removed ding feature from stickupcams/floodlight (#10428)
* Simplified URL expiration calculation and fixed refresh method

* Remove support from Ring from StickupCams or floodlight cameras

* Makes lint happy

* Removed unecessary attributes
2017-11-11 12:12:58 -08:00
Stefan Jonasson
30bd92c851 Tellstick Duo acync callback fix (#10384)
* Reverted commit 1c8f179690. This fixes issue: #10329

* convert callback to async

* fix lint

* cleanup

* cleanup

* cleanups

* optimize initial handling

* Update tellstick.py

* Update tellstick.py

* fix lint

* fix lint

* Update tellstick.py

* Fixed code errors and lint problems.

* fix bug

* Reduce logic, migrate to dispatcher

* Update tellstick.py

* Update tellstick.py

* fix lint

* fix lint
2017-11-11 12:12:57 -08:00
Paulus Schoutsen
78afbd4292 Pin YARL to 0.13 2017-11-11 12:12:31 -08:00
Hmmbob
f3a90d6994 Update nederlandse_spoorwegen.py to include platform information (#10494)
* Update nederlandse_spoorwegen.py

Make departure and arrival platforms available as state attributes

* Update nederlandse_spoorwegen.py

* Update nederlandse_spoorwegen.py
2017-11-11 11:51:26 -08:00
Lukas Barth
44506ce15f Adapt to new yarl API (#10527) 2017-11-11 08:36:37 -08:00
Derek Brooks
5fe2db228c bug fixes and linting 2017-11-11 10:18:32 -06:00
Andrey
5e92fa3404 Add an option to serve ES6 JS to clients (#10474)
* Add an option to serve ES6 JS to clients

* Rename es6 to latest

* Fixes

* Serve JS vrsions from separate dirs

* Revert websocket API change

* Update frontend to 20171110.0

* websocket: move request to constructor
2017-11-10 23:02:06 -08:00
Derek Brooks
c91d52a587 first stab at the nuheat components 2017-11-11 00:22:37 -06:00
Jan Almeroth
1c36e2f586 Introduce media progress for Yamaha Musiccast devices (#10256)
* Introduce update_hass()

* Introduce media_positions

* Version bump pymusiccast

* Fix: Unnecessary "else" after "return"

* FIX D400: First line should end with a period

* Version bump

Fixes https://github.com/home-assistant/home-assistant/issues/10411
2017-11-10 23:41:02 +01:00
Kenny Millington
16dd90ac78 Add support for Alexa intent slot synonyms. (#10469) 2017-11-10 09:35:57 -08:00
Eric Hagan
7d9d299d5a OwnTracks Message Handling (#10489)
* Improve handling and logging of unsupported owntracks message types

Added generic handlers for message types that are valid but not
supported by the HA component (lwt, beacon, etc.) and for
message types which are invalid. Valid but not supported
messages will now be logged as DEBUG. Invalid messages will
be logged as WARNING.

Supporting single "waypoint" messages in addition to the
roll-up "waypoints" messages.

Added tests around these features.

* Style fixes
2017-11-10 09:29:21 -08:00
Fabian Affolter
0490ca67d1 Bump dev to 0.58.0.dev0 (#10510) 2017-11-10 09:25:31 -08:00
Matthew Donoughe
e7dc96397c upgrade to new pylutron_caseta with TLS (#10286)
* upgrade to new pylutron with TLS

* rename configuration options

* change more methods to coroutines

* use async_add_devices
2017-11-10 12:17:25 +01:00
Diogo Gomes
9bfdff0be1 add JSON processing capabilities to sensor_serial (#10476)
* add JSON processing capabilities

* format fixes

* format fixes

* Fix according to @fabaff comment

* reverting last commit to a more sane approach

* docstring...

* still docstring...

* passed script/lint

* downgrade exception

JSONDecodeError was only introduced in Python3.5

Since we are still supporting 3.4 ValueError is the parent class of
JSONDecodeError
2017-11-10 10:49:30 +01:00
sander76
143d9492b2 Fix for telegram polling. (added pausing when error occurs) (#10214)
* Fix for telegram polling. (added pausing when error occurs)

* fix pylint error.
invalid variable name ( Exception as _e)). Don't understand why as
removing the underscore fails with my local pylint..

* fixing too short variable name.

* moved logic to `check_incoming`

* fix line too long error.

* Simplify
2017-11-09 21:17:23 +01:00
Fabian Affolter
8e1a73dd0f Upgrade youtube_dl to 2017.11.06 (#10491) 2017-11-09 20:18:29 +01:00
Fabian Affolter
8878eccb7b Upgrade psutil to 5.4.1 (#10490) 2017-11-09 20:17:31 +01:00
cgtobi
37eae7fb8a Improve error handling. (#10482)
* Improve error handling.

* Fix import of core requirements.

* cleanup
2017-11-09 20:17:01 +01:00
Anders Melchiorsen
dd16b7cac3 Remove lag from Harmony remote platform (#10218)
* Simplify kwargs handling

* Move Harmony remote to a persistent connection with push feedback

* Make default delay_secs configurable on the harmony platform

* Remove lint

* Fix delay_secs with discovery

* Temporary location for updated pyharmony

* Remove lint

* Update pyharmony to 1.0.17

* Remove lint

* Return an Optional marker

* Update pyharmony to 1.0.18
2017-11-09 17:57:41 +01:00
David Grant
68986e9143 Updated gc100 package requirement to 1.0.3a (#10484)
* Updated gc100 package requirement to 1.0.3a

* Update requirements_all.txt
2017-11-09 17:54:45 +01:00
Stefan Jonasson
62c1b542ed Tellstick Duo acync callback fix (#10384)
* Reverted commit 1c8f179690. This fixes issue: #10329

* convert callback to async

* fix lint

* cleanup

* cleanup

* cleanups

* optimize initial handling

* Update tellstick.py

* Update tellstick.py

* fix lint

* fix lint

* Update tellstick.py

* Fixed code errors and lint problems.

* fix bug

* Reduce logic, migrate to dispatcher

* Update tellstick.py

* Update tellstick.py

* fix lint

* fix lint
2017-11-09 15:03:35 +01:00
Julius Mittenzwei
ee265394a6 Improvement of KNX climate component (#10388)
* Added myself to codeowners

* Improved climate support with setpoint shift for KNX. (https://github.com/XKNX/xknx/issues/48)

* requirements_all.txt

* typo

* flake

* Changes requested by @pvizeli
2017-11-09 11:49:19 +01:00
TopdRob
9297a9cbb4 Upgrade apns2 to 0.3.0 (#10347) 2017-11-08 21:09:19 -08:00
Marcelo Moreira de Mello
2118ab2503 Fixed update() method and removed ding feature from stickupcams/floodlight (#10428)
* Simplified URL expiration calculation and fixed refresh method

* Remove support from Ring from StickupCams or floodlight cameras

* Makes lint happy

* Removed unecessary attributes
2017-11-09 01:01:20 +01:00
Pascal Vizeli
2fff065b2c Remove useless temp converting (#10465) 2017-11-09 00:46:33 +01:00
TopdRob
ed9abe3fa2 Upgrade pyatv to 0.3.6 (#10349)
Fix string conversion for idle state
2017-11-08 16:13:05 +01:00
TopdRob
f5ea7d3c9c Upgrade to 0.1.2 (#10348)
Fix an insecure request warning when not using verify=True. Contributed by @nalepae
2017-11-08 16:11:12 +01:00
Matt White
148a7ddda9 Add include/exclude filter to mqtt_statestream (#10354)
* Add publish filter to mqtt_statestream

* Add tests for include/excludes in mqtt_statestream
2017-11-08 15:54:12 +01:00
Milan V
2f0920e4fb Fix recorder stop on SQLite vacuuming error (#10405)
* Fix recorder stop on SQLite vacuuming error

* Move import to function
2017-11-08 14:43:15 +01:00
Paulus Schoutsen
2e5b1e76ef Fix slow WOL switch test (#10455) 2017-11-08 12:38:17 +01:00
Per Osbäck
db8510f110 update pywebpush==1.3.0 (#10374) 2017-11-08 12:02:28 +01:00
Daniel Høyer Iversen
e49278cc7d update tibber library (#10460) 2017-11-08 11:18:35 +01:00
Paulus Schoutsen
50f6790a27 Remove model info from state (#10399) 2017-11-07 21:28:11 -08:00
Diogo Gomes
a5aa111893 Add baudrate option to Serial sensor (#10439)
* Add baudrate option

Baudrate is essential!

* line too long

line too long (82 > 79 characters)

* trailing whitespace

* Rename const

* Fix the missing one
2017-11-07 22:06:19 +01:00
Robin
119fb08198 Fixes issue #10425 (#10426)
Fixes an error reported resulting from Hammersmith no longer supplying
data.
2017-11-07 18:19:54 +01:00
Adam Mills
11ecc2c171 Remove extra info from zwave entity states (#10413)
* Remove extra info from zwave entity states

* Show initializing for nodes that haven't completed queries
2017-11-07 10:13:39 -05:00
Mister Wil
07f073361f Bump to 0.12.2 to fix urllib3 dependency (#10420) 2017-11-07 01:39:13 +01:00
John Arild Berentsen
5410700708 Zwave save cache to file now. (#10381)
* Add save config

* Add API to save Z-Wave cache to file immediatley.

* lint

* remove none assignment

* docstring
2017-11-06 15:15:52 +01:00
Sebastian Muszynski
131af1fece Device model identification of the Xiaomi Philips Ceiling Lamp fixed. (#10401) 2017-11-06 09:20:31 +01:00
Pascal Vizeli
a9a3e24bde Update aiohttp to 2.3.1 (#10139)
* Update aiohttp to 2.3.1

* set timeout 10sec

* fix freeze with new middleware handling

* Convert middleware auth

* Convert mittleware ipban

* convert middleware static

* fix lint

* Update ban.py

* Update auth.py

* fix lint

* Fix tests
2017-11-05 18:42:31 -08:00
Paulus Schoutsen
39de557c4c Update frontend 2017-11-05 18:26:16 -08:00
Paulus Schoutsen
4742899369 Merge remote-tracking branch 'origin/master' into dev 2017-11-05 18:23:08 -08:00
Fabian Affolter
f3511d615e Upgrae simplepush to 1.1.4 (#10365) 2017-11-05 22:52:58 +01:00
Paulus Schoutsen
8f8772093d Merge pull request #10385 from home-assistant/release-0-57-2
0.57.2
2017-11-05 13:50:20 -08:00
Paulus Schoutsen
210bbc53a4 Update version to 0.57.2 2017-11-05 12:50:06 -08:00
Paulus Schoutsen
ce0537ef7f Update frontend to 20171105.0 2017-11-05 12:49:54 -08:00
Patrik
73cd902857 Fix tradfri problem with brightness (#10359)
* Fix problem with brightness

* Fix typo

* Typo
2017-11-05 12:49:24 -08:00
Simon
5d4514652d Addition of new binary sensor class 'plug' (#10336)
* Addition of new binary sensor class 'plug'

* use term "unplugged"

* add the entry to the right place
2017-11-05 10:25:44 -08:00
John Arild Berentsen
c07e651013 Add heal_node and test_node services. (#10369)
* Add heal_node and test_node services.

* lint
2017-11-05 09:19:19 -08:00
Patrik
bc51bd93f4 Fix tradfri problem with brightness (#10359)
* Fix problem with brightness

* Fix typo

* Typo
2017-11-05 17:43:45 +01:00
Adam Cooper
72ce9ec321 Add platform and sensors for Vultr VPS (#9928)
* Initial commit of Vultr components

Have a working Vultr hub and binary sensor which pulls down the
following attributes of your VPS:
 - Date created
 - Subscription id (server id)
 - Cost per month (in US$)
 - Operating System installed
 - IPv4 address
 - label (human readable name)
 - region
 - number of vcpus
 - which storage package chosen
 - IPV6 address (if applicable)
 - RAM amount

Working next on sensor and then testing / coverage.

* Added Vultr sensor for pending charges and current bandwidth. Refactored binary_sensor and hub too

* Corrected is_on bases

* Added basic tests for Vultr binary & platform

* Updated require files

* Changing test fixture to highlight different cases

* Written basic test for sensor.vultr

* Resolved linting errors and broken test

* Increase test coverage and corrected docs

* Resolved hound issues

* Revert back negative binary test

* Another hound resolve

* Refactoring and adding is switch, moving over to vultr branch

* Made Vultr components more resiliant to invalid configs

* Added negetive test for vultr binary sensor

* Added better testing of vultr sensor

* Resolved vultr platform test affecting subsequent vultr tests

* Moving VULTR components to single use design

* Added in sensor name config

* Added missing sensors var

* Resolved init data setting of sensors, added in name conf to switch

* Made the Vultr component more resiliant to startup failure with better alerting

* Various Vultr component changes

- Refactored sensor, binary_sensor, and switch to reference one subscription
- Renamed CURRENT_BANDWIDTH_GB monitored condition to CURRENT_BANDWIDTH_USED
- Improved test coverage

* Resolved local tox linting issue

* Added more testing for Vultr switch

* Improved test coverage for Vultr components

* Made PR comment changes to vultr binary sensor

* Made PR comment changes to Vultr sensor

* resolved PR comments for Vultr Switch

* Resolved vultr sensor name and improved tests

* Improved Vultr switch testing (default name formatting)

* Removed vultr hub failure checking
2017-11-05 14:10:14 +01:00
Fabian Affolter
a5d5f3f727 Move counter component (#10332)
* Fix docstring

* Add comment

* Move counter to folder

* Fix missing parts

* Commit it when file is saved
2017-11-05 13:51:52 +01:00
Fabian Affolter
5be6f8ff36 Upgrade sqlalchemy to 1.1.15 (#10330) 2017-11-05 13:51:03 +01:00
Per Osbäck
28ef564974 fix a import in test causing vs code to fail to discover (#10358)
* fix a import in test causing vs code to fail to discover

* Change style
2017-11-05 13:50:46 +01:00
Paulus Schoutsen
aae9697d9a Merge pull request #10351 from home-assistant/release-0-57-1
0.57.1
2017-11-04 12:56:38 -07:00
Paulus Schoutsen
af3d9d8245 Update frontend to 20171104.0 2017-11-04 12:53:09 -07:00
Paulus Schoutsen
640729f312 Version bump to 0.57.1 2017-11-04 12:52:39 -07:00
Fabian Affolter
de9d19d6f4 Use constants for HTTP headers (#10313)
* Use constants for HTTP headers

* Fix ordering

* Move 'no-cache' to platform
2017-11-04 12:04:05 -07:00
marconfus
e64803e701 Fix for API change of new enocean package (#10328)
* Fix API change of new enocean package

* Fix lint issue
2017-11-04 12:58:02 +01:00
Paulus Schoutsen
37bb626dd2 Merge pull request #10293 from home-assistant/release-0-57
0.57
2017-11-03 21:59:03 -07:00
Pascal Vizeli
21273de6a1 Move timer into correct folder (#10324)
* Move timer into correct folder

* Rename tests/components/test_timer.py to tests/components/timer/test_timer.py

* create init for test component

* Fix services.yaml loading
2017-11-03 21:18:36 -07:00
Craig J. Ward
fe271749c2 Tc update (#10322)
* use updated client

* update requirements
2017-11-03 21:18:35 -07:00
Paulus Schoutsen
af0253b2eb Fix formatting invalid config text (#10319) 2017-11-03 21:18:35 -07:00
Pascal Vizeli
986bcfef21 Fix recorder purge (#10318)
* Fix recorder purge

* Fix lint

* fix utc convert
2017-11-03 21:18:35 -07:00
William Scanlon
96f19c7205 Strip white space from configurator input (#10317) 2017-11-03 21:18:34 -07:00
Pascal Vizeli
cdc2df012c TellStick / Remove async flavor / add hassio (#10315)
* Remove unused async flavor

* Add tellcore-net support

* Update tellstick.py

* Update requirements_all.txt

* fix lint
2017-11-03 21:18:34 -07:00
Fabian Affolter
8dd790e745 Upgrade credstash to 1.14.0 (#10310) 2017-11-03 21:18:33 -07:00
Sebastian Muszynski
e90e94b667 Allow an empty MAC address at the Xiaomi Aqara Gateway configuration. (#10307) 2017-11-03 21:18:33 -07:00
Paulus Schoutsen
52f40b3370 Cloud: Authenticate with id token (#10304) 2017-11-03 21:18:32 -07:00
Paulus Schoutsen
8ed75217e1 Fix panel_custom (#10303)
* Fix panel_custom

* lint
2017-11-03 21:18:32 -07:00
Paulus Schoutsen
1e92417804 Cleanup Xiaomi Aqara (#10302) 2017-11-03 21:18:31 -07:00
NovapaX
be9cdf51d9 update mask-icon to a working mask-icon.svg (#10290)
* update mask-icon to favicon.svg

* change name of icon to mask-icon.svg
2017-11-03 21:18:31 -07:00
PeteBa
0e1a3c0665 Maintain recorder purge schedule (#10279)
* Maintain automated purge schedule

* Updates from review feedback
2017-11-03 21:18:31 -07:00
Pascal Vizeli
0f7a4b1d6f Move timer into correct folder (#10324)
* Move timer into correct folder

* Rename tests/components/test_timer.py to tests/components/timer/test_timer.py

* create init for test component

* Fix services.yaml loading
2017-11-03 21:10:08 -07:00
Craig J. Ward
acfee385fb Tc update (#10322)
* use updated client

* update requirements
2017-11-03 20:46:40 -07:00
Alok Saboo
96657841c8 Add option to overwrite file to the downloader component (#10298)
* Add option to overwrite file to the downloader component

* Cleanup

* Address Paulus's comments
2017-11-03 13:02:38 -07:00
Pascal Vizeli
a4dec0b6d2 Fix recorder purge (#10318)
* Fix recorder purge

* Fix lint

* fix utc convert
2017-11-03 12:55:00 -07:00
Pascal Vizeli
06d3d8b827 TellStick / Remove async flavor / add hassio (#10315)
* Remove unused async flavor

* Add tellcore-net support

* Update tellstick.py

* Update requirements_all.txt

* fix lint
2017-11-03 20:31:48 +01:00
Paulus Schoutsen
0877ea07b3 Fix formatting invalid config text (#10319) 2017-11-03 18:12:45 +01:00
William Scanlon
31b89f602a Strip white space from configurator input (#10317) 2017-11-03 08:58:03 -07:00
PeteBa
1ffccfc91c Maintain recorder purge schedule (#10279)
* Maintain automated purge schedule

* Updates from review feedback
2017-11-03 08:28:16 -07:00
Fabian Affolter
81324806d5 Move constants to setup.py (#10312)
* Remove unused import

* Move setup relevant consts to 'setup.py'

* remove blank line

* Set source
2017-11-03 07:43:30 -07:00
Sebastian Muszynski
a43f99a71c Allow an empty MAC address at the Xiaomi Aqara Gateway configuration. (#10307) 2017-11-03 07:38:15 -07:00
Hugo Dupras
1347c3191f Refactor Neato botvac components as a vacuum (#9946)
* Refactor Neato botvac components as a vacuum

A switch is still use to enable/disable the schedule

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* CI Hound fixes

* Fix lint errors

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* [Neato vacumm] Add sensor attributes to vacuum

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* Remove line breaks and fix docstring

* PR fixes
2017-11-03 14:25:26 +01:00
Paulus Schoutsen
4e8e04fe66 Clean up core (#10305)
* Clean up core

* Lint

* Fix tests

* Address comment

* Update entity.py

* romve test for forward update to async_update

* fix lint
2017-11-03 14:19:36 +01:00
Fabian Affolter
9b8c64c8b6 Upgrade credstash to 1.14.0 (#10310) 2017-11-03 13:51:17 +01:00
Paulus Schoutsen
a943b207ba Fix panel_custom (#10303)
* Fix panel_custom

* lint
2017-11-03 10:28:31 +01:00
Heiko Thiery
23809bff64 Add LaCrosse sensor platform (#10195)
* Initial commit of LaCrosse sensor component

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix review comments from houndci-bot

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix review comments from houndci-bot

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add pylacrosse version to REQUIREMENTS

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add lacrosse to .coveragerc

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* import 3rd party libraries inside methods

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add pylacrosse to requirements_all.txt

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* add missing docstring

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix pylint warning

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix pylint warning

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* fix pylint warnings

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove too many blank lines

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* some minor cleanup

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* change to single quote

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* incorporate review comments

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* remove type check as validation only allows TYPES

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>

* Adjust log level and update ordering
2017-11-03 08:59:11 +01:00
Paulus Schoutsen
a4f7828363 Cloud: Authenticate with id token (#10304) 2017-11-03 07:30:05 +01:00
Paulus Schoutsen
2598770b49 Update frontend 2017-11-02 22:52:19 -07:00
Paulus Schoutsen
b77df372d6 Update frontend 2017-11-02 22:51:53 -07:00
Paulus Schoutsen
8f774e9c53 Cleanup Xiaomi Aqara (#10302) 2017-11-02 22:18:10 -07:00
NovapaX
47d9403e3a update mask-icon to a working mask-icon.svg (#10290)
* update mask-icon to favicon.svg

* change name of icon to mask-icon.svg
2017-11-02 20:55:09 -07:00
Markus
4d19092722 pyLoad download sensor (#10089)
* Create pyload.py

* tabs and whitespaces removed

* code style fix

* code style fixes

* code style fix

* fixed standard import order

* classname fixed

* Added homeassistant/components/sensor/pyload.py

* code formatting

* implemented @fabaff recommendations

* Update pyload.py

* Use string formatting

* Make host optional
2017-11-02 22:17:44 +01:00
Sebastian Muszynski
f2a38677fc Bump python-miio for improved device support (#10294)
* Bump python-miio for improved device support.

* Requirements defines updated.
2017-11-02 21:38:18 +01:00
Paulus Schoutsen
8c525b3087 Version bump to 0.57 2017-11-02 09:31:30 -07:00
Paulus Schoutsen
5359001c04 Merge remote-tracking branch 'origin/master' into dev 2017-11-02 09:27:56 -07:00
Paulus Schoutsen
2481cd2012 Update frontend 2017-11-02 09:18:06 -07:00
Paulus Schoutsen
e4ddb00086 Update frontend 2017-11-02 08:59:26 -07:00
vatir
f9a019ea82 Follow-up: Replace emulated_hue: with emulated_hue_hidden (#9894)
When lights in the hue component are used with the emulated hue component ATTR_EMULATED_HUE is still being used, which was deprecated by #9382. This updates ATTR_EMULATED_HUE to ATTR_EMULATED_HUE_HIDDEN to improve consistency and stop the deprecation warnings.
2017-11-02 12:45:02 +01:00
Joaquín
417240ee3e Better scene handling (#10213) 2017-11-02 12:02:03 +01:00
cgtobi
ffc2541ba5 Improve unit tests for season sensor component. (#10288)
* Add setup platform tests for the season sensor component.

* Improve tests to cover 97% of the code.

* Improve tests to cover 97% of the code.
2017-11-02 11:08:17 +01:00
lichtteil
d74dbc35f2 Luftdaten sensor (#10274)
* Add sensor platform for luftdaten.info

* Add monitored conditions to platform schema

* Make monitored conditions config obligatory

* Improve inline documentation

* Import first standard libs then 3rd party libs

* Combine resource url using format

* Remove unnecessary try..except block

* Use state “None” instead of STATE_UNKNOWN

* Minor changes incl. removal of unused vars

* Add missing spaces
2017-11-02 10:32:06 +01:00
Maciej Sokołowski
1c2224cc5c Fixed Tradfri whitebulbs handling after #9703 (#10040) 2017-11-02 08:18:20 +00:00
dominikandreas
56c66a19f0 Update plant for dealing with float values (#10246)
Value parsing in plant component throws an ValueError if values are given as floats. This commit changes int(value) to int(float(value)) to avoid this error.
2017-11-02 09:17:26 +01:00
Lewis Juggins
79da44a6b3 Support new tradfri individual DTLS identification method (#10282) 2017-11-02 06:23:06 +00:00
William Scanlon
d9805160bc Removed username/password auth and moved to new save/load json (#10277) 2017-11-01 21:58:46 +01:00
Pascal Vizeli
f463f4d8c6 WIP: Cleanup async stuff on templates (#10275)
Cleanup async stuff on templates
2017-11-01 15:48:09 +01:00
Eitan Mosenkis
4da8ec0a05 Add Google Assistant support for setting climate temperature and operation mode. (#10174)
Fixes #10025.
2017-11-01 07:44:59 -07:00
Pascal Vizeli
fb34f94d9c Update template.py 2017-11-01 14:20:29 +01:00
cgtobi
513c2b03c9 Add setup platform tests for the season sensor component. (#10270) 2017-11-01 14:06:43 +01:00
Paulus Schoutsen
4dc9ac820f Remove http.development (#10267)
* Remove http.development

* Remove development

* Remove development from tests

* Remove constant
2017-11-01 13:07:16 +01:00
Pascal Vizeli
619d329a16 Add xy support to Alexa HomeAPI v3 (#10268)
* Add xy support to Alexa HomeAPI v3

* Update smart_home.py

* Update smart_home.py

* fix lint

* fix copy paste

* Update smart_home.py

* simplify

* Add test for xy/rgb

* Update test_smart_home.py

* Update smart_home.py

* add test
2017-11-01 12:16:05 +01:00
Fabian Affolter
e2c6f538a8 Add link to docs (#10272) 2017-11-01 12:11:32 +01:00
cgtobi
8739991676 Add unit test for wake on lan component. (#10262)
* Add unit test for wake on lan component.

* Remove unneccessary imports and print calls.

* Clean up lint complaints.
2017-11-01 11:15:24 +01:00
Paulus Schoutsen
26b097b860 Change introduction card to use persistent notification (#10265)
* Change introduction card to use persistent notification

* Lint
2017-11-01 09:10:36 +01:00
Erik Eriksson
4e8723f345 Extracted json saving and loading (#10216) 2017-11-01 09:08:28 +01:00
Paulus Schoutsen
85f30b893e Update netdisco to 1.2.3 (#10266) 2017-11-01 09:05:55 +01:00
Anders Melchiorsen
6cadb796bc Avoid Sonos error during startup (#10146)
* Add Sonos coordinators before slaves
2017-11-01 08:28:13 +01:00
Matt White
9eaa057739 Add EntityFilter helper (#10221)
* Add EntityFilter helper

* Changes in entityfilter after code review

* Convert recorder to use EntityFilter

* Fix flake/lint errors in recorder

* Update entity filter helper to return function

* Update recorder to use updated entity filter

* Better docstrings in entityfilter

* Update entityfilter.py
2017-10-31 21:54:50 -07:00
Per Osbäck
b6324b511c Google Assistant: make it possible to set a custom domain/type (#10188)
* Google Assistant: make it possible to set a custom domain/type

* add test for switch platform

* update custom type test
2017-10-31 20:38:34 -07:00
ChristianKuehnel
80a9539f97 integration with Remember The Milk. (#9803)
* MVP integration with Remember The Milk.

This version offers a service allowing you to create new issues in Remember The Milk.

* fixed pylint issue with import path

* - added files to .coveragerc as the server inerface is hard to test
- added tests for config file handling

* fixed lint error

* added missing docstrings

* removed stray edit

* fixed minor issues reported by @fabaff

* changed naming of the service, so that serveral accounts can be used

* added disclaimer

* moved service description to services.yaml

* fixed blank lines

* fixed structure of configuration

* added comment about httplib2

* renamed internal config file

* improved logging statements

* moved entry in services.yaml into separate folder.

Had to move the component itself as well.

* fixed static analysis findings

* mocked first test case

* fixed bug in config handling, fixed unit tests

* mocked second test case

* fixed line length

* fixed static analysis findings and failing test case

* also renamed file in .coveragerc

* control flow changes as requested by  @balloob
2017-10-31 20:33:47 -07:00
Pascal Vizeli
8c266f9266 Alexa SmartHome API extend (#10251)
* Implement adjustment

* Add color support

* fix lint

* Fix lint & use only RGB

* fix HSB + Test

* Add tests & fix bugs

* add rgb test

* add setColorTemperature

* Add color light support + tests

* Fix color temp

* use kelvin for converting

* use correct calculation
2017-10-31 20:28:17 -07:00
Adam Mills
5043b85c58 Use translated panel names on frontend (#10197)
* Use translated panel names on frontend

* Revert hassio translation
2017-10-31 20:22:04 -07:00
Daniel Perna
890c11cc7c WIP: Timer component (#9889)
* Added timer component

* Reworked functionality a bit

* Fixed requested change

* Fixed state updates when finished

* Removing expired listeners, added events, changed services

* Added finish service

* Using timedelta parameters in start-service

* Cleanup

* Lint

* Updating state for remaining time

* Removed duration from cancel method

* Renamed service to fix disabled lint

* Some tests (incomplete)

* Relocated service descriptions

* Addressed requested changes

* Adjusted tests, added methods and events

* Added test for finish service, lint

* Code cleanp, using string states

* tzzz... one char...

* Proper usage of restore_state

* Some more cleanup
2017-10-31 20:20:56 -07:00
Ted Drain
253c8aee1f Mqtt light options to fix #9330 and #7810 (#9829)
* Added ability to control when the on command is sent.

* Changed to allow only brightness command

* Code cleanup

* Added test cases for on command mode.

* Added addition test

* Changed brightness options to lower case.

* Fixed case of default value

* Remove default
2017-10-31 23:18:49 +01:00
cdce8p
12e1602a81 input_text - Added service doc (#10238)
* * Added service doc

* * Deleted print statement
2017-10-31 14:51:12 +01:00
GTH
25a25dde7a Add support for 'Send Current Position' feature in Geofency 5.1 (#10012) 2017-10-31 14:17:14 +01:00
biggms
c0eaf0386c Changed single tolerance value to COLD and HOT tolerances. Allows on and off states to have different error bands. (#9843) 2017-10-31 14:06:34 +01:00
Audric Schiltknecht
6b96bc3859 Add support for odhcpd DHCP server (#9858)
This commit adds support for the odhcp DHCP server in addition to
dnsmasq. A new configuration option 'dhcp_software' has been added and
allows the user to set the server used (defaults to dnsmasq to not break
existing installations).
2017-10-31 13:40:12 +01:00
Fabian Affolter
6d94c121a7 Move constant to 'const.py' (#10249) 2017-10-31 13:31:12 +01:00
Andrey
ae34640a80 Use theme color in loading screen. (#10248) 2017-10-31 13:30:50 +01:00
Greg. A
8832de80bc Sytadin default value must be a list #10233 (#10234)
* Sytadin default value must be a list #10233

* Sytadin default value must be a list #10233 v2
2017-10-31 08:32:26 +01:00
Eric Hagan
ed3f7d1581 OwnTracks work. Beacon logic and testcases (#10183)
* OwnTracks work. Beacon logic and testcases

The existing test cases don't really make clear what is being
tested and the iBeacon / Region / Zone / Tracker thing is all
a bit confused.

I'm distinguishing a fixed-place beacon used to trigger entrance
into an HA zone (as a Region Beacon) from a beacon affixed to a
portable or mobile object (as a Mobile Beacon). The behaviors
and test cases for those usages should be different. A Region Beacon
will be named the same as a Home Assistant Zone and seeing an event
from that beacon should trigger a device tracker update related
to that zone. It would be appropriate, though unnecessary, to
configure the Region Beacon with the GPS coordinates of its static
physical location.

A Mobile Beacon is not named after any HA Zone and seeing the beacon
triggers an update in HA setting the location of the beacon to the
current device_tracker location. In this way, when my_phone sees
the beacon on my_keys, the location of my_keys is set to where
my_phone is. And when my_phone stops seeing my_keys, my_keys location
is the location of my_phone the last time it saw them.

A Mobile Beacon's GPS information should be ignored because it's
almost certain to be incorrect because the beacon moves. In fact,
beacons typcially come configured with lat/lon as 0.0/0.0 so using
the location of the beacon in an update has a nasty habit of
setting you and your keys on the bottom of the Atlantic Ocean.

Leave message handling is changed to treat mobile beacons
differently from region beacons and gps regions.

active beacons should be a set. you shouldn't end up
with multiple "active" entries for the same beacon. Let's
enforce that with the correct data structure.

Added test for real-world bug that is fixed.
A series of mobile beacon and region beacon
enter and leave events could cause a mobile
beacon to stick to the tracking device even
though it had tracked through a "leave" event.

Changed two tests to look at the size
of the 'mobile_beacons_active' structure rather
than at the object which will allow this test
to work with any sort of list, set, etc.

* Removing excess logging and unnecessary try catch.

From review on PR #10183 I've removed some info logging
that was unnecessary and I've made the suggested changes
to an if block and a try/catch.
2017-10-31 00:18:45 -07:00
Mark Jozefiak
062fb7ac4c Add priority attribute for hyperion (#10102)
* light.hyperion: Add priority attribute

Allows to set the priority of the hyperion remote instance.

* fix lint errors

* Remove whitespace
2017-10-30 21:48:42 +01:00
Fabian Affolter
cc293db5ab Update services.yaml files (#10229)
* Add period to the description

* Update abbreviation
2017-10-30 21:39:12 +01:00
Sean Dague
c9c102815a Clarify yamaha play_media parameters (#10228)
The play_media parameters are a little bit black magic for the yamaha
platform, this explains what they are in a code comment instead of
having to go look at the yamaha platform itself.

Fixes Bug #10180
2017-10-30 21:38:52 +01:00
Jan Almeroth
5d23afdc9e Introducing multi-zone support for yamaha_musiccast devices (#9968)
* Introduce zones to yamaha_musiccast
* Introducing new config 'interval_seconds'
* Version bump pymusiccast
* Removing name parameter
2017-10-30 13:50:20 -04:00
Sebastian Muszynski
e95b48ca44 Xiaomi Aqara: Remove/Add device service added (#10150)
* First draft of a remove device service. Fixes https://github.com/home-assistant/home-assistant/issues/9571.

* Add device service introduced. Enables the join permission of the gateway to pair a new sub device within the next 30 seconds.

* Schema validation added and some refactoring.

* A more precise validation of the gw_mac (ffffffffffff vs. ff:ff:ff:ff:ff:ff).

* Persistent notification added to provide some feedback.

* Pylint warning disabled. The methods are used indirectly.

* CODEOWNERS reference updated.
2017-10-30 17:33:16 +01:00
Aaron Bach
646c03eea1 Add entity_picture_template options to Template Cover, Template Light, Template Sensor, and Template Switch (#9854)
* Re-adding cover

* Re-adding light

* Re-adding sensor

* Re-adding switch

* Re-added tests

* Fixing missing imports in rebased test

* Fixing broken tests

* Owner-requested changes

* Owner-requested changes

* Fixed exception
2017-10-30 09:28:37 -07:00
Nicolae Vlădescu
05ece53ec2 Librouteros capsman fix (#10217)
* Catch MultiTrapError exceptions also

* Expect librouteros api exceptions on every call and also set fallbacks

* Do not re raise

* Fix lint issue
2017-10-30 08:41:37 +01:00
David Grant
b5214af762 Add gc100 platforms and component (#10159)
* Initial commit of gc100 platforms and component

* Fixed removed temporary code to set import path

* Fixed removed unused import

* Implementing changes requested by @fabaff

* Fixed linter errors

* Remove reference to binary sensor

* Move const

* Add const

* Fix pylint
2017-10-30 08:40:14 +01:00
Marcelo Moreira de Mello
3630dc7ff3 Raincloudy version bump (#10225) 2017-10-30 08:36:38 +01:00
Peter Epley
e7fc8a1890 Google Assistant Script Support (#10148)
* Add script support as scene

* Add script support as scene

* Corrected missing script definition
2017-10-30 00:11:23 -07:00
Fabian Affolter
2891b0cb2e Upgrade restrictedpython to 4.0b2 (#10179)
* Upgrade restrictedpython to 4.0b2

* Update test
2017-10-30 00:02:15 -07:00
Paulus Schoutsen
fc44a4ed99 Update frontend 2017-10-29 23:29:49 -07:00
Pascal Vizeli
444b7c5ee7 Add new service 'snapshot' for camera (#10207)
* Add new service 'snapshot' for camera

* Fix lint

* fix arguments

* Add test and fix bugs

* Fix lint

* Fix typo
2017-10-29 23:14:26 +01:00
Fabian Affolter
690760404b Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
Greg Dowling
6a9968ccb9 Bump pyvera to 0.2.38. (#10206) 2017-10-29 13:50:21 +01:00
Fabian Affolter
e91ed1f2a4 Upgrade youtube_dl to 2017.10.29 (#10202) 2017-10-29 12:32:33 +01:00
Fabian Affolter
115c59d88c Move constant to 'const.py' and use already definied ones (#10204) 2017-10-29 12:32:02 +01:00
Fabian Affolter
97bb252d23 Upgrade pylast to 2.0.0 (#10200) 2017-10-29 11:54:11 +01:00
cgtobi
20a1a52bd5 Add unit test for hddtemp sensor. (#10154)
* Add unit test for hddtemp sensor.

* Remove sample fixture and include it in the code.

* Add test to raise coverage.

* Fix bug when host is not reachable.

* Minor code cleanups.

* More code cleanups.
2017-10-29 11:53:53 +01:00
Patrik
9e27e05a84 Update CODEOWNERS (#10198)
Adding myself to monitor tradfri
2017-10-29 11:19:34 +01:00
Fabian Affolter
67c48736a2 Add clickatell (#10199) 2017-10-29 11:19:04 +01:00
Fabian Affolter
35805e51a3 Add Random binary sensor (#10164) 2017-10-29 11:15:57 +01:00
TopdRob
6057b41151 update boto3 to 1.4.7 and botocore to 1.7.34 (#10121) 2017-10-29 10:24:56 +01:00
David Lloyd
2374659984 Added new Clickatell SMS messaging Notify Platform (#9775)
* Added new Clickatell SMS messaging Notify Platform

* Added new Clickatell SMS platform with layout corrections

* Added new Clickatell platform with additional  layout corrections

* Added new Clickatell platform with exception handling removed

* Added new Clickatell platform with poor reference removed

* Reversed changes to dev_docker file

* Minor changes
2017-10-29 09:14:40 +01:00
Egor Tsinko
2c3195522f media_title property now returns current source (#10120) 2017-10-29 02:26:55 +02:00
Greg. A
b3e88d1f8f Add Sytadin Traffic component (#9524)
* Add Sytadin Traffic component

* Add Sytadin Traffic component, update

* Add Sytadin Traffic component, update

* Add Sytadin Traffic component, update

* Add Sytadin Traffic component, update

* Add Sytadin Traffic component, update

* implements @fabaff comments

* Formatting

* formatting

* formatting

* split monitored condition to be independent

* formatting

* add version

* fix requirements part based on gen_requirements_all.py result

* formatting

* requirements stuff file

* formatting

* add missing file into .coveragerc

* add me for code review

* configuration management updated

* implements @fabaff and @pvizeli comments

* indentation

* indentation

* indentation

* indentation

* add const DEFAULT_UPDATE_INTERVAL

* use const DEFAULT_UPDATE_INTERVAL

* remove blank line

* fixes debug call

* clean for loop

* use BeautifulSoup for html parsing

* Update requirements

* Add throttle and fix remaining issues

* Don't add const
2017-10-29 01:34:55 +02:00
Florian Klien
dd7d8d56bb added Yesss SMS platform (#10177)
* added Yesss SMS component

requires YesssSMS==0.1.1b

* requirements_all

* coveragerc

* fix

* docstring fix

* added Exception handling

* requirements_all

* fixing lint error, version bump for YesssSMS
2017-10-29 01:05:56 +02:00
Sebastian Muszynski
df19172e56 Limits of the favorite level updated. Values between 0 and 16 will be accepted. (#10186) 2017-10-28 10:54:11 +02:00
Marcelo Moreira de Mello
f060dcc0aa Added capability to pass a filename to the downloader component (#10059)
* Added capability to pass the filename to the downloader component

* Simplified filename conditions
2017-10-27 22:50:02 +02:00
Menno Blom
5c168ab551 Nederlandse spoorwegen (#10136)
* Add Nederlandse Spoorwegen sensor

* Remove unused 'delay' option.

* Apply requested code reviewed changes

- use constants from const.py
- ensure the configuration is a list
- verify credentials upon platform setup
- verify station input
- add True as second param to add_device
- only call add_device if at least 1 sensor was setup
2017-10-27 22:19:12 +02:00
Sebastian Muszynski
fe9b45c964 Xiaomi MiIO Light: Philips Eyecare Lamp 2 support (#10007)
* Xiaomi Philips Eyecare Lamp 2 support introduced.

* Code clean-up.

* Make hound happy again (idents).

* Revert "Code clean-up."

This reverts commit ea637602ff.

* Unused platform constant removed.

* Nice compromise of the code clean-up implemented.
2017-10-27 22:04:48 +02:00
Fabian Affolter
38c189ecf4 Revert "Upgrade restrictedpython to 4.0b2"
This reverts commit 8e4f0ea5ae.
2017-10-27 21:52:44 +02:00
Fabian Affolter
8e4f0ea5ae Upgrade restrictedpython to 4.0b2 2017-10-27 21:50:22 +02:00
Lukas Barth
248d974ded Cast attribute values to string before publishing to MQTT (#9872)
* Cast attribute values to string before publishing to MQTT

* Simplify

* Use JSON serialization, add test
2017-10-27 08:55:04 -07:00
Ryan McLean
2d93285689 Linode (#9936)
* Fix: Last Played Media Title in plex would stay even when player was idle/off
     Primary Fix is in the "if self._device" portion.
     code in "if self._session" is a catch all but i'm not 100% if it is needed.

* Fixed lint issues with previous commit

* 1st Pass at refactoring plex refresh
Moved _media** into clearMedia() which is called in _init_ and
at start of refresh.

Removed redunant _media_* = None entries

Grouped TV Show and Music under single if rather than testing
seperately for now.

* Fixed invalid name for _clearMedia()
Removed another media_* = None entry

* Removed print() statements used for debug

* Removed unneeded "if" statement

* Added Base Support for Linode

* Removed unused Attr

* Corrected some Typos

* updated requirements & coveragerc

* added import to prevent var not declared errors in linter

* Fixed Typo

* Added Switch Component for Linode and corrected some errors if data was blank

* Updated api lib to hopefully remove dependancy on enum34

* Fixed Reference error

* fix pylint errors

* Update linode.py

* Update linode.py

* Update linode.py

* Update linode.py
2017-10-27 16:19:47 +02:00
bastshoes
68390373e5 Fix for issue #9240 (#10173)
Changes for respecting mqtt fan config. If fan speed and oscillation is not configured they wouldn't be displayed in UI.
2017-10-27 16:04:18 +02:00
randellhodges
c0f8e6c5c5 Updated denon component to play nice with the 3808CI that doesn't support NSFRN command (#10157) 2017-10-27 14:22:23 +02:00
Casper Weiss Bang
85d7377beb MPD now uses the filename if song doesn't have metadata (#10085)
* added support for filename

* used the getter instead - minor mistake

* changed how the filename is generated
2017-10-27 11:21:47 +02:00
Anders Melchiorsen
f17cf1d26b Avoid Sonos errors for tracks with no artist information (#10160)
Rather than adding guards to the string formatting, just remove this
unused attribute.
2017-10-27 10:50:03 +02:00
Anders Melchiorsen
e50b59a56c Reduce album art flickering in media player UI (#10163)
* Add HTTP cache header to proxied media player images

With the resource actually being cacheable, preemptively extend the cache
buster key to prevent hash collisions.

While at it, change the hash from md5 to sha256 for consistency with the
access_token method.

* Remove lint
2017-10-27 10:49:20 +02:00
Fabian Affolter
e43fefa8f6 Support for NO-IP (#10155)
* Support for NO-IP

* Update URL
2017-10-27 10:15:47 +02:00
Yannick POLLART
e819678e27 Rfxtrx binary sensor rewrite (#10152)
* Refactored Lighting4-specific code (issue #8907)

* Fixed lint problem and removed unneeded function call.

* fixed malformed if

* removed backslash

* fixed code for pylint

* removed useless assignment

* using hasattr() instead of try/catch
2017-10-27 10:01:46 +02:00
Florian Klien
9df7302603 New DTLSSocket version that fixes Cython dependency for Trådfri (#10123) 2017-10-27 07:53:36 +01:00
Fabian Affolter
afe88dfa0f Upgrade libnacl to 1.6.1 (#10161) 2017-10-27 08:01:32 +02:00
Fabian Affolter
027ce2f555 Upgrade python_opendata_transport to 0.0.3 (#10162) 2017-10-27 08:01:12 +02:00
Fabian Affolter
63a10233c5 Upgrade sendgrid to 5.3.0 (#10166) 2017-10-27 08:00:53 +02:00
Egor Tsinko
acbf45d5f8 added platform discovery code back into device_tracker (#10169) 2017-10-27 07:57:31 +02:00
Paulus Schoutsen
d13f3eca92 Update frontend to 20171027.1 2017-10-26 22:29:59 -07:00
Andrey
fc291dd5ab Don't use pypi package in dev mode. Allow non-fingerprinted mdi. (#10144) 2017-10-26 22:28:07 -07:00
Adam Mills
583e57042b Core POC support for polymer i18n (#6344)
* Core POC support for polymer i18n

* Add gulp to build_frontend

* Remove frontend build

* Updated translations format

* Eliminate translation namespace from panel names

* Only register translations path in dev mode
2017-10-26 21:46:21 -07:00
Sebastian Muszynski
9d0c2a8dae Xiaomi MiIO Switch: Support for different device types (#9836)
* Support for different device types of MIIO switches: Xiaomi Smart WiFi Socket (called Plug), Xiaomi Smart Power Strip and Xiaomi Chuang Mi Plug V1.

* Line too long fixed.

* Trailing whitespace removed.

* Changes based on review.

* Line too long fixed.

* No blank lines allowed after function docstring fixed.

* The underlying library is called python-miio now. Imports and requirements updated.

* TODO comment removed. Travis complains about.

* Blank line removed.

* Code clean-up.

* Revert "Code clean-up."

This reverts commit 96b191c7a6.

* Unused platform constant removed.
2017-10-26 23:37:30 +02:00
Richard Leurs
c2ef22bd08 Add display currency setting to CoinMarketCap sensor (#10093)
* Add support for different display currencies in CoinMarkerCap sensor.

* Add test for CoinMarketCap sensor.

* Add test dependency to gen_requirements_all.

* Fix review comments: use string formatting and less string case chanes.
2017-10-26 18:49:17 +02:00
Daniel Høyer Iversen
2561efe45d Add last action to xiaomi aqara button (#10131) 2017-10-26 18:46:29 +02:00
Rasmus
c191c13f3a Telldus Live: Device without methods is a binary sensor (#10106)
Telldus Live reports binary sensors as devices without methods.
2017-10-26 15:54:49 +02:00
Fabian Affolter
b1291e572e Upgrade pysnmp to 4.4.1 (#10138) 2017-10-26 10:38:27 +02:00
Jeroen ter Heerdt
d1416056cd Microsoft tts (#9973)
* Microsoft Cognitive Services text-to-speech

* Adding microsoft.py to .coveragerc

* Update microsoft.py

* Update microsoft.py

* Update requirements_all.txt

* fix order
2017-10-25 19:43:21 +02:00
milanvo
7987065ad7 Fix recorder crash for long state string - enforce at core level (#9696)
* Recorder exception catch for long state string

* Revert - Recorder exception catch for long state string

* Validate state length at core level

* Revert - this reverts commit 9d6bd017d9.

* Revert - Recorder exception catch for long state string

* Fix state TypeError

* Test for long state exception
2017-10-25 09:05:30 -07:00
Sam Birch
fc8940111d Binary sensor for detecting linear trends (#9808)
* Trend sensor now uses linear regression to calculate trend

* Added numpy to trend sensor test requirements

* Added trendline tests

* Trend sensor now has max_samples attribute

* Trend sensor uses utcnow from HA utils

* Trend sensor now completes setup in async_added_to_hass

* Fixed linter issues

* Fixed broken import

* Trend tests make use of max_samples

* Added @asyncio.coroutine decorator to trend update callback

* Update trend.py
2017-10-25 17:33:17 +02:00
Georgi Kirichkov
63c9d59d54 SNMP switch (#9840)
* Initial support for SNMP switch

Supports setting integer values

* Resolves styling issues

* Updates requirements

* Remove commented out import

* Changes default community to private. Fixes linting errors.

* More linter fixes and bugfix in #state()

* Refactors the code to make it simpler.
2017-10-25 16:09:29 +02:00
Anders Melchiorsen
61ccbb59ce Fire numeric_state action when first state change matches criteria (#10125)
* Fire numeric_state action when first state change matches criteria

* Remove lint

* Update numeric_state.py
2017-10-25 16:01:09 +02:00
Pascal Vizeli
5fabfced38 Fix lint google-domains (#10135)
* Fix lint google-domains

* Update google_domains.py
2017-10-25 15:43:02 +02:00
Daniel Perna
6c39e1ef19 Added increment + decrement to input_number (#9870)
* Added increment + decrement to input_number

* Lint

* Fix tests

* Another lint

* Additional testing

* Added service descriptions

* Consolidated service registration

* Shortened service registration

* Fixed service descriptions

* Fix Lint
2017-10-25 15:25:33 +02:00
Hydreliox
632466bb56 Add Deluge Sensor (#10117)
Add a sensor to provide upload and download speed of the Deluge Bittorrent Client
2017-10-25 15:13:11 +02:00
Trevor
7784c40f12 Add Google Domains component (#9996)
* Add Google Domains component

* Fixes for hound

* Add Google Domains tests

* Fixes for hound

* Clean up Google Domains

* Add timeout to Google Domains

* Remove whitespace from blank lines

* Update google_domains.py

* Update google_domains.py
2017-10-25 11:42:53 +02:00
Ryan McLean
41fa8cc8f2 Plex refactor Part 1 - Update plexapi to 3.0.3 (#9988)
* Fix: Last Played Media Title in plex would stay even when player was idle/off
     Primary Fix is in the "if self._device" portion.
     code in "if self._session" is a catch all but i'm not 100% if it is needed.

* Fixed lint issues with previous commit

* 1st Pass at refactoring plex refresh
Moved _media** into clearMedia() which is called in _init_ and
at start of refresh.

Removed redunant _media_* = None entries

Grouped TV Show and Music under single if rather than testing
seperately for now.

* Fixed invalid name for _clearMedia()
Removed another media_* = None entry

* Removed print() statements used for debug

* Removed unneeded "if" statement

* Changes
* Updated Requests to 2.18.4
* Updated plexapi to 3.0.3
* Removed function to convert_NA_to_None
* Removed function get_thumb_url

Type changes
* _session.player is now a list players
* na_type deprecated and to be removed
* plexapi has change na to None

Known Issues:
* Player controls currently broken
* Last location (library) stays while player idle

* Username is now Usernames and a list

* Fix for broken controls

* Removed errant print statement

* Removed depecrated na_type

* Updated Plex Sensor to use plexapi 3.0.3
Added support for Token to be used in sensor

Known Issues:
Username and Password broken for Plex Sensor use Token instead for now

* removed TODOs

* Fixes for private access violations

* Removed need for _local_client_fix

* Removed unused import and fixed parens
2017-10-25 11:42:13 +02:00
Trevor
2a2a106e62 Fix Sonarr and Radarr divide by zero (#10101)
* Fix Sonarr and Radarr divide by zero

* Fixes for hound

* Clean up Radarr diskspace
2017-10-25 11:37:08 +02:00
Anders Melchiorsen
45e140149b Allow folder selection for IMAP unread sensor (#10126) 2017-10-25 11:36:00 +02:00
Kane610
34368a6b69 WIP: Refactor Axis component removing external dependencies (#9791)
* Async rewrite

* Device and events now working with async core

* More async than before

* Methods have moved

* Remove check if parameter serial number is available since library handles reconnection anyway and we can expect user to set up configuration correctly

* Async rewrite

* Device and events now working with async core

* More async than before

* Methods have moved

* Remove check if parameter serial number is available since library handles reconnection anyway and we can expect user to set up configuration correctly

* Serial number is the only unique identifier, checks are still needed

* No async for setup_device

* Bump axis to 13 in preparation of friday the 13th

* Fix review comments

* Removed async after some discussions with @armills.
It wasn't possible to get past that aiohttp doesnt support digest auth, which makes it impossible to convert the full library at this point in time.
2017-10-25 00:04:30 -07:00
Sebastian Muszynski
e8f5445acc Xiaomi MiIO Fan: Xiaomi Air Purifier 2 integration (#9837)
* Xiaomi Air Purifier 2 integration

* Flake8 errors fixed.
Changes based on review.

* Service domain ("fan") updated and services properly prefixed by xiaomi_miio.

* The underlying library is called python-miio now. Imports and requirements updated.

* Version bumped. The underlying library is called python-miio now.
2017-10-24 23:50:01 -07:00
Daniel Høyer Iversen
00b9297082 Rfxtrx fix (#10128)
Rfxtrx fix (#10128)
2017-10-25 08:41:02 +02:00
Paulus Schoutsen
2bdad5388b Consolidate frontend (#9915)
* Consolidate frontend

* Remove home-assistant-polymer submodule

* Convert to using a pypi package for frontend

* fix release script

* Lint

* Remove unused file

* Remove frontend related scripts

* Move hass_frontend to frontend REQUIREMENTS

* Fix tests

* lint

* Address comments

* Lint + fix tests in py34

* Fix py34 tests again

* fix typo
2017-10-24 19:36:27 -07:00
Sergey Isachenko
29fb65b224 Fixes #10030. Extented Network Exceptions handling. (#10116)
* Fixes #10030. Extented Network Exceptions handling.

* Remove unused import. Replace ex.reason to ex.message to use custom exception instead of HTTPError
2017-10-24 19:15:25 +02:00
Fabian Affolter
560a4ef5eb Fix PEP8 and PEP257 issues (#10108) 2017-10-24 18:36:08 +02:00
Hydreliox
186f8f6996 Add Deluge Switch Component (#9979)
* Add Deluge Switch Component

* Update deluge.py
2017-10-24 16:44:12 +02:00
Paulus Schoutsen
238884dfe2 Revert gactions in Docker (#10115) 2017-10-24 07:30:24 -07:00
Pascal Vizeli
6da08deabf Merge pull request #9118 from jbarrancos/dev
Rain Bird LNK WiFi Irrigation Implementation
2017-10-24 15:01:15 +02:00
Markus
e970edbf20 fixed typo (#10110) 2017-10-24 14:44:38 +02:00
Pascal Vizeli
7c69941f13 cleanup 2017-10-24 12:25:12 +02:00
Pascal Vizeli
179655b6b0 Merge pull request #10079 from home-assistant/scrape-auth
Add support for HTTP Basic/Digest authentication
2017-10-24 12:21:44 +02:00
Pascal Vizeli
6ebff3cda4 Merge pull request #10105 from home-assistant/bayesian-sensor
Use constants and update docstrings
2017-10-24 12:18:02 +02:00
Daniel Høyer Iversen
70eaa5f10e Update CODEOWNERS (#10103) 2017-10-24 09:34:42 +02:00
Adam Cooper
485e81db79 whois domain lookup sensor (#10000)
* Init commit of new whois sensor

* Updated requirements

* Resolved updated showing expired, added expired attr

* Added missing attribute in init, added whois to coveragerc

* Various PR comment changes

- Now more resiliant to invalid hostnames
- Removed various assumed STATE_UNKOWN setting
- Upfront check for valid hostname preventing the sensor starting with dud
- Resolved unit of measurement Day, Days, None issue
- Datetime formatting now done to iso 8601 standard
- Removed all expired usage, not really that useful
- Unused hass assignment

* More PR comment resolutions

- Resolved the dilemma with hosts / single host per sensor. Now running
single domain per sensor.
- Renamed host(s) to domain

* Moved coveragerc sensor location

* Re-phrased the expiration_date warning

* Resolved assumed updated_date existence

* Resolved missing indent

* Resolved discover_info typo

* Update whois.py
2017-10-24 09:34:06 +02:00
Fabian Affolter
fc2f41fe8a Use constants and update docstrings 2017-10-24 09:12:01 +02:00
Pascal Vizeli
a4b0e8f897 Merge pull request #10082 from arsaboo/uptimefix
Add minutes to Uptime sensor
2017-10-24 08:32:46 +02:00
Pascal Vizeli
3cf99e29be Merge pull request #10100 from home-assistant/additional-event-tests
Additional event data tests to cover recent bugs
2017-10-24 08:28:09 +02:00
Adam Mills
5f8eb08cd9 Additional event data tests to cover recent bugs 2017-10-23 19:44:07 -04:00
pezinek
d1424714c7 Support for Entity.available in sensor/rest (#10073) 2017-10-23 23:29:41 +02:00
Fabian Affolter
74e93e5853 Upgrade Sphinx to 1.6.5 (#10090) 2017-10-23 23:15:36 +02:00
arsaboo
bd72f45788 Added minutes to uptime sensor 2017-10-23 14:38:16 -04:00
arsaboo
845fd532f0 Reverse tests 2017-10-23 14:08:38 -04:00
arsaboo
46404a84ec Update tests 2017-10-23 13:45:20 -04:00
arsaboo
ebce666264 Fix decimals in uptime sensor 2017-10-23 13:05:20 -04:00
Fabian Affolter
15cf34f45f Add support for HTTP Basic/Digest authentication 2017-10-23 17:48:51 +02:00
Pascal Vizeli
e620479cc8 Merge pull request #10069 from home-assistant/release-0-56-2
0.56.2
2017-10-23 17:40:58 +02:00
Pascal Vizeli
b292a4af3f EntityComponent: revert warning (#10078)
* Add warning back

* fix lint
2017-10-23 17:39:50 +02:00
Fabian Affolter
79d71c6727 Version bump to 0.56.2 2017-10-23 16:09:26 +02:00
Thom Troy
0b850b555f add eph ember controls (#9721)
* add eph ember controls

* updates based on review

* remove unused import

* update to new version of pyephember

* added myself to codeowners as requested

* make codeowners alphabetical

* run fixed gen_requirements_all

* Update ephember.py
2017-10-23 15:52:39 +02:00
R1chardTM
176c99f0cd Change deprecated use of maintainer tag in Dockerfile. (#10068) 2017-10-23 15:25:55 +02:00
Fabian Affolter
42e59b465e Make host optional (#10063)
* Make host optional

* Update test to reflect code changes
2017-10-23 15:24:04 +02:00
Daniel Høyer Iversen
e8a701ffd0 update library for xiaomi_aqara, change from pyCrypto to cryptography (#10066) 2017-10-23 14:55:36 +02:00
Fabian Affolter
32f58baa85 Fix merge conflict 2017-10-23 13:49:45 +02:00
Pascal Vizeli
9794336113 Remove warning 2017-10-23 13:48:25 +02:00
Teemu R
ed82f23da3 switch.tplink: fix overlooked issue with statically defined names (#10053) 2017-10-23 13:46:00 +02:00
Maciej Bieniek
48c86e07fa fix gateway illumination sensor value (#10045) 2017-10-23 13:45:34 +02:00
Fabian Affolter
76a0763cbc Remove STATE_UNKNOWN (#10064) 2017-10-23 13:12:14 +02:00
Fabian Affolter
f4f36a3662 Add link to docs and update ordering (#10062) 2017-10-23 12:18:23 +02:00
Philipp Schmitt
e201bcad14 Show current program thumbnail as media_image (#10033)
* Do not include program data in media_title if program data is undefined (None)

* Show thumbnail of currently playing program

* async setup

* Update requirements
2017-10-23 12:04:23 +02:00
Fabian Affolter
5182f76aea Merge pull request #10060 from home-assistant/some-cleanups
Remove warning component / Update event trigger for UI created
2017-10-23 11:54:50 +02:00
Fabian Affolter
53b1c75d81 Merge pull request #10061 from cgtobi/glances_icons
Add icons according to sensor types.
2017-10-23 11:12:17 +02:00
Tobias Sauerwein
fdc769abf7 Add icons according to sensor types. 2017-10-23 07:54:57 +00:00
Teemu R
f57e307c7a switch.tplink: fix overlooked issue with statically defined names (#10053) 2017-10-23 09:41:47 +02:00
Kevin Fronczak
f9d89a016e Add fail2ban sensor (#9975)
* Initial revision of fail2ban sensor

* Verified working, added tests

* Re-factored code so that log reading isn't called for each sensor

* Lint fixes

* Removed errant reset of last ban, added test to verify bans persist through update

* Removed for loop in read_log and replaced with regex per review request

* Refactored update to use current ban array for last ban state

- also was missing return False in timer for default behavior

* Removed CONF_SCAN_INTERVAL from PLATFORM_SCHEMA.extend

- renamed DEFAULT_SCAN_INTERVAL to SCAN_INTERVAL

* SCAN_INTERVAL changed to timedelta

* Force travis rebuild (last build timed out)

* Using compiled regex now
2017-10-23 09:20:45 +02:00
Pascal Vizeli
205f24c070 Trigger also with orderdict 2017-10-23 09:01:59 +02:00
Pascal Vizeli
4bf1972393 Remove warning 2017-10-23 08:58:02 +02:00
sander76
4fa0119245 fixing a typo in the old library which broke hub gen2 compatibility (#9990)
* fixing a typo in the old library.
Should now work with both version 1 and version 2 hub

* version bump

* fix Scene shadowing

* fix requirements. (not sure whether I should commit the other generated files as well ?)
2017-10-22 23:34:50 -07:00
Maciej Bieniek
ccde371a9d fix gateway illumination sensor value (#10045) 2017-10-23 08:02:20 +02:00
Adam Mills
4e7cc110d9 Fix no data event triggers (#10049)
* Test including extra data on a no data trigger

* Match any dicts for default schema for event data

* Fix indentation

* Only check schema if one was configured
2017-10-22 20:20:38 -04:00
Adam Mills
05ba78d886 Aioautomatic bump and scope update (#10043)
* Bump aioautomatic version

* Include vehicle:events scope for automatic

* Sort scopes
2017-10-22 17:11:35 -04:00
Adam Mills
ee56e33193 Add regression test for entity ID update bug (#10037) 2017-10-22 14:23:20 -04:00
Paulus Schoutsen
106bf467f8 0.56.1 (#10035)
* Version bump to 0.56.1

* Fix device update / entity_id with names (#10029)

* Fix device update

* Add tests

* add test for disabled warning

* fix temperature/humidity sensors valid values (#10024)
2017-10-22 19:56:20 +02:00
Pascal Vizeli
56cbfb5f2a Fix device update / entity_id with names (#10029)
* Fix device update

* Add tests

* add test for disabled warning
2017-10-22 08:40:00 -07:00
Maciej Sokołowski
193188b965 RGB Tradfri simple support (#9703) 2017-10-22 16:22:51 +01:00
Thom Troy
4197c9ee85 add irish rail transport sensor (#9883)
* add irish rail transport sensor

* Add True as last device

* Update irish_rail_transport.py
2017-10-22 14:18:34 +02:00
Klaas Hoekema
9418c61b25 Use feed name assigned in EmonCMS if there is one (#10021)
The default names for the feeds created by the EmonCMS component are
like 'emoncms1_feedid_10', but
- This is the display name. The ID should be lowercase and underscored,
  but the display name should be readable. The ID gets derived from it
  and comes out formatted correctly.
- EmonCMS lets you assign names to feeds, so it makes sense to use those
  if they exist, rather than feed IDs. The ID is pretty meaningless and
  basically means you have to override every name to make it readable.
- Including the ID identifying the EmonCMS instance (i.e. the '1') makes
  the name clunkier and would only be useful for people with multiple
  EmonCMS instances, which is likely to be an extremely small group since
  one hub can run as many feeds as you need it to.

This changes the default behavior but still uses configured 'name' if
it's set, so it won't break the configuration of people who have
customized their feed names in HA config.
2017-10-22 12:12:36 +02:00
Maciej Bieniek
62caea6bfb fix temperature/humidity sensors valid values (#10024) 2017-10-22 11:59:24 +02:00
Abílio Costa
80053ef21b switch.flux: add interval and transition attributes (#9700) 2017-10-22 11:27:04 +02:00
Fabian Affolter
bd4304e838 Upgrade youtube_dl to 2017.10.20 (#10014) 2017-10-22 11:24:07 +02:00
Sebastian Muszynski
c08c8c7996 Xiaomi Aqara: New xiaomi wireless button (sensor_switch.aq3) introduced (#10008)
* New xiaomi wireless button (sensor_switch.aq3) introduced.

* The next version of PyXiaomiGateway (0.5.3) is needed.
2017-10-22 11:02:01 +02:00
Paulus Schoutsen
9d39a5ced3 Call correct script [skip ci] 2017-10-22 01:04:10 -07:00
Fabian Affolter
816b69c807 Upgrade mypy to 0.540 (#10013) 2017-10-22 00:45:40 -07:00
Alan Fischer
9f62d5e3cf Json api fix (#10017)
* Dont let json parsing errors result in a 500

* Fixed error description
2017-10-22 00:44:46 -07:00
Chris Kacerguis
796a3ff49d Added gaction script to support the new Google Assistant component in Docker (#10019)
* added gactions install script

* added gaction setup step

* added ability to not install gaction

* updated dev docker file
2017-10-22 08:09:49 +02:00
Hydreliox
089e1ab6f4 Add xy attribute to Yeelight (#9957)
Allows using light profiles with yeelight bulbs
2017-10-22 02:59:55 +02:00
Fabian Affolter
5ad715507b Merge branch 'master' into dev 2017-10-22 00:46:47 +02:00
Fabian Affolter
ead4e44cd6 Merge pull request #9969 from home-assistant/release-0-56
0.56
2017-10-22 00:37:23 +02:00
Paulus Schoutsen
2a4c5466ef Merge remote-tracking branch 'origin/master' into release-0-56 2017-10-21 14:50:22 -07:00
Fabian Affolter
2ab14bbabc Bump dev to 0.57.0.dev0 (#10010) 2017-10-21 13:12:57 -07:00
Fabian Affolter
28b7a3da32 Renaming API.AI to Dialogflow (#10006)
* Rename API.AI to Dialogflow

* Rename API.AI to Dialogflow
2017-10-21 13:12:23 -07:00
milanvo
bf26b75d27 Change persistent notification to avoid long text in entity state (#9967)
* Change persistent notification to avoid long text in entity state

* Tests for changed persistent notification

* Persistent notification state

* Test for component state
2017-10-21 21:59:05 +02:00
Adam
3ea4691fce Fix spelling error (#10009) 2017-10-21 21:56:19 +02:00
Pascal Vizeli
f27ad76230 Remove async_update (#9997) 2017-10-21 21:51:58 +02:00
William Scanlon
60053a642c Moved siren to Wink from switch (#9879) 2017-10-21 21:51:57 +02:00
Lewis Juggins
d9f5398c56 [tradfri] Update pytradfri, simplify dependencies. (#9875)
* Update pytradfri

* Process dep links

* Process dep links

* Process dep links

* Install all deps

* Update requirements

* Exclude aiocoap

* Install cython

* Remove cython

* Exclude DTLSSocket

* Add cython
2017-10-21 21:51:50 +02:00
Gerardo Castillo
5df985a510 Update the Russound RNET component to use enhanced Russound.py (#9739)
* Updated RussoundRNETDevice.update() to call and enhanced function that reduces network traffic

Refer to issue #6 on the Russound project

* Updated RussoundRNETDevice.update() to invoke an enhanced function to reduce network traffic

PLease see issue #6 on the russound project

* Updated REQUIREMENTS to use version 0.1.9 of the Russound component

Please refer to issue #6 on the Russound rnet project

* Corrected some minor style details to satisfy Houndbot

* Update requirements_all.txt
2017-10-21 14:56:37 -04:00
cgtobi
789929d445 Add support for multiple disks to be monitored. (#9977)
* Add support for multiple disks.

* Fix LINT error.

* Make disk config optional to not break existing installations.

* Change state handling as per request by @fabaff.
2017-10-21 20:45:53 +02:00
Marcelo Moreira de Mello
51a65ee8e9 Introducing Ring Door Bell Camera (including StickUp cameras) and WiFi sensors (#9962)
*   Extended Ring DoorBell to support camera playback and wifi sensors

   * Bump python-ringdoorbell to version 0.1.6
   * Support to camera playback via ffmpeg
   * Extended ringdoorbell sensors to report WiFi attributes
   * Extended unittests

* Makes lint happy

* Added support to stickup cameras and fixed logic

* Fixed unittests for stickup cameras

* Makes lint happy

* Refactored attributions and removed extra refresh method.
2017-10-21 16:08:40 +02:00
Martin Eberhardt
222cc4c393 Add optional attribute option to scrape sensor (#10001)
* Add optional attribute option to scrape sensor

* Rename attribute variable to attr
2017-10-21 16:03:29 +02:00
Pascal Vizeli
ce1a2cc2a6 Remove async_update (#9997) 2017-10-21 09:45:05 +02:00
Fabian Affolter
aab7442cc5 Upgrade gitterpy to 0.1.6 (#9983) 2017-10-20 20:28:34 +02:00
Fabian Affolter
4f1eab138c Upgrade speedtest-cli to 1.0.7 (#9984) 2017-10-20 20:28:11 +02:00
Kamil Warguła
53df3fadd7 Update screenshot-components.png file. (#9987) 2017-10-20 20:26:34 +02:00
William Scanlon
41c2bdb4fb Moved siren to Wink from switch (#9879) 2017-10-20 10:18:32 -04:00
Lewis Juggins
d16c5f9046 [tradfri] Update pytradfri, simplify dependencies. (#9875)
* Update pytradfri

* Process dep links

* Process dep links

* Process dep links

* Install all deps

* Update requirements

* Exclude aiocoap

* Install cython

* Remove cython

* Exclude DTLSSocket

* Add cython
2017-10-19 23:20:33 -07:00
TopdRob
29d4dca56a Update requests requirement (#9876)
* Update request requirement

Update request requirement from version v2.14.2 to v2.18.4

* Fix dependency vizio integration

3rd patry packages were removed from requests. Changed dependency from requests to urllib3

* forgot =

forgot = when adding the requirement

* re-run script/gen_requirements_all.py

re-run script/gen_requirements_all.py

* Unvendoring urllib3 from requests

In v2.16.0 and newer of requests they unverdored urllib3.

* undefined name 'InsecureRequestWarning'

* Removed requirement to 'urllib3==1.22

* removed import requests

* removed urllib3.exceptions.InsecureRequestWarning

removed urllib3.exceptions.InsecureRequestWarning travis lint
2017-10-19 19:24:49 -07:00
Paulus Schoutsen
9722125234 Version bump to 0.56 2017-10-19 09:01:03 -07:00
boltgolt
78c302855a Add Toon support (#9483)
* Added Toon support again

* Forgot about .coveragerc

* Fixed style issues

* More styling and importing fixes

* Implemented the suggestions made by @pvizeli

* The smallest fix possible

* Removed custom names for Toon states

* Fix last push with 2 outdated lines

* Removed HOME and NOT_HOME, moved to just climate states

* Bumped dependency for better handling of smartplugs that don't report power consumption

* Implemented changes as suggested by @balloob

* Rebase, gen_requirements_all.py finally working
2017-10-19 08:59:57 -07:00
Pascal Vizeli
c1b197419d Fix async probs (#9924)
* Update entity.py

* Update entity_component.py

* Update entity_component.py

* Update __init__.py

* Update entity_component.py

* Update entity_component.py

* Update entity.py

* cleanup entity

* Update entity_component.py

* Update entity_component.py

* Fix names & comments / fix tests

* Revert deadlock protection

* Add tests for entity

* Add test fix name

* Update other code

* Fix lint

* Remove restore state from template entities

* Lint
2017-10-19 10:56:25 +02:00
Paulus Schoutsen
6cce934f72 Improve SSL certs used by aiohttp (#9958)
* Improve SSL certs used by aiohttp

* Add certifi package

* Lint
2017-10-19 10:47:57 +02:00
Pascal Vizeli
38cb32afd6 Update ffmpeg 1.9 (#9963) 2017-10-19 10:46:32 +02:00
Pascal Vizeli
c96c283293 Update ffmpeg.py 2017-10-19 10:36:09 +02:00
Pascal Vizeli
2fb4709a94 Update requirements_test_all.txt 2017-10-19 10:35:45 +02:00
Joe Lu
42f450d4e6 Use default clientsession to stream synology video (#9959) 2017-10-19 07:02:43 +02:00
Sean Gollschewsky
6ea866c7f7 Add emeter attributes (#9903)
* Add emeter attributes.

* Remove unused attributes.

* Rework supported features so it only queries the bulb once.

* Used cached supported_features, catch errors if energy usage not reported.
2017-10-18 21:52:44 -07:00
Daniel Perna
429b637885 Upgraded pyhomematic (#9956) 2017-10-19 01:31:25 +02:00
Alok Saboo
f05a8bfa2a Update fritzconnection to 0.6.5 (#9950) 2017-10-18 20:58:26 +02:00
Alok Saboo
96e3dfeb53 Update fritzhome to 1.0.3 (#9951) 2017-10-18 20:57:53 +02:00
Alok Saboo
520de0d278 Update hikvision to 1.2 (#9953) 2017-10-18 20:57:13 +02:00
Alok Saboo
2cacfb5477 Update enocean to 0.40 (#9949) 2017-10-18 19:04:44 +02:00
Alok Saboo
4960892256 Update directpy to 0.2 (#9948) 2017-10-18 19:04:01 +02:00
Fabian Affolter
834d0e489e Move 'lights' to const.py (#9929) 2017-10-18 18:41:14 +02:00
Derek
1e1d593ef7 Changed returned attribute from "Game" to "game" (#9945)
I noticed the steam component "game" attribute is capitalized. This should be lowercase if I'm not mistaken.

From:
        return {'Game': self._game}
To:
        return {'game': self._game}

Not sure if i'm doing this correctly... apologizes if I'm not!
2017-10-18 18:27:02 +02:00
Pascal Vizeli
8a93cc147a FFmpeg 1.8 (#9944)
* Update requirements_all.txt

* Update requirements_test_all.txt

* Update ffmpeg.py

* Update ffmpeg.py

* Update yi.py

* Update onvif.py

* Update yi.py
2017-10-18 17:11:22 +02:00
Ludovic
628b9bd8d8 notify.xmpp - Add support for MUC (#9931)
* Add support for MUC

* Fix two spaces before inline comment
2017-10-18 16:28:37 +02:00
Daniel Welch
1bec2c005d using defusedxml ElementTree for safer parsing of untrusted XML data (#9934)
* using defusexml ElementTree for safer parsing of untrusted XML data

* move from core dependency to platform specific dependency

* style difference: put back end of list comma in setup.py
2017-10-18 16:21:46 +02:00
Daniel Høyer Iversen
587948ec06 Xiaomi config validation (#9941)
* validate xiaomi config

* Update xiaomi_aqara.py

* check for valid config

* use consts
2017-10-18 14:57:27 +02:00
Hugo Dupras
f641a6aad3 Fix missing timeout for Netatmo binary sensor (#9850)
* Fix missing timeout for Netatmo binary sensor

This fix also merges timeout and offset because there were the same thing

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* Fix lint errors

* Fix style
2017-10-18 14:56:24 +02:00
jbarrancos
a1d5daee53 Merge pull request #7 from jbarrancos/rainbird
Fixed comments from @fabaff
2017-10-18 12:58:04 +02:00
Fabian Affolter
8a2134b3a8 Add serial sensor (#9861)
* Add serial sensor

* Rename config variable and cancel
2017-10-18 11:20:19 +02:00
PeteBa
c06d92900a Align away state tag with device_trackers (#9884) 2017-10-18 11:19:09 +02:00
J.J.Barrancos
a628112e4c lint ws 2017-10-18 11:17:29 +02:00
Egor Tsinko
6e0efbe35e A new platform for controlling Monoprice 6-Zone amplifier (#9662)
* added implementation for monoprice 6-zone amplifier. This implementation is based on and very similar to russoun_rnet implementaion

* updated comments and cleaned up code

* updated comments and cleaned up code

* added unit tests

* removed 'name' attribute from platform schema.

* added monoprice.py to .coveragerc

* fixed lint

* fixed lint errors

* fixed lint errors

* added monoprice to requirements_all.txt

* fixed lint errors again

* implemented change requests

* fixed lint error

* added exception handling to setup_platform()

* replaced catchall with SerialException only

* added myself to CODEOWNERS

* fixed weird merge to CODEOWNERS
2017-10-18 11:11:36 +02:00
J.J.Barrancos
778761ebce lint error 2017-10-18 10:40:38 +02:00
J.J.Barrancos
76a3a4892d Fix req 2017-10-18 10:18:37 +02:00
TopdRob
bef4ae3e35 Update aioimaplib from v0.7.12 to v0.7.13 (#9930)
* Update aioimaplib from v0.7.12 to v0.7.13

Changelog v0.7.13:
[aiolib] adds a connection lost callback [test] imapserver : added APPENDUID response for APPEND cmd [test][fix] imapserver append should add to the connected user mb [test] imapserver : more accurate building of message headers (using python email module)

* run script/gen_requirements_all.py
2017-10-18 10:00:00 +02:00
Alok Saboo
818a52508e Bump py-synology to 0.1.5 (#9932) 2017-10-18 09:58:49 +02:00
J.J.Barrancos
02f8779de8 Fixed comments from @fabaff
Fxied issues raides
2017-10-18 09:58:32 +02:00
TopdRob
33f8ca5abc update async_timeout from v1.4.0 tp v2.0.0 (#9938) 2017-10-18 09:48:00 +02:00
Paulus Schoutsen
3700fce859 Allow flexible relayer url (#9939) 2017-10-17 23:00:36 -07:00
Phil Kates
9d20a53d63 Google Actions for Assistant (#9632)
* http: Add headers key to json[_message]

* Add google_assistant component

This component provides API endpoints for the Actions on Google Smart
Home API to interact with Google Assistant.

* google_assistant: Re-add fan support

* google_assistant: Fix Scene handling

- The way I originally wrote the MAPPING_COMPONENT and the way it's actual
  used changed so the comment was updated to match that.
- Use const's in more places
- Handle the ActivateScene command correctly

* google_assistant: Fix flakey compare test

Was failing on 3.4.2 and 3.5, this is more correct anyway.

* google_assistant: Use volume attr for media_player
2017-10-17 22:00:59 -07:00
mclem
1d68777981 Add transmission sensor: number of active torrents (#9914)
* Add transmission sensor: number of active torrents

* Make variable name shorter
2017-10-17 22:45:37 +02:00
cgtobi
f5b305c980 Fix the resource naming in the UI (#9927)
Use proper English for the UI representation without breaking the component.
2017-10-17 21:32:01 +02:00
Daniel Høyer Iversen
382f9a8f49 Update xiaomi_aqara.py (#9920) 2017-10-17 18:04:19 +02:00
cgtobi
778c3bb83d Fix the resource naming in the UI (#9916)
Use proper English for the UI representation without breaking the component.
2017-10-17 14:07:05 +02:00
Eugenio Panadero
e57d0f345e Recorder: Extra check to incoming connections which could be not sqlite3 ones (#9867)
* Extra check to incoming connections

The incoming connection could be other than self.db_url, because
some 'custom_component' could be making these, and then, if they're not
sqlite3 connections, an error will raise because those haven't the
`dbapi_connection.isolation_level` attrib.

* lint fix

* simplify check: isinstance test only
2017-10-17 10:06:49 +02:00
Oliver
ed70fc9322 Added support for Denon AVR-4810. (#9887) 2017-10-17 10:04:35 +02:00
Daniel Høyer Iversen
82c7195484 add last_action for xiaomi cube (#9897) 2017-10-17 10:03:46 +02:00
Aaron Bach
9be7763144 Fixes (#9911) 2017-10-17 10:02:03 +02:00
Eugenio Panadero
875edef3f0 Fix load of components without any config from packages (#9901)
* Fix load of components without any config from packages

- Add 'None' to the packages config schema validation, to be able to
load components without any more configuration from yaml package files,
like `wake_on_lan`, `media_extractor` and so on.

* test the ability to load components without configuration from packages
2017-10-17 09:59:33 +02:00
Aaron Bach
3de95c068a Fixes (#9912) 2017-10-17 09:24:52 +02:00
Bahnburner
51c5534c2a Update osramlightify.py (#9905) 2017-10-16 22:09:19 +02:00
Sergey Isachenko
d95b75a10c Dependemcy version bump. (#9899)
Closes #8213.
Closes #7575.
2017-10-16 21:46:21 +02:00
Pascal Vizeli
1f25aa74dd Release 0.55.2 (#9904)
* Do not auto-install credstash (#9844)

* Pump release to 0.55.2
2017-10-16 21:01:25 +02:00
William Scanlon
5986d9ff5b Added super attributes to Wink binary sensors (#9824)
* Added super attributes to Wink binary sensors

* Removed unused import.
2017-10-16 14:58:23 +02:00
Jeroen ter Heerdt
eb6fb5549f Changing clicksendaudio to clicksend_tts in .coveragerc (#9900) 2017-10-16 13:46:24 +02:00
Russell Cloran
7596ac23fc zha: Update to bellows 0.4.0 (#9890)
Fixes: #8822
2017-10-15 21:41:16 -07:00
Julius Mittenzwei
c37883c9a9 Xknx improvements (#9871)
* Issue https://github.com/XKNX/xknx/issues/65 Make state_updater adjustable by config file (On/OFF)

* Issue https://github.com/XKNX/xknx/issues/48 updated home assistant plugin: added support for setpoint shift

* bumped version

* added missing docstrings.

* Bumped version.

* Fixed requirements_all.txt

* added new options to PLATFORM_SCHEMA
2017-10-15 23:46:55 +02:00
Paulus Schoutsen
c6b285c666 Merge pull request #9885 from home-assistant/release-0-55-1
0.55.1
2017-10-15 14:30:45 -07:00
Eugenio Panadero
b1dc48822d Upgrade python-telegram-bot to 8.1.1 (#9882)
* update python-telegram-bot to v8.1.1

* update python-telegram-bot to v8.1.1
2017-10-15 21:22:51 +02:00
Philipp Schmitt
ff6f5cc116 Fix #9839 (#9880)
* Fix #9839

* Update requirements

* Default state: STATE_UNKNOWN -> None

* Default the state to None in the constructor as well
2017-10-15 12:20:22 -07:00
Philipp Schmitt
da8be253bc Fix #9839 (#9880)
* Fix #9839

* Update requirements

* Default state: STATE_UNKNOWN -> None

* Default the state to None in the constructor as well
2017-10-15 21:16:23 +02:00
Adam Cooper
2547a235c1 Bugfix/9811 jinja autoescape (#9842)
* Added autoescape kwarg to Jinja environment

* Removed extra comma
2017-10-15 11:53:27 -07:00
Adam Cooper
fdb698bef0 Changed yaml.load into yaml.safe_load (#9841) 2017-10-15 11:53:26 -07:00
Paulus Schoutsen
586e54f8bf OwnTracks: Fix handler is None checking (#9794)
* OwnTracks: Fix handler is None checking

* Update owntracks.py
2017-10-15 11:53:25 -07:00
Lewis Juggins
431201cb9b [light.tradfri] Fix transition time (#9785)
* Fix transition time, set a default

* Wrong default

* Use int for safety

* Revert default.
2017-10-15 11:53:25 -07:00
pascal
9b43388093 missing is_closed ( rflink cover fix ) (#9776)
* Added is_closed

* whitespaces --

* removed whitespace
2017-10-15 11:53:24 -07:00
Joe Lu
45620d6892 Fix for TypeError in synology camera (#9754) 2017-10-15 11:53:24 -07:00
Paulus Schoutsen
7ed21d90aa Version bump to 0.55.1 2017-10-15 11:51:21 -07:00
Fabian Affolter
959a7b2d59 Upgrade paho-mqtt to 1.3.1 (#9874) 2017-10-15 10:12:43 -07:00
Eugenio Panadero
ac256d5943 handle OWM API error calls (#9865) 2017-10-15 10:31:34 +02:00
Paulus Schoutsen
0362a76cd6 Cloud connection via aiohttp (#9860)
* Cloud: connect to cloud

* Fix tests in py34

* Update warrant to 0.5.0

* Differentiate errors between unknown handler vs exception

* Lint

* Respond to cloud message to logout

* Refresh token exception handling

* Swap out bare exception for RuntimeError

* Add more tests

* Fix tests py34
2017-10-14 19:43:14 -07:00
Eugenio Panadero
26cb67dec2 minimal fixes in the owntracks mqtt device tracker (#9866)
* fix UnboundLocalError when unable to parse payload, and show bad topics that cannot be parsed ok

* Update owntracks.py
2017-10-14 15:46:06 -07:00
Fabian Affolter
00244380a8 Upgrade psutil to 5.4.0 (#9869) 2017-10-14 23:07:31 +02:00
Ryan Bahm
f807a3a890 Darksky enhancements (#9851)
* Correct capitalization inconsistency in DarkSky

All two-word sensors ("Precip Intensity," "Nearest Storm Bearing," etc) in Darksky uses title case for the friendly name of the sensor, with the exception of "Dew point."

* Implement UV Index in Darksky

* Fixed whitespace for Tox compliance

* Add unit for UV Index.

Per recommendation of reviewer, added 'UV Index' as a CONST in const.py, then used that const in both DarkSky and ISY994. It looks like BloomSky might also support UV Index and it should probably be standardized.
2017-10-14 14:45:32 -04:00
Kevin Fronczak
fd6c2598a7 Uptime sensor (#9856)
* Added uptime sensor for homeassistant

* Fixed pylint and flake8 errors

* Made requested changes from PR

- Fixed stale docstrings
- Changed default state to None
- Added ability for user to use hours or days

* Fixed typo

* Added unit_of_measurement check to test

* Converted to async

- Changed tests to work with async

* Minor updates
2017-10-14 20:06:44 +02:00
Fabian Affolter
79d1a0ab37 Upgrade youtube_dl to 2017.10.12 (#9862) 2017-10-14 19:07:28 +03:00
Jeroen ter Heerdt
a787ab6d3c Changing name of clicksendaudio component to clicksend_tts (#9859) 2017-10-14 15:08:28 +02:00
Pascal Vizeli
8456cd0313 HassIO - TimeZone / Host services (#9846)
* HassIO - TimeZone / Host services

* Update hassio.py

* Update test_hassio.py
2017-10-13 15:45:22 +02:00
Charles Garwood
fa37d9800e File permissions fix (#9847)
* Fixing file permissions

* Fixing file permissions
2017-10-13 14:22:41 +02:00
icovada
80826bc985 Add CAPSman master to mikrotik presence detection (#9729)
* Add CAPSman master to mikrotik presence detection

Automatically prefer caps-man registered clients over locally connected

* Remove blank line

* Trailing whitespace removed
2017-10-13 10:54:58 +02:00
rbflurry
b00d0a1253 Use the Last Seen attribute in unify (#8998)
* Uses the Last Seen attribute in unify

* Update unifi.py

fix format

* Update unifi.py

formatting again

* update test_unifi to call CONF_CONSIDER_HOME

Updated.

* Update test_unifi.py

* Update test_unifi.py

* More unit test test

* Update where consider_home comes from.

* Update test_unifi.py

* Update unifi.py

* Update unifi.py

* Update test_unifi.py

* Update unifi.py

* Update unifi.py

* Update test_unifi.py

* fix hound

* Update test_unifi.py

* Update test_unifi.py

* Update unifi.py

* Update unifi.py

* Update test_unifi.py

* Update unifi.py

* Update unifi.py

* Update test_unifi.py

* Update unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update unifi.py

* Update unifi.py

* Update unifi.py

* Update unifi.py

* Update test_unifi.py

Fix the butcher of tests.

* Update unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update unifi.py

* Update unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update test_unifi.py

* Update unifi.py

* Update test_unifi.py

* Update unifi.py

* Update unifi.py

* Update unifi.py

* Update unifi.py
2017-10-13 10:13:58 +02:00
Paulus Schoutsen
f7545fe85c Remove namecheap dns service (#9845) 2017-10-13 09:47:13 +02:00
Martin Treml
c69e9c1d49 Add namecheap DNS component (#9821)
* Add namecheap DNS component

* Updates for pull-request

* remove unused import in test file

* Update .coveragerc
2017-10-12 23:58:23 -07:00
Paulus Schoutsen
79b029a680 Do not auto-install credstash (#9844) 2017-10-12 23:57:45 -07:00
Aaron Bach
9891320e7c New PR (#9787) 2017-10-12 22:20:30 -07:00
Adam Cooper
64853bae32 Changed yaml.load into yaml.safe_load (#9841) 2017-10-12 22:05:33 -07:00
Adam Cooper
a7f4bcc410 Bugfix/9811 jinja autoescape (#9842)
* Added autoescape kwarg to Jinja environment

* Removed extra comma
2017-10-12 22:01:29 -07:00
Lukas Barth
bbb406626b Bugfix: Include MQTT schema (#9802) 2017-10-12 22:00:09 -07:00
Charles Garwood
c5c594ba7d Add service descriptions (#9806)
* Added descriptions for services under homeassistant domain

* lint fixes

* Fixing file permissions
2017-10-12 21:59:07 -07:00
Adam Mills
8d83912649 Run initial generation for development mode (#9826)
* Run initial generation for development mode

* Use yarn dev
2017-10-12 21:56:38 -07:00
Teemu R
2c1f0f3449 fix climate services (missing indentation, wrongly formatted example) (#9805) 2017-10-12 21:29:17 +03:00
Kane610
c85b5561ee Update CODEOWNERS */axis.py (#9823)
Add code owner for */axis.py
2017-10-12 21:26:07 +03:00
Alan Fischer
4cf300a710 Fixed reporting of vera UV sensors (#9838) 2017-10-12 20:51:25 +03:00
Fabian Affolter
3bdb7052b8 Upgrade libnacl (#9769)
* Upgrade libnacl to 1.6.0

* Small style updates
2017-10-12 18:13:43 +02:00
Paulus Schoutsen
3b5a9e7796 OwnTracks: Handle lwt message (#9831)
* OwnTracks: Handle lwt message

* Update owntracks.py
2017-10-12 08:25:18 -07:00
Charles Garwood
5fcb0990c3 Adds image attribute to html5 notify (#9832) (#9835) 2017-10-12 17:01:12 +02:00
cdce8p
be5c0b2d92 Wait_template - support for 'trigger.entity_id' and data_template values (#9807)
* *Added support for use of 'trigger.entity_id' and service->data_template->script in wait_template

* * Fixed style violations

* * Fixed regular expression (_RE_GET_POSSIBLE_ENTITIES)

* * combined 'extract_entities' and 'extract_entities_with_variables'
* fixed regular expression

* * Added first test for extract_entities_with_variables

* * Added Unittests (tests/helpers/test_template.py test_extract_entities_with_variables)

* * Added Unittests (tests/helpers/test_script.py test_wait_template_variables)

* * Added Unittests (tests/components/automation/test_template.py test_wait_template_with_trigger)

* * Added Unittests (tests/components/automation/test_state.py test_wait_template_with_trigger)

* * Added Unittests (tests/components/automation/test_numeric_state.py test_wait_template_with_trigger)

* * Fixed style violations

* * Fixed style violations

* * Fixed style violations

* * Fixed style violations

* * Fixed style violations

* * Fixed style violations

* * Updated regular expression and delete whitespaces
2017-10-12 16:57:18 +02:00
jbarrancos
38e02a057d Merge pull request #6 from jbarrancos/rainbird
Removed requirement
2017-10-12 10:43:35 +02:00
J.J.Barrancos
fad9e607c3 Removed requirement 2017-10-12 10:22:22 +02:00
Paulus Schoutsen
c33b179fb8 Fix ISY994 fan platform overwriting state property (#9817)
* ISY994 platform overwrote state

* Update isy994.py

* Update isy994.py
2017-10-12 00:36:24 -07:00
Adam Mills
765560e87a Restore home-assistant-polymer pointer from #9720 (#9825) 2017-10-11 21:53:12 -04:00
Charles Garwood
f837302194 Split map panel out into its own component (#9814) 2017-10-11 17:45:55 +02:00
jbarrancos
47d8601f30 Merge pull request #5 from jbarrancos/rainbird
Rainbird
2017-10-11 17:24:07 +02:00
J.J.Barrancos
bddb424b0d Requirements updated 2017-10-11 17:01:14 +02:00
J.J.Barrancos
8db4b4f303 typo 2017-10-11 16:54:08 +02:00
J.J.Barrancos
cc4ec228b5 Removed requirement 2017-10-11 16:12:01 +02:00
jbarrancos
c6e6496000 Merge pull request #4 from jbarrancos/dev
Merge in latest
2017-10-11 16:05:54 +02:00
jbarrancos
2c9010d661 Merge pull request #3 from home-assistant/dev
Get latest
2017-10-11 16:04:37 +02:00
J.J.Barrancos
24826c2770 Revert "Dependency breaks build"
This reverts commit c1aaed250a.
2017-10-11 16:02:32 +02:00
J.J.Barrancos
c1aaed250a Dependency breaks build 2017-10-11 16:01:25 +02:00
J.J.Barrancos
59fcef39ff Split requirements per line 2017-10-11 15:56:18 +02:00
J.J.Barrancos
d0ff45500b Fixed dependency version 2017-10-11 15:45:07 +02:00
J.J.Barrancos
0ace832166 Requirements updated 2017-10-11 15:35:58 +02:00
Fabian Affolter
19887f8742 Upgrade pyasn1 to 0.3.7 and pyasn1-modules to 0.1.5 (#9810) 2017-10-11 16:26:34 +03:00
J.J.Barrancos
7f97d166bf Added dependency on pycrypto
Crypto Dependency missing found on virtualenv install. Added to dependecy rainbird.py
2017-10-11 15:15:50 +02:00
Adam Cooper
0de2266a72 Resolving bug that prevents ssl_verify option for Unifi device_tracker (#9788)
* Added TODO to illustrate my intentions

* Resolved linting issue

* Resolved bool or file validation and updated tests

The tests have been updated to include mocks to assert a temp
ca cert exists as it should for the positive tests with an
additional negative test for a file not existing being tested.

* Resolved flake8 linting issues (test docstrings)
2017-10-11 00:08:36 +02:00
Paulus Schoutsen
8f06b35dfc Optimize event matcher (#9798)
* Optimize event matcher

* Tweak order of checks

* Add a benchmark for time_changed helper

* Add state change benchmark

* fix lint
2017-10-10 22:26:03 +02:00
Paulus Schoutsen
a97e7bb22d Simplify track_same_state (#9795) 2017-10-10 21:16:19 +02:00
Paulus Schoutsen
fc47e9443b OwnTracks: Fix handler is None checking (#9794)
* OwnTracks: Fix handler is None checking

* Update owntracks.py
2017-10-10 10:39:25 +02:00
Lewis Juggins
e144b0f0f9 [light.tradfri] Fix transition time (#9785)
* Fix transition time, set a default

* Wrong default

* Use int for safety

* Revert default.
2017-10-10 00:35:28 -07:00
ziotibia81
a024c1b162 Communication timeout support in modbus hub. (#9780)
* Communication timeout support in modbus hub.

Timeout parameter are taken from configuration and passed to pymodbus constructor.

* CONF_TYPE and CONF_TIMEOUT imported from const.py
2017-10-09 23:51:18 +02:00
Sean Dague
581e2f22d5 Bump rxv library to 0.5.1 (#9784)
This fixes some bugs with interfacing with yamaha receivers, including
closing bug #5209.
2017-10-09 17:58:53 +02:00
William Scanlon
5232f2abdd Wink dome siren support (#9667)
* Support for Wink Dome siren/chimes
2017-10-09 11:16:36 -04:00
pascal
cb52b80f7d missing is_closed ( rflink cover fix ) (#9776)
* Added is_closed

* whitespaces --

* removed whitespace
2017-10-09 16:57:44 +02:00
Sean Dague
d0ec9301ab Fix off by one error in arwn platform (#9781)
There is an off by one error that causes period exceptions. Fix this.
2017-10-09 15:41:18 +02:00
Sergey Isachenko
9abd0fb92f Tesla bug fixes. (#9774)
* Tesla bug fixes.

* Added myself to CODEOWNERS for tesla.
2017-10-09 14:38:00 +03:00
Aaron Bach
43d77729c5 WIP: Fix Arlo Camera blocking IO (#9758)
* WIP: Fix Arlo Camera blocking IO

* Accidental undo

* Linting issues

* Owner-requested changes

* Bumped pyarlo version and added Throttle

* Fix

* Update requirements_all.txt
2017-10-09 11:35:05 +02:00
Jeroen ter Heerdt
04b3c89cf5 Adding myself as codeowner for egardia alarm control panel. (#9772)
Adding jeroenterheerdt as codeowner for egardia alarm control panel.
2017-10-09 11:52:51 +03:00
Jeroen ter Heerdt
09e2075c68 Updating pythonegardia package requirement to .22 because of fixed bug in passing default value for parameter SSL for egardiaserver (#9770) 2017-10-09 10:37:51 +02:00
Rob Connolly
3bd9684ca5 Add notification platform for Rocket.Chat. (#9553)
* Add notification platform for Rocket.Chat.

* Changes to Rocket.Chat notification platform based on feedback.

* Implement better error handling for Rocket.Chat platform.

* Return None if Rocket.Chat notify platform init fails.

* Refactor Rocket.Chat notifications.

Refactor Rocket.Chat notification platform to remove async and
simplify error handling.

* fix url
2017-10-09 09:38:48 +02:00
Paulus Schoutsen
414900fefb Expose time module in Python Scripts (#9736)
* Expose time module in Python Scripts

* Make dt_util available in Python Scripts

* Limit methods in time module

* Add time.mktime

* Limit access to datetime

* Add warning to time.sleep

* Lint
2017-10-09 08:51:32 +02:00
Egor Tsinko
35484ca086 fix for LocationParseError in netgear platform (#9683)
* fix for LocationParseError in netgear platform

* added unit tests for get_scanner()

* fixed houndci-bot warnings

* fixed lint warnings

* fixed lint warnings

* fixed broken test

* removed guard clause from netgear.py
removed all discovery related code from device_tracker
removed unnecessary unit test

* removed discovery related tests

* removed unused import

* removed unused import
2017-10-08 22:14:39 -07:00
Sebastian Muszynski
603765fe92 Xiaomi Smart WiFi Socket and Smart Power Strip integration (#9138)
* Xiaomi Smart WiFi Socket and Smart Power Strip integration

* Comment updated.

* Blank line removed.

* Typo fixed.

* Version of python-mirobo bumped.

* Version of python-mirobo bumped: Lightweight API changes.

* Additional API changes.

* Library version properly pinned again.

* Platform not ready behavior fixed.
Expose the device model as sensor attribute.
Device initialized log message added. Provides device model, firmware and hardware version.

* Component renamed: switch.xiaomi_plug -> switch.xiaomi_miio

* Revise based on review: Unused code removed. Filename updated.
2017-10-08 22:11:11 -07:00
Marcelo Moreira de Mello
80140732c3 Bump raincloudy version 0.0.3 (#9767)
* Bump raincloudy version 0.0.3

* Fix logic for raincloudy status binary_sensor

* Simplified binary_sensor logic

* Simplify
2017-10-08 21:08:40 -07:00
Teemu R
c00647ace0 yeelight: implement min_mireds and max_mireds, fixes #9509 (#9763)
* yeelight: implement min_mireds and max_mireds, fixes #9509

thanks to @amelchio for pointing this out!

* remove typing infos
2017-10-08 21:05:49 -07:00
Andrey
2a2ee81957 Match test requirements by full package name. (#9764) 2017-10-08 20:49:51 -07:00
ChristianKuehnel
b620c433c0 Initializing statistics sensor with data from database (#9753)
* Initializing statistics sensor with data from database

* fixed broken test case

* usage of recorder component is now optional, thx to @andrey-git

* added test case for initialize_from_database
2017-10-08 23:45:12 +02:00
Aaron Bach
b80f00900d Adding my contributions (#9761) 2017-10-08 22:56:58 +02:00
Daniel Høyer Iversen
a32fc10f1b Update CODEOWNERS (#9760) 2017-10-08 22:32:42 +02:00
Teemu R
672ff96754 add myself to yeelight owners, too (#9759) 2017-10-08 22:36:17 +03:00
Mister Wil
8132989f91 Skybell (#9681)
* New Skybell platform with components

* Added skybell components to omit.

* Preemptively fixing lint issues (hopefully).

* Removed unused variable.

* Requested changes.

* Additional CRs

* Hopefully the last of the CR's!
2017-10-08 20:14:39 +02:00
Paulus Schoutsen
ca54bbfcc9 RFC: Use bind_hass for helpers (#9745)
* Add Helpers bind_hass functionality

* Update other helpers
2017-10-08 08:17:54 -07:00
Teemu R
e19e9a1f2b switch.tplink, light.tplink: bump the pyhs100 version and adapt to api changes (#9454)
* bump the pyhs100 version and fix api changes

* switch.tplink: avoid I/O during __init__

* initialize _name to None in __init__

* update requirements_all.txt for the new version
2017-10-08 17:31:32 +03:00
Joe Lu
e89e64263c Fix for TypeError in synology camera (#9754) 2017-10-08 13:31:00 +03:00
Marcelo Moreira de Mello
f56bdd29ff Make Arlo battery_level icon dynamic (#9747)
* Make Arlo battery_level icon dynamic

* makes lint happy
2017-10-08 10:05:41 +02:00
Paulus Schoutsen
9eff9fa703 Fix I/O in event loop by Arlo alarm control panel (#9738) 2017-10-08 09:26:16 +02:00
Pascal Vizeli
c1f156fd2b Rewrite Alexa Smart-Home skill to v3 (#9699)
* Rewrite Alexa Smart-Home skill to v3

* add discovery & fix brigness

* Rewrite Tests

* fix lint

* fix lint p2

* fix version

* fix tests

* fix test message generator

* Update smart_home.py

* fix test

* fix set bug

* fix list

* fix response name for discovery

* fix flucky tests
2017-10-07 13:31:57 -07:00
Adam Mills
4342d7aa17 Event trigger nested conditions (#9732)
* Test to supported nested event triggers

* Update event trigger to allow nested data tests
2017-10-07 13:13:32 -07:00
Paulus Schoutsen
8a2d7a3e11 Merge pull request #9704 from home-assistant/release-0-55
0.55
2017-10-07 12:50:52 -07:00
Ryan McLean
af3ea5a321 Fix: Last Played Media Title persists in plex (#9664)
* Fix: Last Played Media Title in plex would stay even when player was idle/off
     Primary Fix is in the "if self._device" portion.
     code in "if self._session" is a catch all but i'm not 100% if it is needed.

* Fixed lint issues with previous commit

* 1st Pass at refactoring plex refresh
Moved _media** into clearMedia() which is called in _init_ and
at start of refresh.

Removed redunant _media_* = None entries

Grouped TV Show and Music under single if rather than testing
seperately for now.

* Fixed invalid name for _clearMedia()
Removed another media_* = None entry

* Removed print() statements used for debug

* Removed unneeded "if" statement
2017-10-07 15:31:01 -04:00
Lewis Juggins
de4f610540 [light.tradfri] Clone all of aiocoap to ensure pinned commit will be present (#9713) 2017-10-07 18:28:55 +02:00
Paulus Schoutsen
770f8bd1c3 Fix coap commit (#9712) 2017-10-07 18:28:55 +02:00
Paulus Schoutsen
1ab942e0a2 Deprecate Python 3.4 support (#9684)
* Deprecate Python 3.4 support

* Update text
2017-10-07 18:28:50 +02:00
Andrey
c09b7b5d6d Add andrey-git to codeowners (#9718) 2017-10-07 17:58:45 +02:00
Lewis Juggins
710454119f [light.tradfri] Clone all of aiocoap to ensure pinned commit will be present (#9713) 2017-10-07 08:54:51 -07:00
Fabian Affolter
25e6d694e1 Bump release to 0.56.0dev (#9726) 2017-10-07 16:07:49 +02:00
Fabian Affolter
19a20b3b13 Move 'show_on_map' to const (#9727) 2017-10-07 15:11:41 +02:00
Aaron Bach
bd5b70c3cd Add show_on_map config option to AirVisual (#9654)
* Removed lat/long attributes

* Linting

* Revised PR to focus on show_on_map configuration
2017-10-07 13:38:52 +02:00
Marcelo Moreira de Mello
ec5439e4d4 Introducing support to Travis-CI (#9701)
* Introduced support to Travis CI

* Added Last Build Started sensor and simplified code

* Fixed logic error

* Simplified _LOGGER.debug statement

* Introduced support to Travis CI

* Added Last Build Started sensor and simplified code

* Fixed logic error

* Simplified _LOGGER.debug statement

* Renamed parameter since the repository_names expects a list

* Refactoring code to synchronous

* Simplified variables names
2017-10-07 11:02:40 +02:00
Fabian Affolter
fd509e188a Arlo clean-up (#9725)
* Fix remaining isses from #9711

* More clean-up
2017-10-07 10:59:46 +02:00
Mister Wil
a5a839e72a Abode Temp, Humidity, and Light Sensor (#9709)
* Update to 0.12.1 and sensor implementation.

* Removing unnecessary dict gets.

* Added name property to actually use the _name variable.

* Update docstring
2017-10-07 10:25:53 +02:00
Vignesh Venkat
3b53952dbe arlo: Add alarm control panel component (#9711)
* arlo: Add alarm control panel component

Allows importing arlo base stations as an alarm control panel
component in HA. Lets the users configure a custom home mode since
arlo does not have a built-in home mode.

* fix lint and houndci comments

* Use async_update to update the state

Move the state updating code from state() to update() since it does
I/O.

* Do not set state in __init__

Make sure that update is called by passing the second parameter to
async_add_devices.

* Order imports and fix dos-strings
2017-10-07 10:07:38 +02:00
Fabian Affolter
e502202de7 Upgrade pysnmp to 4.3.10 (#9722) 2017-10-07 09:47:52 +02:00
Kevin Fronczak
2479ce9123 More netdata sensors (#9719)
* Added more netdata sensors

* Changed precision on counts, packets, and uptime
2017-10-07 00:22:40 +02:00
Teemu R
d3772d4abd bump the version and catch all exceptions to avoid showing backtraces… (#9720)
* bump the version and catch all exceptions to avoid showing backtraces but a more sane error message

* catch only BTLEExceptions, fix logging strings
2017-10-07 00:21:34 +02:00
jbarrancos
e9f36a7e45 Merge pull request #2 from jbarrancos/rainbird
Limited to switch on/off
2017-10-06 15:38:37 +02:00
J.J.Barrancos
f036bf9353 Limited to switch on/off
Limited to switch on/off
Lowered loglevel
2017-10-06 15:22:22 +02:00
Daniel Perna
f4679cc870 Upgrade pyhomematic, add path setting and HM-CC-VG-1 support (#9707)
* Bump pyhomematic, add path setting, HM-CC-VG-1 support

* Added requirement
2017-10-06 11:09:50 +02:00
Marcelo Moreira de Mello
7b116b0207 Updating helper's icon_for_battery_level location (#9594) 2017-10-06 09:17:18 +03:00
Paulus Schoutsen
ffb19381f1 Deprecate Python 3.4 support (#9684)
* Deprecate Python 3.4 support

* Update text
2017-10-05 21:47:51 -07:00
Paulus Schoutsen
1525cbfb93 Fix coap commit (#9712) 2017-10-05 21:12:49 -07:00
happyleavesaoc
b83059c828 move icon battery function from util to helpers (#9708) 2017-10-05 20:55:19 -07:00
Florian Klien
c7226ec28f fixed duplicate words (#9705) 2017-10-05 21:55:09 +02:00
Paulus Schoutsen
6541e789fb Version bump to 0.55 2017-10-05 09:23:09 -07:00
Paulus Schoutsen
c1b5772f0f Merge remote-tracking branch 'origin/master' into dev 2017-10-05 09:22:49 -07:00
Paulus Schoutsen
6627c352e6 Update frontend 2017-10-05 09:17:26 -07:00
Fabian Affolter
6de403e0ac Support for The Things Network (#9627)
* Support for The Things network's Data Storage

* Rename platform and other changes (async and dict)

* Rename sensor platform and remove check for 200
2017-10-05 09:12:02 -07:00
Paulus Schoutsen
75f902f57e RFC: Create a secrets file and enable HTTP password by default (#9685)
* Create a secret and enable password by default

* Comment out api password secret

* Lint/fix tests
2017-10-05 09:10:29 -07:00
Lewis Juggins
8db4641455 [light.tradfri] async support with resource observation. (#7815)
* [light.tradfri] Initial support for observe

* Update for pytradfri 2.0

* Fix imports

* Fix missing call

* Don't yield from add devices

* Fix imports

* Minor fixes to async code.

* Imports, formatting

* Docker updates, some minor async code changes.

* Lint

* Lint

* Update pytradfri

* Minor updates for release version

* Build fixes

* Retry observation if failed

* Revert

* Additional logging, fix returns

* Fix rename

* Bump version

* Bump version

* Support transitions

* Lint

* Fix transitions

* Update Dockerfile

* Set temp first

* Observation error handling

* Lint

* Lint

* Lint

* Merge upstream changes

* Fix bugs

* Fix bugs

* Fix bugs

* Lint

* Add sensor

* Add sensor

* Move sensor attrs

* Filter devices better

* Lint

* Address comments

* Pin aiocoap

* Fix bug if no devices

* Requirements
2017-10-05 09:05:38 -07:00
Alok Saboo
89042439b8 Fixed typo in opencv (#9697) 2017-10-05 00:04:39 +02:00
Pascal Vizeli
f34ebf733d HassIO replace config changes (#9695)
* Update flow

* fix tests

* Update hassio.py
2017-10-04 18:31:50 +02:00
bestlibre
84271a2dac Refactoring of onewire sensor component (#9691) 2017-10-04 16:35:58 +02:00
Jeroen ter Heerdt
e753c51e34 Updating clicksendaudio component based on feedback (#9692)
* Updating clicksendaudio component based on feedback

* Updating .coveragerc - forgot to add new file clicksendaudio.py
2017-10-04 16:34:37 +02:00
milanvo
65de739489 Fix restore state by filter out null value row from DB query (#9690) 2017-10-04 14:13:58 +02:00
milanvo
3f9d052218 Add recorder purge service, rework purge timer (#9523)
* Add recorder purge service

* Recorder test to match purge config

* Removed purge timer, move service handler to setup, add service description file

* Tests for recorder purge service

* Recorder purge timer rework, add purge service parameter, tests

* Purge service schema change

* Service description change value range

* First cleanup

* Fix name of config
2017-10-04 14:07:42 +02:00
Daniel Høyer Iversen
4314dc251f Add Tibber sensor (#9661)
* Add Tibber sensor

* remove extra space
2017-10-04 10:31:42 +02:00
Johan Bloemberg
e0de521388 Implement DSMR5 support. (#9686)
* Allow configuring DSMR5 protocol.

* Give good example.

* Using dev branch until released upstream.

* Update to dsmr_parser supporting v5 arguments.

* Update to latest dmsr parser, preventing exceptions thrown where warnings would suffice.

* Update even more

* Update requirements.

* Update requirements
2017-10-04 10:20:08 +02:00
Martin Berg
3a282702d9 Fix Google Calendar/oauth2client warning (#9677)
* Fixes oauth2client warning.

* Fix permission.
2017-10-04 10:01:20 +02:00
Jeroen ter Heerdt
7759ae26fd Adding ignore capability to Egardia component (#9676) 2017-10-04 09:59:38 +02:00
Pascal Vizeli
4be91a103d Support new feature to push API data to hassio (#9679)
* Support new featuer to push API data to hassio

* Add tests & services
2017-10-03 22:52:45 -07:00
Alan Fischer
a4b64dec39 Properly handle an invalid end_time (#9675) 2017-10-03 22:51:08 -07:00
BioSehnsucht
3c0d02f057 Rename input_slider to input_number and add numeric text box option (#9494)
* * Rename input_slider to input_number
* Update input_number to optionally display slider, input box, or both

* input_number support either input box or slider mode, but not both

* input_number : change service from select_value to set_value

* input_number : add test for mode setting to tests
2017-10-03 21:34:13 +02:00
FletcherAU
29e973d060 Fix typo in cancel_command description (#9671)
"wasn't going to use it"
2017-10-03 15:24:59 +02:00
Alan Fischer
12b2cfa9b5 Upgrade pyitachip2ir to 0.0.7 (#9669) 2017-10-03 08:17:36 +02:00
Adam Mills
c4810da82f Unit tests to improve core coverage (#9659)
* Code coverage of logging util

* Improve async util coverage

* Add test coverage for restore_state

* get_random_string test
2017-10-02 20:25:04 -07:00
Mister Wil
0aa22d9d91 Bump abode to 0.11.9 (#9660) 2017-10-02 22:55:26 +02:00
Alok Saboo
670bd0ce48 Update google-api-python-client to 1.6.4 (#9658) 2017-10-02 22:42:23 +02:00
Jeroen ter Heerdt
4803721120 Fixed bugs related to exception handling in pythonegardia. Updating package requirement accordingly (#9663) 2017-10-02 22:41:46 +02:00
Matt White
755a2a8291 mqtt_statestream: Add options to publish attributes/timestamps (#9645) 2017-10-02 17:41:07 +02:00
Fabian Affolter
3bd31b91fb Upgrade googlemaps to 2.5.1 (#9653) 2017-10-02 17:17:22 +02:00
Fabian Affolter
25e00556d0 Upgrade influxdb to 4.1.1 (#9652)
* Upgrade influxdb to 4.1.1

* Upgrade influxdb to 4.1.1
2017-10-02 17:17:08 +02:00
Fabian Affolter
8a90ad9e28 Upgrade netdisco to 1.2.2 (#9649) 2017-10-02 17:16:50 +02:00
Fabian Affolter
3f19be9717 Upgrade discord.py to 0.16.12 (#9648) 2017-10-02 17:16:37 +02:00
Fabian Affolter
13fe5857b3 Upgrade youtube_dl to 2017.10.01 (#9647) 2017-10-02 17:16:09 +02:00
Fabian Affolter
5327d2dd1a Upgrade numpy to 1.13.3 (#9646) 2017-10-02 17:15:50 +02:00
Sam Birch
da4048a9ec Add hysteresis attribute to threshold binary sensor (#9596)
* Added hysteresis attribute to threshold binary sensor

* Added threshold binary sensor hysteresis test case

* Changed threshold binary sensor property name to be more self explanatory

* Pulled default hysteresis value into top level declaration

* Fixed linter errors

* Fixed additional linter errors

* Move comment to docs
2017-10-02 17:15:19 +02:00
Vignesh Venkat
b4551cc127 arlo: Add battery level sensor (#9637)
* arlo: Add battery level sensor

Adds a battery level sensor that monitors the battery level on
Arlo cameras.

* Fix lint issue
2017-10-02 12:38:55 +02:00
Michel Weimerskirch
3337107e79 Facebook Messenger notify component: add support for sending messages to specific page user IDs (#9643) 2017-10-02 11:29:31 +02:00
Paulus Schoutsen
f7609e9cb1 Move group services into their own YAML (#9597)
* Move group services into their own YAML

* Fix lint

* Move persistent notification to package
2017-10-01 23:18:10 -07:00
David Byrne
52671842d5 Fixes broken source links in API docs (#9636)
* Fixes broken source links in API docs

* Removes illegal blank line
2017-10-01 23:10:01 -07:00
Gabor SZOLLOSI
fc4a21e491 raspihats: unmet dependency fix (#9638)
* raspihats: update to 2.2.3 (deps fix)

Raspihats platform update, upstream fixed enum34 requirements, added smbus dependency
Fixes #9547

* raspihats: update to 2.2.3, smbus-cffi dependency

Raspihats platform update, upstream fixed enum34 requirements, added smbus dependency
Fixes #9547

* raspihats: update to 2.2.3

* raspihats: update to 2.2.3, smbus-cffi dependency

* raspihats: update to 2.2.3, smbus-cffi dependency

* raspihats: update to 2.2.3 (deps fix)

Raspihats platform update, upstream fixed enum34 requirements, added smbus dependency
Fixes #9547

* raspihats: update to 2.2.3, smbus-cffi dependency
2017-10-01 23:05:24 -07:00
Teemu R
70c8970555 add myself to codeowners (#9642) 2017-10-01 23:04:33 -07:00
Gabor SZOLLOSI
fa32411ab1 wunderground: fix supported language codes #9631 (#9633)
* removed PU, added TR language code (https://www.wunderground.com/weather/api/d/docs?d=language-support&MR=1), fixes #9631
2017-10-01 12:41:21 +02:00
Lukas Barth
29c40622d3 MQTT climate platform [continuation of #8750] (#9589)
* New climate platform with MQTT

* Use STATE_OFF

* Basic tests for climate.mqtt

* lint

* actualy collect coverage

* First tests and fixes

* Add possibility to receive temperature via MQTT

* Require only either sensor or mqtt topic

* Add mqtt publishing for away mode, hold mode and aux heat.

* Use configurabe on/off payloads

* Add pessimistic mode

* Initialize aux and away with False instead of None

* Remove Sensor

* Use correct scheduling method

* Move all methods to coroutines
2017-09-30 16:29:40 +02:00
Phil Kates
80a15977ff splunk: Handle datetime objects in event payload (#9628)
If an event contained a datetime.datetime object it would cause an
exception in the Splunk component. Most of the media_player
components do this in their `media_position_updated_at` attribute.

Use the JSONEncoder from homeassistant.remote instead of just using the
standard json.dumps encoder.

Fixes #9590
2017-09-30 09:35:25 +02:00
Alan Fischer
e406c57ec9 Switched VeraSensor to use category ids (#9624) 2017-09-29 23:34:14 +02:00
Egor Tsinko
9232fa06e4 Fixed away_mode for Ecobee thermostat. (#9559)
* Fixed away_mode for Ecobee thermostat. Now away mode is properly turned on using indefinite away hold.

* fixed lint warnings

* fixed lint warnings

* - now it is possible to use float values for ecobee temperature holds
- fixed a bug that caused an exception when temperature hold was set in away mode
- added unit tests for ecobee thermostat

* fixed lint errors

* fixed lint errors
2017-09-29 16:57:31 +02:00
Jan Almeroth
94370eda54 Yamaha MusicCast: check known_hosts (#9580)
* Yamaha MusicCast: check known_hosts

- pymusiccast: Version bump

* Update requirements
2017-09-29 16:45:25 +02:00
Fabian Affolter
52561d4f7c Move 'voltage' to const (#9621) 2017-09-29 12:05:02 +02:00
Teemu R
9381f187a4 yeelight: allow turn_off transitions, fixes #9602 (#9605) 2017-09-29 12:04:22 +02:00
Joe Lu
445b0f6f94 Rewrite synology camera by using py-synology package (#9583)
* - Rewrite synology camera by intruducing Api and SurveillanceStation classes to get cameras, motion settings, enable/disable motion detection, etc ...
- Synology camera now shows correct state based on is_recording and is_streaming flag. Also it now supports enable / disable motion detection and show the correct motion detection status
- Newly added Api and SurveillanceStation classes will be moved to a lib but it's here just for review

* - Updated how payload are merged with kwargs so it works with python <3.5

* - Fixed class name conflict

* - Addressed flake8 error

* - Addressed pylint error

* - Moved synology API related code to py-synology lib
- Added py-synology==0.1.1 requirement
- Removed hass from SynologyCamera constructor

* - Updated requirements_all.txt

* - renamed variable back to original

* - Sync call to retrieve camera image should be done in camera_image() instead

* - Sync call to update camera info should be done in update() instead

* - Removed unused import
2017-09-29 12:02:48 +02:00
Marcelo Moreira de Mello
19932bce53 Introducing support to Melnor RainCloud sprinkler systems (#9287)
*  Introducing support to Melnor RainCloud sprinkler systems

* Make monitored_conditions optional for sub-components

*  Part 1/2 - Modified attributes, added DATA_ constant and using battery helper

* Part 2/2 - Refactored self-update hub

* Fixed change requested:
- Dispatcher signal connection
- Don't send raincloud object via dispatcher_send()
- Honoring the dynamic scan_interval value on track_time_interval()

* Inherents async_added_to_hass() on all device classes

* Makes lint happy

* * Refactored RainCloud code to incorporate suggestions.
  Many thanks to @pvizelli and @martinhjelmare!!

* Removed Entity from RainCloud sensor and fixed docstrings

* Update raincloud.py

* Update raincloud.py

* fix lint
2017-09-29 10:08:41 +02:00
pascal
cc5256b8fb Cover component for RFlink (#9432)
* second try on rflink / cover

* no newline at end of file

* changed entity

* fixed comments from pvizeli

* removed :

* removed return 'unknown'

* Fixed comments from Rytilahti

* removed newline

* Reverted to None

* cleanup

* Cleanup
2017-09-29 00:49:03 +02:00
Lukas Barth
236d5f8742 Add an input_datetime (#9313)
* Initial proposal for the input_datetime

* Linting

* Further linting, don't define time validation twice

* Make pylint *and* flake8 happy at the same time

* Move todos to the PR to make lint happy

* Actually validate the type of date/time

* First testing

* Linting

* Address code review issues

* Code review: Remove forgotten print()s

* Make set_datetime a coroutine

* Create contains_at_least_one_key_value CV method, use it

* Add timestamp to the attributes

* Test and fix corner case where restore data is bogus

* Add FIXME

* Fix date/time setting

* Fix Validation

* Merge date / time validation, add tests

* Simplify service data validation

* No default for initial state, allow 'unknown' as state

* cleanup

* fix schema
2017-09-28 23:57:49 +02:00
Paulus Schoutsen
2df433eb0a Migrate Alexa smart home to registry (#9616)
* Migrate Alexa smart home to registry

* Fix tests
2017-09-28 21:26:27 +02:00
Dan Chen
44838937d1 Change TP-Link Switch power statistics attribute names (#9607) 2017-09-28 14:12:02 -05:00
Nolan Gilley
8b6a5eef4c upgrade python-ecobee-api (#9612) 2017-09-28 20:38:15 +02:00
Paulus Schoutsen
6fb55b363a Add OwnTracks over HTTP (#9582)
* Add OwnTracks over HTTP

* Fix tests
2017-09-28 09:49:35 +02:00
Pascal Vizeli
7c8e7d6eb0 Cleanup entity & remove warning (#9606)
* Cleanup entity & remove warning

* Update comment
2017-09-27 16:21:39 -07:00
Aaron Bach
eb2338249f FedEx: Adds "packages" as a unit (#9588)
* Adds "packages" as a unit

* Collaborator-requested changes
2017-09-27 10:44:41 -07:00
Aaron Bach
d499c18e63 Fixes UPS MyChoice exception (#9587)
* Fixes UPS MyChoice exception

* Added unit of measurement

* Collaborator-requested changes
2017-09-27 10:44:32 -07:00
jbarrancos
c95c8a04ef Merge pull request #1 from home-assistant/dev
Update Fork
2017-09-27 16:17:28 +02:00
William Scanlon
312de6b3a3 New Wink services. pair new device, rename, and delete, add new lock key code. Add water heater support (#9303)
* Pair new device, rename, delete, and lock key code services. Also add water heater support.

* Fixed tox
2017-09-26 23:17:55 -07:00
Pierre Ståhl
9d839f1f53 Bump pyatv to 0.3.5 (#9586) 2017-09-26 21:01:17 +02:00
Fabian Affolter
475f6f5f82 Upgrade Sphinx to 1.6.4 (#9584) 2017-09-26 13:11:10 +02:00
rbflurry
fd9ceb7381 Replace emulated_hue: with emulated_hue_hidden: for consistency. (#9382)
* Update __init__.py

* fix lint errors

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

Lint errors

* use get_deprecated instead to log old attr

* Updated tests to hide fan.ceiling_fan

* remove space fix lint
2017-09-26 00:31:35 -07:00
Anders Melchiorsen
154b070eae IMAP Unread sensor updated for async and push (#9562)
* IMAP Unread sensor updated for async and push

* Implement renames suggested in review

* Use async_timeout

* Keep push capability in a variable

* Reword for Hound
2017-09-26 00:26:26 -07:00
Mike Megally
8a3dcbf10f Allow customizable turn on action for LG WebOS tv (#9206)
* allow customizable action for webos tv turn on as not all models allow for WOL

* trying to fix the houndci-bot

* last few fixes hopefully

* I guess not

* last time!

* This is a breaking change. I have removed the build-in wake-on-lan functionality and have opted for a script which can be a wake-on-lan switch. I have also removed any reference to wol.

* hoping to fix formatting

* linter errors
2017-09-26 00:03:40 -07:00
joe248
bf176c405a Increase Comed timeout since it sometimes takes a long time for the API to respond (#9536)
* Increase Comed timeout since it sometimes takes a long time for the API to respond

* Rewrite ComEd sensor to use asyncio

* Fix whitespace and build issues
2017-09-25 23:43:02 -07:00
Enrique Gonzalez
cf8e6d8d86 Upgrade lyft_rides to 0.2 (#9578) 2017-09-25 22:34:48 +02:00
Fabian Affolter
4a6a53c1ad Upgrade youtube_dl to 2017.9.24 (#9575) 2017-09-25 22:34:05 +02:00
Timo S
896ba7e3fa Added new statistic attributes (#9433)
* Added new statistic attributes

Added new attributes:
  - Cleaning count
  - Total cleaning time
  - Total cleaning area
  - Time left to change main brush, side brush and filter

* Code corrections

Code corrections

* Remove wronge hanging indentation

* Added new attributes

ATTR_MAIN_BRUSH_LEFT
ATTR_SIDE_BRUSH_LEFT
ATTR_FILTER_LEFT
ATTR_CLEANING_COUNT
ATTR_CLEANED_TOTAL_AREA
ATTR_CLEANING_TOTAL_TIME

* Remove trailing white space

* Corrections of the unit test for new attributes

* Hound corrections

* Init self.clean_history, self.consumable_state

* Hound correction

* - Cleaning time and total cleaning time shown in minutes
- Cleaned area and total cleaned area shown in square meters
- Main brush left, side brush left, filter left time shown in hours
- Display of the unit of measurement

* Remove trailing white spaces

* Fixed wrong continued indentation

* Fixed Hound

* Fixed Hound

* Added new statistic attributes

Added new attributes:
  - Cleaning count
  - Total cleaning time
  - Total cleaning area
  - Time left to change main brush, side brush and filter

* Code corrections

Code corrections

* Remove wronge hanging indentation

* Init self.clean_history, self.consumable_state

* Hound correction

* Remove UOM

* Merge

* Init self.clean_history, self.consumable_state

* Hound correction

* Init self.clean_history, self.consumable_state

* Hound correction

* Removed double declarations
2017-09-25 22:27:27 +02:00
Fabian Affolter
fafc4a6042 Upgrade dsmr_parser to 0.11 (#9576) 2017-09-25 22:19:44 +02:00
marthoc
a298b0790b MQTT Cover: Add availability topic and configurable payloads (#9445)
* MQTT Cover - Add availability_topic for online/offline status

Added topic, configurable payloads, and tests.

* Merge branch 'dev' into mqtt-cover-availability

* Revert "Merge branch 'dev' into mqtt-cover-availability"

This reverts commit 46d29794ba.

* Added newline at end of test_mqtt.py

* Fixed lint issue (newline at EOF)

* Fixed lint issue (newline at EOF)

* Updated call signature for other tests

* Fixed availability message callback
2017-09-25 19:35:11 +02:00
Paulus Schoutsen
1baf0da627 Clean up OwnTracks (#9569)
* Clean up OwnTracks

* Address comments
2017-09-25 09:05:09 -07:00
Paulus Schoutsen
fc4cd39cdd Add DuckDNS component (#9556)
* Add DuckDNS component

* Address comments
2017-09-24 15:48:45 -07:00
Fabian Affolter
2486c9af35 Use simplepush module, enable event, and allow encrypted communication (#9568)
* Use simplepush module, enable event, and allow encrypted communication

* Fix check
2017-09-24 15:48:30 -07:00
Johan Bloemberg
515d1bdbd3 Add test cases and fix for device_defaults fire_event option. (#9567)
* Add test cases and fix for device_defaults fire_event option.

* Also for light.

* Change docstring mood.
2017-09-24 15:47:59 -07:00
Paul Sokolovsky
ff7db218b1 Update yeelight to 0.3.3. (#9561)
Fixes basic light control in case complex transition effects were defined
on a light (possibly, externally to Home Assistant):
https://gitlab.com/stavros/python-yeelight/issues/17
2017-09-24 13:19:05 -07:00
Paulus Schoutsen
350b8e09e6 Allow specifying multiple ports for UPNP component (#9560)
* Update UPNP component

* Bump dep

* Fix flakiness in test
2017-09-24 13:08:58 -07:00
Aaron Bach
1b91218a60 Updated Arlo cameras with new attributes (#9565) 2017-09-24 21:44:34 +02:00
Aaron Bach
aa0fc339c0 Various AirVisual bugfixes (#9554)
* Various AirVisual bugfixes

* Updating requirements

* Added better logging for failed data retrieval
2017-09-24 21:25:18 +02:00
Joe Lu
bbf6e9ea47 Added support for ARM_NIGHT for manual_mqtt alarm (#9358)
* - Added support for ARM_NIGHT for manual_mqtt alarm

* - port "Add post_pending_state attribute to manual alarm_control_panel #9291" to manuql_mqtt

* - port "Fixed manual alarm not re-arm after 2nd trigger #9249" to manuql_mqtt

* - port "Add manual alarm_control_panel pending time per state #9264" to manuql_mqtt

* - Updated test_trigger_with_specific_pending to simulate real scenario e.g. arm the system then trigger
2017-09-24 08:57:37 +02:00
happyleavesaoc
84524e0712 fix usps? (#9557) 2017-09-24 08:28:11 +02:00
Mister Wil
e2ce1d05ae Fixed bug with all switch devices being excluded (#9555) 2017-09-24 08:22:15 +02:00
Malte Franken
0d75cd484b GeoRSS sensor (#9331)
* new geo rss events sensor

* SCAN_INTERVAL instead of DEFAULT_SCAN_INTERVAL

* removed redefinition CONF_SCAN_INTERVAL

* definition of self._name not required

* removed unnecessary check and unnecessary parameter

* changed log levels

* fixed default name not used

* streamlined sensor name and entity id generation, removed unnecessary parameter

* fixed issue for entries without geometry data

* fixed tests after code changes

* simplified code

* simplified code; removed unnecessary imports

* fixed invalid variable name

* shorter sensor name and in turn entity id

* increasing test coverage for previously untested code

* fixed indentation and variable usage

* simplified test code

* merged two similar tests

* fixed an issue if no data could be fetched from external service; added test case for this case
2017-09-24 08:12:38 +02:00
Andrey
499382a9a9 Add history_graph component (#9472)
* Add support for multi-entity recent fetch of history. Add graph component

* Rename graph to history_graph. Support fast fetch without current state.

* Address comments
2017-09-23 10:01:48 -07:00
Fabian Affolter
f1aef33dd6 Upgrade pyasn1 to 0.3.6 (#9548) 2017-09-23 18:32:29 +02:00
Tom Matheussen
6c0f4c35f6 Catch no longer existing process in systemmonitor (#9535)
* Catch no longer existing process in systemmonitor

* Update log message

* Again line length
2017-09-23 18:31:25 +02:00
Michael Prokop
08b0629eca Fix a bunch of typos (#9545)
s/Addres /Address /
s/Chnage/Change/
s/Converion/Conversion/
s/Supressing/Suppressing/
s/agains /against /
s/allready/already/
s/analagous/analogous/
s/aquired/acquired/
s/arbitray/arbitrary/
s/argment/argument/
s/aroung/around/
s/attibute/attribute/
s/auxillary/auxiliary/
s/befor /before /
s/commmand/command/
s/conatin/contain/
s/conection/connection/
s/coresponding/corresponding/
s/entites/entities/
s/enviroment/environment/
s/everyhing/everything/
s/expected expected/expected/
s/explicity/explicitly/
s/formated/formatted/
s/incomming/incoming/
s/informations/information/
s/inital/initial/
s/inteface/interface/
s/interupt/interrupt/
s/mimick/mimic/
s/mulitple/multiple/
s/multible/multiple/
s/occured/occurred/
s/occuring/occurring/
s/overrided/overridden/
s/overriden/overridden/
s/platfrom/platform/
s/positon/position/
s/progess/progress/
s/recieved/received/
s/reciever/receiver/
s/recieving/receiving/
s/reponse/response/
s/representaion/representation/
s/resgister/register/
s/retrive/retrieve/
s/reuqests/requests/
s/segements/segments/
s/seperated/separated/
s/sheduled/scheduled/
s/succesfully/successfully/
s/suppport/support/
s/targetting/targeting/
s/thats/that's/
s/the the/the/
s/unkown/unknown/
s/verison/version/
s/while loggin out/while logging out/
2017-09-23 17:15:46 +02:00
Pascal Vizeli
3704a18da5 Bugfix Homematic hub object (#9544)
* Bugfix Homematic hub object

* fix hass instance

* fix state unknow if 0 states
2017-09-23 15:53:48 +02:00
Paulus Schoutsen
d1d9704292 Merge pull request #9532 from home-assistant/release-0-54
0.54
2017-09-22 22:23:54 -07:00
Alok Saboo
283cd80a7f Bump python_openzwave to 0.4.0.35 (#9542)
* Bump python_openzwave to 0.4.0.35

* Cleanup
2017-09-22 22:01:57 -07:00
happyleavesaoc
7da8cb225f update usps (#9540)
* update usps

* fix syntax issue
2017-09-22 22:01:56 -07:00
Mister Wil
a3a73b418a Update AbodePy to 0.11.8 (#9537)
* Update requirements_all.txt

* Update abode.py
2017-09-22 22:01:56 -07:00
happyleavesaoc
a8784f9adf update usps (#9540)
* update usps

* fix syntax issue
2017-09-22 21:53:16 -07:00
Alok Saboo
e7c08921eb Bump python_openzwave to 0.4.0.35 (#9542)
* Bump python_openzwave to 0.4.0.35

* Cleanup
2017-09-22 19:00:35 -07:00
Mister Wil
5e35beb41a Update AbodePy to 0.11.8 (#9537)
* Update requirements_all.txt

* Update abode.py
2017-09-22 22:37:16 +02:00
Daniel Høyer Iversen
e980ced0b7 flux led lib 0.20 (#9533) 2017-09-22 10:39:53 +02:00
Paulus Schoutsen
fee922c4be Version bump to 0.55.0.dev0 2017-09-21 21:19:04 -07:00
Paulus Schoutsen
6fa8c2afe5 Version bump to 0.54 2017-09-21 21:18:43 -07:00
Paulus Schoutsen
675fb2010d Update frontend 2017-09-21 21:18:17 -07:00
Paulus Schoutsen
e4c0cec7f1 Merge remote-tracking branch 'origin/master' into dev 2017-09-21 21:14:27 -07:00
Anders Melchiorsen
d978d58436 LIFX: improve performance of setting multi-zone lights to a single color (#9526)
With this optimization we can send a single UDP packet to the light rather
than one packet per zone (up to 80 packets for LIFX Z). This removes a
potential multi-second latency on the frontend color picker.
2017-09-21 23:32:31 +02:00
Julius Mittenzwei
5fd9220812 Fix typo within cover/knx https://github.com/XKNX/xknx/issues/64 (#9527) 2017-09-21 21:55:33 +02:00
marthoc
7cd7b43d25 MQTT Binary Sensor - Add availability_topic for online/offline status (#9507)
* MQTT Binary Sensor - Add availability_topic for online/offline status

Added topic, configurable payloads, and tests.

* Relocated state subscribe function

Moved state subscribe function to follow the state listener function.
2017-09-21 17:02:11 +02:00
Sébastien RAMAGE
c26fb9906f Add reload service to python_script (#9512)
* Add reload service

* add reload test

* Use global variable

* remove white space ....

* adjust as suggested

* remove annoying white space....

* fix travis

* fix travis, again

* rename Load_scripts to Discover_scripts

Travis complains that "Load_scripts" is an invalid name (I don't know why)

* Update python_script.py
2017-09-21 17:00:45 +02:00
Mahasri Kalavala
58cc3a2d7a added services.yaml integration for input_boolean (#9519)
* added services.yaml integration to input_boolean

* added services integration for input_boolean

* removed trailing spaces
2017-09-21 16:58:12 +02:00
Daniel Høyer Iversen
b8a03f1283 update xiaomi aqara lib (#9520) 2017-09-21 08:53:40 +02:00
Vignesh Venkat
2e66898bec abode: Set device_type in state attributes (#9515)
This gets displayed when clicking on the binary sensors. It is
useful to distinguish different devices with the same name (e.g.
the room name) but different types.
2017-09-20 20:51:09 +02:00
Vignesh Venkat
2531d54515 abode: Bump abodepy dependency to 0.11.7 (#9504)
* abode: Bump abodepy dependency to 0.11.7

Fixes cases where one's abode account has a nest thermostat
linked (https://github.com/MisterWil/abodepy/pull/17).

* abode: Bump abodepy dependency to 0.11.7

Fixes cases where one's abode account has a nest thermostat
linked (https://github.com/MisterWil/abodepy/pull/17).

* update requirements_all.txt
2017-09-20 12:18:05 +02:00
Daniel Perna
3aa08f6c91 Bumped pyhomematic, additional device support (#9506)
Add an optional extended description…
2017-09-20 12:17:30 +02:00
Daniel Høyer Iversen
7314ec7a42 Xiaomi pycryptodome (#9511)
* Switch to use pycryptodome for xiaomi_gw
2017-09-20 11:43:25 +02:00
Julius Mittenzwei
a5155a2609 renamed add_devices to async_add_devices according to hass naming scheme (second try after failed #9485) (#9505) 2017-09-20 01:15:20 -04:00
Anders Melchiorsen
3dbf951086 LIFX: fix multi-zone color restore after effects (#9492)
The aiolifx 0.6.0 release fixes an issue where an effect color could
remain set after stopping the effect. This only affected multi-zone
lights (i.e. LIFX Z) and only if the effect was stopped by setting
the light brightness or the color (but not both).

The aiolifx 0.6.0 release also defaults end_index to start_index+7,
so we can remove that argument.

Finally, aiolifx_effects 0.1.2 adds support for aiolifx 0.6.0.
2017-09-19 22:27:00 +02:00
Pascal Vizeli
1bbaa00976 Revert "renamed add_devices to async_add_devices according to hass naming scheme (#9485)" (#9503)
This reverts commit a5a970709f.
2017-09-19 19:51:15 +02:00
Julius Mittenzwei
a5a970709f renamed add_devices to async_add_devices according to hass naming scheme (#9485)
* renamed add_devices to async_add_devices according to hass naming scheme

* replaced some occurencies of async_add_entites to async_add_devices

* fixed unit test

* fixed unit test
2017-09-19 17:06:52 +02:00
Daniel Høyer Iversen
185ada2354 switch to pypi for xiaomi gw (#9498) 2017-09-19 05:36:59 -04:00
Kane610
dcaa5fe443 Solve Recorder component failing when using Axis component (#9293)
* Bump Axis requirement to v10
Fix issues related to non JSON serializable items and recorder component (8297)
Add support to configure HTTP port (8403)

* Changed local port definition to CONF_PORT

* On request config is now sent to the camera platform as well, and in order better explain what is what the old internal config is now device_config and hass own config is the only one referenced as config

* Missed to add device_config to setup in discovered device

* Bump to V12 that has got a dependency fix

* Update requirements_all

* Add port configuration to automatically discovered devices
Allow setup to pass without Axis being configured in configuration.yaml
2017-09-19 10:09:47 +02:00
Fabian Affolter
8ea7e4bb55 Upgrade blockchain to 1.4.0 (#9489) 2017-09-19 10:04:11 +02:00
Fabian Affolter
252ee35d61 Upgrade coinmarketcap to 4.1.1 (#9490) 2017-09-19 10:03:40 +02:00
Mister Wil
e41b00fb4d Bump version of abodepy (#9491) 2017-09-19 06:53:03 +02:00
Fabian Affolter
a05afd58e9 Upgrade async_timeout to 1.4.0 (#9488) 2017-09-18 23:03:02 +02:00
Julius Mittenzwei
0f7c35859b Small improvement of KNX Covers (#9476)
* Refactoring of Cover abstraction. Fixes
https://github.com/XKNX/xknx/issues/57 and
https://github.com/home-assistant/home-assistant/issues/9414

* Requested changes by pvizeli
2017-09-18 21:44:26 +02:00
Colin Dunn
15c3ea0d86 Fix universal media_player mute (#9462) 2017-09-18 15:42:31 -04:00
nilzen
392588e519 Worx Landroid sensor (#9416)
* Worx Landroid sensor

* Move component into sensor folder

* Update .coveragerc

* Remove incorrect file

* Code cosmetics

* Code cosmetics

* Trailing whitespace

* Add docstrings and update module name

* Remove hyphen in component file name

* Fix redefined-builtin and no-self-use

* Update filename in .coveragerc

* Fixed pvizelis requested changes

* Update worxlandroid.py
2017-09-18 17:47:23 +02:00
c-soft
3996c609b4 Added satel_integra alarm panel and binary sensor platform (#9336)
* Added satel_integra alarm panel and binary sensor platform

* Fixed several issues after review: import cleanup, reduced messaging levels to debug, other.

* Fixes after review: removed dead code, improved loop, sorted imports.

* Changes after review, not yet working

* Changes after review - wrapped async code, killed ensure_future, moved async_load_platform into jobs
2017-09-18 17:42:31 +02:00
Mister Wil
c44397e257 Abode services, events, lights, cameras, automations, quick actions. (#9310)
* Updated to latest AbodePy version. Added services and events. Added new device types. Added exclude, light, and polling config options.

* Disable the event service if polling is enabled.

* Addressed all CR's

* Removed duplicated super call.

* Name config option now used. Removed deprecated DEFAULT_NAME.

* Modified partial to move event to first param.
2017-09-18 17:39:41 +02:00
Marcel Holle
5851944f80 Telnet switch (#8913)
* Added telnet switch.

* Lint.

* Coverage

* Added port parameter to Telnet switch.

* Removed optimistic attribute from Telnet switch.

* Code cleanup.
2017-09-18 17:35:35 +02:00
Blender3D
77fb1baeb6 Added support for the DTE Energy Bridge v2 (#9431)
* Added optional 'version' option to switch between sensor versions.

* Reduced line lengths

* Removed error for invalid sensor version
2017-09-18 17:33:58 +02:00
Sebastian Muszynski
94dcf36d7c Xiaomi Gateway: Allow static configuration of a gateway without discovery (#9464)
* Configuration parameter "host" introduced. Will skip the discovery of the host.

* Provide a proper default port. Log message reformatted.

* PyXiaomiGateway version bumped: The new feature was introduced with v0.4.0.

* requirements_all.txt updated.

* Native default for config parameter used.
2017-09-18 17:29:58 +02:00
Fabian Affolter
ced642c862 Upgrade pyasn1 to 0.3.5 and pyasn1-modules to 0.1.4 (#9474) 2017-09-18 07:45:27 +02:00
Michael Prokop
71e06c566f Fix typo in services.yaml (#9475)
s/varaible/variable/
2017-09-18 07:45:07 +02:00
happyleavesaoc
fd97c23cde fitbit fixes (#9460) 2017-09-17 21:13:26 +02:00
milanvo
2219dcaee5 Fix recorder does not vacuum SQLite DB on purge (#9469) 2017-09-17 21:10:53 +02:00
Andy Castille
5f24cc229d DoorBird Component (#9281)
* DoorBird Component

* add newlines at end of files

* fix lint

* fix doorbird components conventions

* fix doorbird domain import and log strings

* don't redundantly add switches

* Remove return statement from setup_platform
2017-09-17 20:47:30 +02:00
Fabian Affolter
811f6b4092 Upgrade youtube_dl to 2017.9.15 (#9456) 2017-09-17 13:41:23 +02:00
Fabian Affolter
6ccf039c95 Upgrade uber_rides to 0.6.0 (#9457) 2017-09-17 13:40:58 +02:00
Fabian Affolter
f2c605ba1b Upgrade sqlalchemy to 1.1.14 (#9458) 2017-09-17 13:40:25 +02:00
Greg Dowling
c54b2c43d4 Merge pull request #9465 from home-assistant/bump_pyvera
Bump pyvera to handle non english language controllers.
2017-09-17 10:58:20 +01:00
Walter Huf
8a3f8457e8 Adds MQTT Fan Discovery (#9463) 2017-09-17 11:32:22 +02:00
rbflurry
bda6d2c696 Ios notify camera fix (#9427)
* Update __init__.py

* Update ios.py

* Update __init__.py
2017-09-17 11:30:17 +02:00
pavoni
840072e92f Bump pyvera - handle non english language controllers. 2017-09-17 10:11:57 +01:00
Paul Krischer
258ad8fc16 Fix issue 5728: Emulated Hue UPnP crashes on special characters. (#9453) 2017-09-16 22:21:09 +02:00
Boyi C
e2866a1339 Load WebComponent polyfill on header. (#9438)
* Load WebComponent polyfill on header.
On Chrome 53, `document.registerElement` exists but `window.customElements` does not exist.
Fix for Tencent X5 browser on Android(Chrome 53 based).

* Move the block just before app panel loading.
Remove async for new script block.
2017-09-16 13:00:54 -07:00
Mike Christianson
308152f48c fix for Twitter notifications without media (#9448) 2017-09-16 12:59:49 -07:00
Pascal Vizeli
c2bbc2f74e Alexa smart home native support (#9443)
* Init commit for alexa component

* more struct component

* Add mapping for device/component to alexa action

* finish discovery

* First version with support on/off/percent

* fix spell

* First init tests

* fix tests & lint

* add tests & fix bugs

* optimaze tests

* more tests

* Finish tests

* fix lint

* Address paulus comments

* fix lint

* Fix lint p2

* Optimaze & paulus comment
2017-09-16 12:35:28 -07:00
Adam Stone
73a15ddd64 Fix emulated hue warning message (#9452) 2017-09-16 11:17:27 -04:00
Aaron Bach
f3fc571cd5 Add city/state/country options and fix bugs for airvisual (#9436)
* Added city/state/country options and fixed several bugs

* Added some slightly better error logging

* Making collaborator-requested changes
2017-09-16 10:32:24 +02:00
Andrey Kupreychik
78bb0da5a0 Added Zyxel Keenetic NDMS2 based routers support for device tracking (#9315)
* Added Zyxel Keenetic NDMS2 based routers support for device tracking

* Review feedback

* Review feedback+

* Review feedback: removed unneeded code
2017-09-16 10:29:24 +02:00
Fabian Affolter
515982a692 Refactor Swiss Public Transport sensor (#9129)
* Refactor Swiss Public Transport sensor

* Minor change
2017-09-15 23:13:30 -07:00
Kyle Hendricks
7b0628421d Fix for DTE Energy Bridge returning the wrong units from time to time (#9246)
The DTE Energy Bridge seems to return the current energy
usage randomly in either W or kW.  The only way to tell the difference
is if there is a decimal or not in the result.

Also added some tests.
2017-09-15 23:12:06 -07:00
Matt White
04bed51277 mqtt_statestream: Update to append 'state' to topic for future use with mqtt discovery (#9446) 2017-09-15 23:05:58 -07:00
Michaël Arnauts
a7bce5f9e6 Allow empty hostnames when detecting devices with the aruba device_tracker. (#9440) 2017-09-15 22:55:53 -07:00
Ted Drain
26c98512c8 Polymer access to log file broken when using new log file command line (#9437)
* Changed api.py to use new log file name

* Only serve log file if logs are active

* Changed log file location to be in hass.data
2017-09-15 22:25:32 -07:00
Pascal Vizeli
5de39fd118 Optimaze vacuum mqtt platform (#9439)
* Optimaze vacuum mqtt platform

* fix lint

* Update mqtt.py
2017-09-15 18:50:22 +02:00
John Boiles
175b4ae5e0 Basic MQTT vacuum support (#9386)
* Basic MQTT vacuum support

* PR feedback

* Support for fan_speed and send_command services

* Fix configurable topics

* Use configurable bools for cleaning/docked/stopped state

* Fix language in docstring

* PR feedback

* Remove duplicate vacuum/state topic defaults

* Fix incorrect template for docked value

* Move direction like default mqtt platfom/components

* fix None on templates

* fix tests

* fix int

* fix tests

* ready to merge
2017-09-15 15:39:19 +02:00
Martin Donlon
0100af0fa6 Fix russound_rio for python 3.4 (#9428)
Bumped russound_rio dependency to 0.1.4 which includes a fix for python
3.4.2 (asyncio.async vs asyncio.ensure_future)
2017-09-15 11:40:40 +02:00
Adam Mills
1c8253f762 Bump version of aioautomatic (#9435) 2017-09-14 20:37:51 -04:00
Daniel Høyer Iversen
4126b8bd13 Rename xiaomi #9425 (#9426)
* rename xiaomi to xiaomi_aqara

* rename xiaomi vacuum and xiaomi phillips light to xiaomi miio

* update discovery and tests

* style

* update discovery and tests

* Still use Philips as name
2017-09-14 18:49:03 -04:00
Joe Lu
9c603d932d Add manual alarm_control_panel pending time per state (#9264)
* - Enhanced manual alarm_control_panel config so that you can specify different pending time for different alarm state

* - Fixed demo alaram control panel

* - Updated configuration structure for state specific pending times

* - Addressed comment

* Address code review comments

* - Fixed failing tests
- Updated demo alarm component to use new per state pending_time setting

* - Removing previously added comment which might have caused build to fail?

* - moved "copy.deepcopy(config)" out of loop so config is only copied once
2017-09-14 20:08:45 +02:00
Sébastien RAMAGE
20f3e3dcf9 Improve Python script (#9417)
* add datetime and support for unpacksequence

add datetime to builtin and support for unpacksequence
a,b = (1,2)
for a,b in [(1,2),(3,4)]

* add test for python_script

* fix test

* restore previous test

restore previous tests, removed by mistake sorry...

* fix test

* Update test_python_script.py

* fix travis

* fix test

* Update test_python_script.py

* Add files via upload

* fix travis...
2017-09-14 07:52:47 -07:00
rollbrettler
371d1cc872 Fix displaying of friendly_name for light template component (#9413) 2017-09-14 10:13:01 +02:00
giangvo
3430c1c8bc update broadlink.py to add support for MP1 switch (#9222)
* update broadlink.py to add support for MP1 switch

* fix code styles

* fix code styles

* optimize state fetching on mp1

* fix code styles

* fix code styles

* fix code styles

* fix code styles

* fix variable

* remove default None

* use string.format
2017-09-13 23:41:52 -07:00
pdanilew
f5dee2c27d MPD small improvements (#9301)
* Power button restored.

* Added volume step and mute

* Removed network operations from property + pylint made happy.
2017-09-13 23:38:07 -07:00
Sebastian Muszynski
5db55b306e Bump python-mirobo for improved device support and introduce API changes. (#9424) 2017-09-13 23:18:22 -07:00
Pierre Ståhl
ba5e8d133d Fix artwork bug in Apple TV (#9415)
* Fix artwork bug in Apple TV

* Clean up some None checks
2017-09-13 22:30:29 -07:00
Jay Stevens
c94b3a7bf9 Add support for Todoist platform (#9236)
* Added basic Todoist support

Creating a new platform for Todoist - https://todoist.com

* Added more robust support for creating new custom projects.

This means you can now specify things such as 'all tasks due today', 'all tasks due this week', etc.

* Changed logging from warning to info.

* Added label and comment support.

* Added support for overdue tasks.

* Changed logging to info instead of warning; fixed labels.

* Added ability to filter projects by name.

* Rename 'extra_projects' to 'custom_projects'.

* Updated code to follow proper HASS style guidelines.

* Got new_task service running.

* Update .coveragerc.

* Remove old try-catch block.

This is left over from before we validated the inputs using the service schema.

* Updated to use PLATFORM_SCHEMA.

* Updated component to use Todoist API.

* Removed commented-out code.

This also removes functionality regarding finding out how many comments a task has.
This functionality may be added back in the future.

* Clarified TodoistProjectData, removed fetching comments.

* Fixed bug where projects were grabbing all tasks.

* Fixed bug where due dates were being ignored.

* Removed debug logging.

* Fixed linter errors.

* Fixed Todoist docstring to be in line with HASS' style rules.

* Organized imports.

* Fixed voluptuous schema.

* Moved ID lookups into .

* Moved ID lookups into setup_platform.

* Cleaned up setup_platform a bit.

* Cleaned up Todoist service calls.

* Changed debug logging level.

* Fixed issue with configuration not validating.

* Changed from storing the token to storing an API instance.

* Use dict instead of Project object.

* Updated to use list comprehension where possible.

* Fixed linter errors.

* Use constants instead of literals.

* Changed logging to use old-style string formatting.

* Removed unneeded caching.

* Added comments explaining 'magic' strings.

* Fixed bug where labels were always on the whitelist.

* Fixed linter error.

* Stopped checking whitelist length explicitly.
2017-09-14 07:27:12 +02:00
spektren
28d312803b full RGB support for users of tradfri GW (#9411)
* Update tradfri.py

## 201709013: set_hex_color() seems not to work in pytradfri api - set_rgb_color() does 
## -> changed function set_hex_color() to set_rgb_color() 
## tested w. IKEA tradfri GW and zigbee rgb PWM module (dresden elektronik FLS-PP lp)

* Update tradfri.py

Setup: 
Home Assistant 0.53.0
pytradfri 2.2 
IKEA tradfri gateway fw 1.1.0015
zigbee rgb PWM module (dresden elektronik FLS-PP lp) 

Issue: 
pytradfri's set_hex_color() does not work for arbitrary colors with the current IKEA tradfri gateway. Only setting rgb hex values (param 5706) of some predefined colors has the desired effect. Others will fall back to one predefined value. I assume, the GW doesn't allow for values deviating from the predefined values. 

However, pytradfri's set_rgb_color() does also work for arbitrary colors. Latest pytradfri (2.2/PR51?) will convert rgb to xy and send xy thru the GW (param 5709 and 5710). 

 -> changed the function used from set_hex_color() to set_rgb_color() in HA's component\light\tradfri

Result: 
Full RGB support with arbitrary colors with my setup. 

Unfortunately I cannot test tradfri GW with other bulbs (no have hue/lightify bulbs). 
___ 

Predefined colors from <https://github.com/ggravlingen/pytradfri/pull/51>: 
 this.f3891b = new HashMap();
        this.f3891b.put("f5faf6", new C1386c(0.3804d, 0.3804d, "f5faf6", 0.54d));
        this.f3891b.put("f1e0b5", new C1386c(0.4599d, 0.4106d, "CCT_LIGHT_NEUTRAL", 0.61d));
        this.f3891b.put("efd275", new C1386c(0.5056d, 0.4152d, "efd275", 0.66d));
        this.f3891b.put("dcf0f8", new C1386c(0.3221d, 0.3317d, "dcf0f8", 0.45d));
        this.f3891b.put("eaf6fb", new C1386c(0.3451d, 0.3451d, "eaf6fb", 0.48d));
        this.f3891b.put("f5faf6", new C1386c(0.3804d, 0.3804d, "f5faf6", 0.54d));
        this.f3891b.put("f2eccf", new C1386c(0.4369d, 0.4041d, "f2eccf", 0.59d));
        this.f3891b.put("CCT_LIGHT_NEUTRAL", new C1386c(0.4599d, 0.4106d, "CCT_LIGHT_NEUTRAL", 0.61d));
        this.f3891b.put("efd275", new C1386c(0.5056d, 0.4152d, "efd275", 0.66d));
        this.f3891b.put("ebb63e", new C1386c(0.5516d, 0.4075d, "ebb63e", 0.68d));
        this.f3891b.put("e78834", new C1386c(0.58d, 0.38d, "e78834", 0.69d));
        this.f3891b.put("e57345", new C1386c(0.58d, 0.35d, "e57345", 0.67d));
        this.f3891b.put("da5d41", new C1386c(0.62d, 0.34d, "da5d41", 0.7d));
        this.f3891b.put("dc4b31", new C1386c(0.66d, 0.32d, "dc4b31", 0.73d));
        this.f3891b.put("e491af", new C1386c(0.5d, 0.28d, "e491af", 0.57d));
        this.f3891b.put("e8bedd", new C1386c(0.45d, 0.28d, "e8bedd", 0.53d));
        this.f3891b.put("d9337c", new C1386c(0.5d, 0.24d, "d9337c", 0.55d));
        this.f3891b.put("c984bb", new C1386c(0.34d, 0.19d, "c984bb", 0.38d));
        this.f3891b.put("8f2686", new C1386c(0.31d, 0.12d, "8f2686", 0.33d));
        this.f3891b.put("4a418a", new C1386c(0.17d, 0.05d, "4a418a", 0.18d));
        this.f3891b.put("6c83ba", new C1386c(0.2d, 0.1d, "6c83ba", 0.22d));
        this.f3891b.put("a9d62b", new C1386c(0.4099999964237213d, 0.5099999904632568d, "a9d62b", 0.654d));
        this.f3891b.put("d6e44b", new C1386c(0.44999998807907104d, 0.4699999988079071d, "d6e44b", 0.65d));
2017-09-13 22:24:46 -07:00
Antony Messerli
07cb7b3d54 Bump uvcclient to 0.10.1 to work with beta NVR releases (#9423) 2017-09-13 22:21:58 -07:00
Tor Magnus
5b453ca53a Added more devices and types to onewire (#9404)
* Added more devices and sensor types.

* flake8 fixes

* Resolved feedback in pull https://github.com/home-assistant/home-assistant/pull/9404

* Fixed issue where values would get mixed up across restarts of HA
2017-09-13 22:14:38 -07:00
morberg
b21bfe50d7 Add LC_CTYPE to environment variables in macOS (#9227)
* Add LANG to environment variables

Some componentes, e.g. tradfri, will not work properly unless LANG is an UTF-8 environment.

* Set LC_CTYPE to UTF-8
2017-09-13 21:35:25 -07:00
Ted Drain
411c9620c1 Added log-file command line flag (#9422) 2017-09-13 21:22:42 -07:00
Lukas Barth
89d6784fa0 Fix copy&paste mistake (#9378) 2017-09-13 17:00:46 +02:00
Paul Sokolovsky
d90801f6dd components/xiaomi: Add initial discovery using NetDisco. (#9283)
There's a kind of duplication of functionality between NetDisco and
"xiaomi" component, the latter features its own "discovery" in addition
to general HomeAssistant discovery service, based on NetDisco. As such,
this patch is pretty simple: the only purpose of NetDisco discovery
is "plug and play", "zero configuration" discovery that Xiaomi Gateway
device is present on the local network, and triggering of "xiaomi"
component loading, which then "rediscovers" the gateway using its own
method.
2017-09-12 20:44:42 -07:00
Paulus Schoutsen
2c8967d0d5 Update netdisco to 1.2.0 (#9408) 2017-09-12 20:43:35 -07:00
Pierre Ståhl
f5ffef3f72 Support specifying no Apple TVs (#9394) 2017-09-12 19:57:31 -07:00
happyleavesaoc
c8da95c1e8 fix mopar sensor (#9389)
* fix mopar sensor

* fix typo

* bump mopar dep version
2017-09-12 19:50:28 -07:00
Fabian Affolter
fdf2d24a8b Upgrade psutil to 5.3.1 (#9403) 2017-09-13 00:54:25 +02:00
Paulus Schoutsen
05192e678e Break up Alexa per functionality (#9400)
* Break up Alexa per functionality

* Lint

* Lint
2017-09-12 21:24:44 +02:00
Jeff McGehee
29b62f814f Allow multiple observations of same entity (#9391)
* Allow multiple observations of same entity

Why:

* There may be different probabilities for multiple states of the same
entity.

This change addresses the need by:

* Keeping a list of observations for each entity to check on each state
change of the given entity.
* Adding a numeric id to each observation so that they can be
effectively added and removed from `self.current_obs`.
* Adding a test to confirm functionality.

* fix overzealous indenting
2017-09-12 18:52:09 +02:00
Paulus Schoutsen
c9fc3fae6e Update cloud auth (#9357)
* Update cloud logic

* Lint

* Update test requirements

* Address commments, fix tests

* Add credentials
2017-09-12 18:47:04 +02:00
Pascal Vizeli
90f9a6bc0a Cleanup and simplitfy the async state update (#9390)
* Cleanup and simplitfy the async state update

* Update test_entity.py
2017-09-12 10:01:03 +02:00
Paulus Schoutsen
1afdde61e8 Merge pull request #9395 from home-assistant/release-0-53-1
0.53.1
2017-09-11 22:43:56 -07:00
viswa-swami
2a8620f806 Fixing foscam library dependency/requirements (#9387)
* Added support to enable/disable motion detection for foscam cameras. This support was added in 0.48.1 as a generic service for cameras. Motion detection can be enabled/disabled for foscam cameras with this code-set.

* Fixed the violation identified by hound-bot

* Fixed the comment posted by HoundCI-Bot regarding using imperative mood statement for pydocstyle

* Fixed the error that travis-ci bot found.

* As per comment from @balloob, Instead of directly using the URL to talk to foscam, used a 3rd party foscam library to communicate with it. This library already has support to enable/disable motion detection and also APIs to change the motion detection schedule etc. Need to add more support in the pyfoscam 3rd party library for checking if motion was detected or even if sound was detected. Once that is done, we can add that into HASS as well.

* Lint

* Removed the requests library import which is not used anymore

* Updating requirements_all.txt based on the code-base of home assistant that i have. Generated using the gen_requirements_all.py script

* Updating requirements_all.txt and requirements_test_all.txt generated by gen_requirements_all.py after latest pull from origin/dev

* Updated requirements_all.txt with script

* Updated the foscam camera code to fix lint errors

* Fixed houndci violation

* Updating the foscam library dependency/requirements.

* Fixing the requirements_all file. Somehow when i generated, it generated duplicate entry for the same dependency
2017-09-11 21:53:20 -07:00
Alok Saboo
804d06d0d3 Fixes #9379 - Added additional string check in Wunderground sensor (#9380)
* Added additional string check

* optimaze
2017-09-11 21:53:20 -07:00
Mike Christianson
202d4d8105 Fixes #9353 (#9354)
Follow [Twitter's guidance](https://dev.twitter.com/rest/reference/post/media/upload-finalize) for media uploads: "If and (only if) the response of the FINALIZE command contains a processing_info field, it may also be necessary to use a STATUS command and wait for it to return success before proceeding to Tweet creation."
2017-09-11 21:53:19 -07:00
Paulus Schoutsen
04dccb4246 Version bump to 0.53.1 2017-09-11 21:53:01 -07:00
Paulus Schoutsen
7f5c4cd1e5 Update frontend 2017-09-11 21:52:48 -07:00
Paulus Schoutsen
c84a099b0f Update frontend 2017-09-11 21:50:33 -07:00
viswa-swami
659dc2e557 Fixing foscam library dependency/requirements (#9387)
* Added support to enable/disable motion detection for foscam cameras. This support was added in 0.48.1 as a generic service for cameras. Motion detection can be enabled/disabled for foscam cameras with this code-set.

* Fixed the violation identified by hound-bot

* Fixed the comment posted by HoundCI-Bot regarding using imperative mood statement for pydocstyle

* Fixed the error that travis-ci bot found.

* As per comment from @balloob, Instead of directly using the URL to talk to foscam, used a 3rd party foscam library to communicate with it. This library already has support to enable/disable motion detection and also APIs to change the motion detection schedule etc. Need to add more support in the pyfoscam 3rd party library for checking if motion was detected or even if sound was detected. Once that is done, we can add that into HASS as well.

* Lint

* Removed the requests library import which is not used anymore

* Updating requirements_all.txt based on the code-base of home assistant that i have. Generated using the gen_requirements_all.py script

* Updating requirements_all.txt and requirements_test_all.txt generated by gen_requirements_all.py after latest pull from origin/dev

* Updated requirements_all.txt with script

* Updated the foscam camera code to fix lint errors

* Fixed houndci violation

* Updating the foscam library dependency/requirements.

* Fixing the requirements_all file. Somehow when i generated, it generated duplicate entry for the same dependency
2017-09-11 21:43:55 -07:00
Mike Christianson
10c0744c4a Fixes #9353 (#9354)
Follow [Twitter's guidance](https://dev.twitter.com/rest/reference/post/media/upload-finalize) for media uploads: "If and (only if) the response of the FINALIZE command contains a processing_info field, it may also be necessary to use a STATUS command and wait for it to return success before proceeding to Tweet creation."
2017-09-11 21:37:36 -07:00
felix schwenzel
51ff6009a3 typo in waypoint import topic preventing waypoint import (#9338)
owntracks (tested on ios version 9.6.3/de_DE) publishes single waypoints under the topic owntracks/<user>/<device>/waypoint (singular).
owntrack publishes a waypoint export (publish) under the topic owntracks/<user>/<device>/waypoints (plural).

the owntracks component did not catch my waypoint export to mqtt, only single waypoint updates (i.e. after editing a waypoint or creating a new one). these single waypoints were rejected „because of missing or malformatted data“. when i changed the WAYPOINT_TOPIC to 'owntracks/{}/{}/waypoints', owntracks imported my published waypoint list, after i triggered it under Setting / Publish Waypoints.
2017-09-11 23:20:09 +02:00
Alok Saboo
6d01838632 Fixes #9379 - Added additional string check in Wunderground sensor (#9380)
* Added additional string check

* optimaze
2017-09-11 22:57:40 +02:00
Matt White
31f189da82 Added mqtt_statestream component (#9286)
* Added mqtt_statestream component

* Added tests for mqtt_statestream component

* mqtt_statestream: add test for valid new_state

* mqtt_statestream: Don't set initialized state

* mqtt_statestream: Switch to using async_track_state_change

* Cleanup
2017-09-11 22:08:12 +02:00
Alok Saboo
c7ecebfd07 Round off probability to 2 decimals. (#9365)
* Round off probablity to 2 decimals.

* Update tests

* remove debug print
2017-09-11 21:14:51 +02:00
John Arild Berentsen
cc1979691e Add polling interval service and setting available through zwave node entity panel (#9056)
* Add polling interval to value panel

* Blank lines removal

* Update tests

* Remove old config method

* Raound 1

* Round 2

* Comment spacing

* Expose value_id in attributes
2017-09-11 20:30:48 +02:00
morberg
e2fc9669f0 Add /usr/sbin to PATH (#9364)
The `braviatv`platform needs the `arp` command to finalize configuration. This resides in `/usr/sbin`, at least on macOS 10.10.
2017-09-11 09:31:05 +02:00
David
7307ab878a Bump pywebpush and pyJWT versions (#9355)
* Update html5.py

Bump pywebpush and PyJWT versions

* Update requirements_all.txt

* Update requirements_test_all.txt
2017-09-10 22:25:46 +02:00
Anders Melchiorsen
160c7fc685 Add HTTP Basic auth to RESTful Switch (#9162)
* Add HTTP Basic auth to RESTful Switch

* Remove redundant hass passing

* Initialize to current state

The state used to be None until the first periodic poll.

This commit refactors async_update so it can be used during setup as well,
allowing the state to start out with the correct value.

* Refactor turn_on/turn_off device communication

* Remove lint

* Fix Travis errors
2017-09-09 10:20:48 -07:00
Paulus Schoutsen
313a9e3984 Merge branch 'master' into dev 2017-09-09 00:53:00 -07:00
Paulus Schoutsen
ba310d3bd1 Version bump to 0.54.0.dev0 2017-09-09 00:52:47 -07:00
Paulus Schoutsen
3f2eba0932 Version bump to 0.53 2017-09-09 00:51:52 -07:00
Paulus Schoutsen
2d72cff575 Merge pull request #9327 from home-assistant/release-0-53
0.53
2017-09-09 00:31:53 -07:00
John Mihalic
3065575777 Bump pyHik version to add IO support (#9341) 2017-09-09 00:06:57 -07:00
Paulus Schoutsen
74bfcde814 Cleanup input_text (#9326) 2017-09-09 00:06:57 -07:00
Aaron Bach
c539b5c12b Adds the AirVisual air quality sensor platform (#9320)
* Adds the AirVisual air quality sensor platform

* Updated .coveragerc

* Removed some un-needed code

* Adding strangely-necessary pylint disable

* Removing a Python3.5-specific dict combiner method

* Restarting stuck coverage test

* Added units to AQI sensor (to get nice graph)

* Making collaborator-requested changes

* Removing unnecessary parameter from data object
2017-09-09 00:06:56 -07:00
Sergey Isachenko
d2d876945b Fix for potential issue with tesla initialization (#9307)
Fix for potential issue with tesla initialization
2017-09-09 00:06:56 -07:00
John Mihalic
2defb85fb2 Bump pyHik version to add IO support (#9341) 2017-09-09 00:06:06 -07:00
Paulus Schoutsen
7036a7845c Update frontend 2017-09-08 23:08:58 -07:00
Paulus Schoutsen
c44972c2c9 Update frontend 2017-09-08 23:08:38 -07:00
Paulus Schoutsen
fc7ffba9ae Merge branch 'master' into release-0-53 2017-09-08 21:52:29 -07:00
Paulus Schoutsen
5ec5552803 Cleanup input_text (#9326) 2017-09-08 21:19:49 -07:00
Aaron Bach
d1ef47384d Adds the AirVisual air quality sensor platform (#9320)
* Adds the AirVisual air quality sensor platform

* Updated .coveragerc

* Removed some un-needed code

* Adding strangely-necessary pylint disable

* Removing a Python3.5-specific dict combiner method

* Restarting stuck coverage test

* Added units to AQI sensor (to get nice graph)

* Making collaborator-requested changes

* Removing unnecessary parameter from data object
2017-09-08 16:05:51 +02:00
Sergey Isachenko
3b2bf1d567 Fix for potential issue with tesla initialization (#9307)
Fix for potential issue with tesla initialization
2017-09-07 18:20:27 +02:00
Julius Mittenzwei
77d0ad1797 Stable and asynchronous KNX library. (#8725)
* First draft of XKNX module for Home-Assistant

* XKNX does now take path of xknx.yaml as parameter

* small fix, telegram_received_callback has different signature

* changed method of registering callbacks of devices

* removed non async command lines from xknx

* telegram_received_cb not needed within HASS module

* updated requirements

* Configuration if XKNX should connect via Routing or Tunneling

* bumping version to 0.6.1

* small fix within xknx plugin

* bumped version

* XKNX-Switches are now BinarySensors and Logic from Sensor was moved to BinarySensor

* renamed Outlet to Switch

* pylint

* configuration of KNX lights via HASS config, yay!

* changed name of attribute

* Added configuration for xknx to switch component

* added support for sensors within hass configuration

* added support for climate within hass configuration

* Thermostat -> Climate

* added configuration support for binary_sensors

* renamed Shutter to Cover

* added configuration support for cover

* restructured file structure according to HASS requirements

* pylint

* pylint

* pylint

* pylint

* pylint

* pylint

* updated version

* pylint

* pylint

* pylint

* added setpoint support for climate devices

* devices are now in a different module

* more asyncio :-)

* pydocstyle

* pydocstyle

* added actions to binary_sensor

* allow more than one automation

* readded requirement

* Modifications suggested by hound

* Modifications suggested by hound

* Modifications suggested by hound

* Modifications suggested by hound

* xknx now imported as local import

* hound *sigh*

* lint

* 'fixed' coverage.

* next try for getting gen_requirements_all.py working

* removed blank line

* XKNX 0.7.1 with logging functionality, replaced some print() calls with _LOGGER

* updated requirements_all.txt

* Fixes issue https://github.com/XKNX/xknx/issues/51

* https://github.com/XKNX/xknx/issues/52 added raw access to KNX bus from HASS component.

* bumped version - 0.7.3 contains some bugfixes

* bumped version - 0.7.3 contains some bugfixes

* setting setpoint within climate device has to be async

* bumped version to 0.7.4

* bumped version

* https://github.com/XKNX/xknx/issues/48 Adding HVAC support.

* pylint suggestions

* Made target temperature and set point required attributes

* renamed value_type to type within sensor configuration

* Issue https://github.com/XKNX/xknx/issues/52 : added filter functionality for not flooding the event bus.

* suggestions by pylint

* Added notify support for knx platform.

* logging error if discovery_info is None.

* review suggestions by @armills

* line too long

* Using discovery_info to notifiy component which devices should be added.

* moved XKNX automation to main level.

* renamed xknx component to knx.

* reverted change within .coveragerc

* changed dependency

* updated docstrings.

* updated version of xknx within requirements_all.txt

* moved requirement to correct position

* renamed configuration attribute

* added @callback-decorator and async_prefix.

* added @callback decorator and async_ prefix to register_callbacks functions

* fixed typo

* pylint suggestions

* added angle position and invert_position and invert_angle to cover.knx

* typo

* bumped version within requirements_all.txt

* bumped version

* Added support for HVAC controller status
2017-09-07 00:11:55 -07:00
Sebastian Muszynski
9a7089bad3 Platform not ready behavior fixed. (#9325)
Expose the device model as sensor attribute.
Device initialized log message added. Provides device model, firmware and hardware version.
2017-09-07 00:01:59 -07:00
Mister Wil
894200d87d Fixed bug with devices not being discovered correctly. (#9311) 2017-09-06 09:11:32 -07:00
Alok Saboo
fad914de8c Version bump dlib to 1.0.0 (#9316) 2017-09-06 07:35:34 -07:00
ohmer1
5971a7c009 Optionally disable ssl certificate validity check. (#9181)
* Optionally disable ssl certificate validity check.

* Fix lines too long.

* Fix formatting.

* Force build CI

* Fix "Method could be a function (no-self-use)"
2017-09-06 08:58:13 +03:00
Mike Christianson
e7a5f7bcdf Follow Twitter guidelines for media upload by conforming to the "STATUS" phase, when required, and by providing "media_category" information. These will, for example, allow users to upload videos that exceed the basic 30 second limit. (#9261)
See:
 - https://twittercommunity.com/t/media-category-values/64781/7
 - https://twittercommunity.com/t/duration-too-long-maximim-30000/68760
 - https://dev.twitter.com/rest/reference/get/media/upload-status.html
2017-09-05 18:49:40 -07:00
Konstantin Belyalov
9ade8002ac Add new config variable to MQTT light (#9304)
* Add new config variable to MQTT light

* Address reviewer's issues: refactor template render part.

* Update mqtt.py
2017-09-06 01:01:03 +02:00
Joe Lu
788275da32 Add post_pending_state attribute to manual alarm_control_panel (#9291)
Add post_pending_state attribute to manual alarm_control_panel
2017-09-05 20:26:59 +02:00
Erik Eriksson
418ccc820a Handle the case where no registration number is available (instead display VIN (vehicle identification number)). (#9073) 2017-09-05 09:10:01 -07:00
Jan Almeroth
e4bb8b0444 Introducing a media_player component for Yamaha Multicast devices (#9258)
* Introducing media_player yamaha_multicast

* Fix pep8_max_line_length

* Revert "Fix pep8_max_line_length"

This reverts commit 664c25d657.

* Revert "Introducing media_player yamaha_multicast"

This reverts commit a4fb64b53a.

* Introducing media_player for Yamaha MultiCast Devices

* Add missing Docstrings

* Adding Requirements

* Add Geofency device tracker (#9106)

* Added Geofency device tracker

Added Geofency device tracker

* fix pylint error

* review fixes

* merge coroutines

* Version bump

* Version bump

* D210: No whitespaces allowed surrounding docstring text

* Fix linting

* Version bump

* Revert "Add Geofency device tracker (#9106)"

This reverts commit c240d907d2.

* Fix Invalid method names

* Fix update_status timer

* Fix Invalid class name "mcDevice"

* Fix Access to a protected members

* Introducing source_list setter

* Fix logging

* Version bump

* D400: First line should end with a period (not 'e')

* Removed unnecessary logging

* Minor changes

Thanks to comments from @andrey-git
2017-09-05 19:07:58 +03:00
BioSehnsucht
552abf7da5 Add input_text component (#9112) 2017-09-05 09:04:07 -07:00
runningman84
9ede0f57e6 Added DWD WarnApp Sensor (#8657)
* Added DWD WarnApp Sensor

* Fixed some idents and spaces

* Removed unused imports

* Removed comment

* Some fixes

* Added throttle

* Renamed sensor to dwd weather warnings

* Renamed test file

* shorten lines

* shorten lines

* Implemented changes requested by fabaff

* added ATTRIBUTION

* move ATTRIBUTION to existing method

* fixed lint tests

* Fix linter issues

* Fix linter issues

* Fix linter

* Fixed linter
2017-09-05 08:40:47 -07:00
Phil Cole
0b1677de6d Expose hue group 0 (#8663)
* Tado Fix #8606

Handle case where 'mode' and 'fanSpeed' are missing JSON. Based on
changes in commit
adfb608f86

* Expose hue group 0 to HA #8652

If allow_hue_groups is set expose "All Hue Lights" group for "special
group 0".  This does add an additional Hue API call for every refresh
(approx 30 secs) to get the status of the special group 0 because it's
not included in the full API pull that currently occurs.

* Revert "Expose hue group 0 to HA #8652"

This reverts commit db7fe47ec7.

* Expose hue group 0 to HA #8652

If allow_hue_groups is set expose "All Hue Lights" group for "special
group 0".  This does add an additional Hue API call for every refresh
(approx 30 secs) to get the status of the special group 0 because it's
not included in the full API pull that currently occurs.

* Changes per review by balloob

1) Use all_lights instead of all_lamps
2) Fix line lengths and trailing whitespace
3) Move "All Hue Lights" to GROUP_NAME_ALL_HUE_LIGHTS constant

* Make "All Hue Lights" a constant

* Fix trailing whitespace
2017-09-05 08:38:12 -07:00
Sean Gollschewsky
968ed6ef5b Ensure display-name does not exceed 12 characters for CecAdapter. (#9268)
* Ensure display-name does not exceed 12 characters for CecAdapter.

* Miscalculated offset.
2017-09-05 18:11:02 +03:00
Pascal Vizeli
a28ac37a91 Update jinja to 2.9.6 (#9306)
* Update jinja 2.10

* Update requirements_all.txt

* Update package_constraints.txt

* Update package_constraints.txt

* Update requirements_all.txt

* Update setup.py
2017-09-05 17:03:24 +02:00
Dan Sarginson
5ba39c849e Fix for Honeywell Round thermostats (#9308)
This fixes an issue (#8554) whereby the Honeywell thermostats stopped
working after a period of hours or days. We do this by forgetting the
authorisation token that was sent back to us when we first logged in,
which causes the underlying evohomeclient library to perform the full
login procedure again.
2017-09-05 07:06:28 -04:00
Brian Hopkins
984cae5310 Upgrade mycroftapi to 2.0 (#9309)
* updating mycroftapi version

* updating mycroftapi version
2017-09-05 07:05:31 -04:00
upsert
c3a91000ac Improved Lutron Caseta shade support (#9302) 2017-09-05 11:30:36 +02:00
Pascal Vizeli
ed699896cb Core track same state for a period / Allow on platforms (#9273)
* Core track state period / Allow on platforms

* Add tests

* fix lint

* fix tests

* add new tracker to automation state

* update schema

* fix bug

* revert validate string

* Fix bug

* Set arguments to async_check_funct

* add logic into numeric_state

* fix numeric_state

* Add tests

* fix retrigger state

* cleanup

* Add delay function to template binary_sensor

* Fix tests & lint

* add more tests

* fix lint

* Address comments

* fix test & lint
2017-09-05 02:01:01 +02:00
Tom Matheussen
67828cb7a2 Handle spotify failing to refresh access_token (#9295)
* Handle spotify failing to refresh access_token

* Remove whitespace
2017-09-04 20:47:40 +02:00
Andreas Jacobsen
54de3d89d1 Added intent_type to exception log (#9289) 2017-09-04 13:40:08 +02:00
Jeroen ter Heerdt
1b5e574a76 Fixing bug when using egardiaserver - package requirement updated to 1.0.20. (#9294)
* Bumping pythonegardia package requirement up to .18

* Updating requirements_all to reflect updated pythonegardia package .18

* Catching up with reality and updating egardia.py

Requirements_all reflects updated package requirement for python-egardia of 1.0.20
2017-09-04 13:34:56 +02:00
Daniel Høyer Iversen
e6207684bf rfxtrx lib upgrade (#9288) 2017-09-04 10:19:58 +02:00
Fabian Affolter
7c7a5a4a15 Upgrade python-telegram-bot to 8.0.0 (#9282) 2017-09-03 17:21:51 -04:00
Fabian Affolter
5dfd60a029 Upgrade youtube_dl to 2017.9.2 (#9279) 2017-09-03 17:21:35 -04:00
Paul Sokolovsky
38e1b81ff6 discovery: If unknown NetDisco service discovered, log about it. (#9280)
Otherwise, known services are logged, ignored are logged, but unknown -
not. Logging them is quite helpful for someone working on adding new
discovery service to NetDisco/HA, and would help to decouple NetDisco
library further: another project may use a generic NetDisco library,
and contribute new service to it, which won't be automatically supported
by HA. But logging about it would be a good hint to HA users that they
can look into supporting it.
2017-09-03 16:27:13 -04:00
Dan Ports
68343ac81f insteon_plm: fix typo in attributes (#9284) 2017-09-03 15:42:05 -04:00
emlt
7694c31814 Change attribute names (#9277)
Remove spaces and capitals in attribute names to be consistent with sensors and other switches.
2017-09-03 16:07:12 +02:00
Greg Dowling
db36b5cd23 Merge pull request #9274 from home-assistant/bump_pywemo
Bump pywemo, handle more ports.
2017-09-03 12:13:10 +01:00
pavoni
a78f5e0970 Bump pywemo, handle more ports. 2017-09-03 11:31:55 +01:00
Abílio Costa
0889e38cb1 flux: fix for when stop_time is after midnight (#8932)
* flux: fix for when stop_time is after midnight

* flux: fix imports

* flux: add missing check when now is after midnight

* flux: one more try; should fix all use cases now

* flux switch: fix lint

* flux switch: add new tests

* flux switch: fix tests lint

* flux switch: fix tests docstrings
2017-09-02 18:02:11 +02:00
Gunnar Helgason
f51163f803 Add Geofency device tracker (#9106)
* Added Geofency device tracker

Added Geofency device tracker

* fix pylint error

* review fixes

* merge coroutines
2017-09-01 23:56:59 +02:00
Matthew Breedlove
639eb81aef Adding ZWave CentralScene activation handler. (#9178)
* Adding ZWave CentralScene activation handler.

* Migrated CentralScene logic to node_entity.py

Removed extraneous logging

Modified scene_activated event to send the scene_id and scene_data separately

* Adding unit test for ZWave central scene activation

* Removed return to allow node statistics to update after central scene message is received
2017-09-01 21:41:35 +02:00
Fabian Affolter
8797932f80 Upgrade psutil to 5.3.0 (#9253) 2017-09-01 18:05:53 +02:00
Fabian Affolter
8d1f6d3995 Upgrade sendgrid to 5.2.0 (#9254) 2017-09-01 18:05:37 +02:00
Christian Brædstrup
4defd96cd6 Version bump of DLink switch to v0.6.0 (#9252) 2017-09-01 15:27:43 +02:00
snjoetw
185d838803 This is to fix #6386: Manual Alarm not re-arm after 2nd trigger (#9249) 2017-09-01 12:08:30 +02:00
Philipp Schmitt
713f7fa2a1 Fix nello.io login (#9251) 2017-09-01 12:02:22 +02:00
Daniel Høyer Iversen
4cd5173ac8 upgrade xiaomi lib (#9250) 2017-09-01 11:58:26 +02:00
Oliver
8d5f6723ce Added configurable timeout for receiver HTTP requests | Additional AV… (#9244)
* Added configurable timeout for receiver HTTP requests | Additional AVR-X detection based on CommApiVers | Treat Marantz SR6007 - SR6010 as AVR-X device

* timeout value not passed correctly
2017-09-01 09:15:47 +02:00
Marcelo Moreira de Mello
a55895b662 Make sure Ring binary_sensor state will update only if device_id matches (#9247) 2017-09-01 09:14:16 +02:00
Pascal Vizeli
0af4f8903d Add available to sonos (#9243)
* Readd sonos available flag / fix polling state

* cleanup
2017-09-01 00:23:11 +02:00
Pascal Vizeli
836b528bd3 WIP: Homematic improvments with new hass interfaces (#9058)
* Remove hass to init hack and use official interfaces

* fix lint

* Fix lint

* change style
2017-08-31 21:16:44 +02:00
Martin Hjelmare
274e4449ea Fix possible KeyError (#9242)
* Multiple devices per child per platform would lead to KeyError.
2017-08-31 21:00:09 +02:00
Daniel Høyer Iversen
acb6b7c68d title and message was swapped in pushbullet (#9241) 2017-08-31 20:41:22 +02:00
Adam Mills
7d281fd224 Skip automatic events older than latest data (#9230)
* Skip automatic events older than latest data

* Update test
2017-08-31 16:29:18 +02:00
Fabian Affolter
60342b4738 Upgrade discord.py to 0.16.11 (#9239) 2017-08-31 16:26:52 +02:00
happyleavesaoc
99c1c9472a mopar sensor (#9136)
* mopar sensor

* fix doc url

* mopar review comments

* remove unneeded hass.data handling

* fix lint
2017-08-31 16:26:33 +02:00
Daniel Høyer Iversen
d816ff26ad A bugfix for pushbullet (#9237)
* Bug fix for pushbullet
2017-08-31 14:19:33 +02:00
John K. Luebs
e22ec28bce Use ZCL mandatory attribute to determine ZHA light capabilities (#9232)
The manadatory ColorCapabilities attribute should indicate whether a
light is capable of XY color changes and/or color temperature.
2017-08-31 00:18:01 -05:00
Andrey
bb37294047 Allow panels with external URL (#9214)
* Allow panels with external URL

* Update comment
2017-08-30 23:21:24 -05:00
Maciej Sokołowski
de4a4fe71a [light.tradfri] Full range of white spectrum lightbulbs support (#9224)
* [light.tradfri] Support for pytradfri version supporting full white spectrum

* [light.tradfri] Checkout pytradfri master

* Developer docker image adjusted

* [light.tradfri] pytradfri 2.2 support for white spectrum bulbs

* Removed fix already included in dev

* Style adjusted

* pylint false positive overriden

* Review remarks applied (#1)

* make pylint happy

* Review remarks
2017-08-30 23:19:06 -05:00
Sergey Isachenko
5f445b4a13 Tesla platform (#9211)
* Tesla support implemetation

* requirements_all.txt fix

* .coveragerc fix

* logging-too-many-args fix

* logging-too-many-args attempt 2

* Post-review fixes.

* requirements version fix

* requirements

* Lint fix

* Hot fix

* requirements_all.txt fix

* Review preparation.

* 1. Linting fix.
2. Minimal value for SCAN_INTERVAL hardcoded to 300 sec (to prevent possible ban form Tesla)

* Removed redundant whitespace.

* Fixed components according to @MartinHjelmare proposals and remarks.

* .coveragerc as @MartinHjelmare suggested.

* Minor changes

* Fix docstrings

* Update ordering

* Update quotes

* Minor changes

* Update quotes
2017-08-30 23:13:02 -05:00
Fabian Affolter
10e8aea46b Upgrade shodan to 1.7.5 (#9228) 2017-08-30 22:23:28 +02:00
Kris Molendyke
76c7eef7d8 Add Tank Utility sensor (#9132)
* Add Tank Utility sensor

* Fix, disable Pylint errors

* Move coverage omission to single platform section

* Do not catch unknown exceptions

* Check for invalid credentials in setup

* Update tank_utility.py
2017-08-30 22:21:54 +02:00
Daniel Høyer Iversen
214c92d787 pushbullet, send a file from url (#9189)
* pushbullet, send a file from url

* pushbullet, send a file from url

* Simplify
2017-08-30 21:42:27 +02:00
Jeroen ter Heerdt
f2551c08af Egardia package to .19 and change in port number for egardiaserver (#9225) 2017-08-30 20:11:45 +02:00
Lukas Barth
3a0e38aa73 Add max_age to statistics sensor (#8790)
* Add max_age to statistics sensor

* Allow only non-zero sampling sizes

* Fix long line

* Fix style
2017-08-30 17:13:36 +02:00
J.J.Barrancos
d2d28fd419 Moved all code into the switch component
Per request moved all the code inside the switch
2017-08-30 16:11:40 +02:00
Riccardo Canta
56f9ccb877 Allow sonos to select album as a source (#9221)
Importing the fix in the PR https://github.com/home-assistant/home-assistant/pull/8258 I noticed that the same error is present also for Spotify album so I have extended the code and tested it. It works fine on my setup
2017-08-30 15:10:02 +02:00
Marcelo Moreira de Mello
f76436f326 Fix fitbit error when trying to access token after upgrade. (#9183)
*   - Fixes Fitbit error when trying to refresh oauth token

  The 3rd python-fitbit module requires an extra kwarg on the FitBit
  constructor called refresh_cb. The value should be a function that
  accepts one argument token.

  This value will be a dictionary with the keys:

     'access_token', 'refresh_token', 'expires_at'

  This implements a lambda refresh_cb as required by the Fitbit module
  to work, however the new token will always be save manually on
  every update() call.

*  Simplified by calling  expires_at instead reading again from dict
2017-08-30 10:01:01 +02:00
Fabian Affolter
4aafcfa478 Upgrade sendgrid to 5.0.1 (#9215) 2017-08-29 21:06:31 -07:00
Fabian Affolter
8673e53940 Upgrade pyasn1 to 0.3.3 and pyasn1-modules to 0.1.1 (#9216) 2017-08-29 21:06:18 -07:00
Nicholas Sielicki
ebc7ade591 directv: extended discovery via REST api, bug fix (#8800)
* fix not providing device for discovered directvs

This fixes a bug introduced at 6884965c80

Discovered directv boxes would not be instantiated with a DEVICE
parameter.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>

* directv: add discovery of RVU clients

If discovery is used with directv, also try to further discover and
configure RVU client set-top boxes by requesting information from a REST
service running on the main directv box/RVU-server.

This commit also disables discovery if any directv configuration is
supplied by the user.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>

* components/media_player/directv.py: use hass.data

Use hass.data instead of a global to remember state.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>

* unconditionally import requests in directv.py

Requests is a core requirement, so we're okay to import at the top of
the file rather than conditionally / in a function.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>
2017-08-30 00:08:56 +02:00
Jeff McGehee
7de73e9ef7 Bayesian Binary Sensor (#8810)
* Bayesian Binary Sensor

Why:

* It would be beneficial to leverage various sensor outputs in a
Bayesian manner in order to sense more complex events.

This change addresses the need by:

* `BayesianBinarySensor` class in
`./homeassistant/components/binary_sensor/bayesian.py`
* Tests in `./tests/components/binary_sensor/test_bayesian.py`

Caveats:
This is my first time in this code-base. I did try to follow conventions
that I was able to find, but I'm sure there will be some issues to
straighten out.

* minor cleanup

* Address reviewer's comments

This change addresses the need by:

* Removing `CONF_SENSOR_CLASS` and its usage in `get_deprecated`.
* Make probability update function a static method, and use single `_`
to match project conventions.

* Address linter failures

* fix `device_class` declaration

* Address Comments

Why:
* Not validating config schema enough.
* Not following common practices for async initialization.
* Naive implementation of Bayes' rule.

This change addresses the need by:
* Improving config validation for observations.
* Moving initialization logic into `async_added_to_hass`.
* Re-configuring Bayesian updates to allow true P|Q usage.

* address linting issues

* Improve DRYness by adding `_update_current_obs` method

* update doc strings and ensure functions are set up properly for async

* Make only 1 state change handle

* fix style

* fix style part 2

* fix lint
2017-08-29 23:53:41 +02:00
Paulus Schoutsen
0b58d5405e Add cloud auth support (#9208)
* Add initial cloud auth

* Move hass.data to a dict

* Move mode into helper

* Fix bugs afte refactor

* Add tests

* Clean up scripts file after test config

* Lint

* Update __init__.py
2017-08-29 13:40:08 -07:00
Mister Wil
33c906c20a Abode push events and lock, cover, and switch components (#9095)
* Updated abodepy version to 0.7.1

* Refactored to use AbodeDevice. Added Abode Lock device.

* Added push updates to abode devices.

* Upgraded to 0.7.2 after finding issue with callbacks.

* Refactored to use AbodeDevice. Added Abode Lock device.

* Added push updates to abode devices.

* Upgraded to 0.7.2 after finding issue with callbacks.

* Bumped version to 0.8.2. Modified code to work with new constants and properties. Added cover and switch.

* Fixed hound violations.

* Updated to 0.8.3 to fix small bug with standby mode. Fixed comment in cover/abode.py.

* Fix lint issues

* Removed excessive logging. Moved device callback registration to async_added_to_hass. Moved abode controller from global into hass data.

* Removed explicit None from dict.get()

* Move device class into the constructor.

* Changed constant name to platforms.

* Changes as requested.

* Removing stray blank line.

* Added blank line of which I'm not sure how it was removed.

* Updated version to 0.9.0. Fixed motion sensor. Added power_switch_meter device type.

* Update abode.py

* fix lint
2017-08-29 17:34:19 +02:00
Paulus Schoutsen
81a00bf3f1 Lint Sonarr tests 2017-08-29 08:10:38 -07:00
Martin Hjelmare
b8d737c0cc Upgrade pymysensors to 0.11.1 (#9212) 2017-08-29 17:10:28 +02:00
Daniel Høyer Iversen
ee28b439b3 Refactor rfxtrx (#9117)
* rfxtrx refactor

* rfxtrx refactor

* rfxtrx refactor

* rfxtrx refactor

* rfxtrx refactor

* rfxtrx refactor

* rfxtrx refactor

* rfxtrx refactor
2017-08-29 16:22:28 +02:00
Daniel Høyer Iversen
aa8dd8fbdd Issue #6893 in rfxtrx (#9130)
* Issue #6893 in rfxtrx

* Update rfxtrx.py

* rfxtrx issue
2017-08-29 16:20:26 +02:00
William Scanlon
3e0eb8763f Support for season sensor (#8958)
Add an optional extended description…
2017-08-29 16:18:36 +02:00
Fabian Affolter
0687a457b1 Add counter component (#9146) 2017-08-29 15:44:36 +02:00
Dale Higgs
38071501b4 Fix and optimize digitalloggers platform (#9203)
* Fix and optimize digitalloggers platform

* Fix line length

* Fix hanging indentation

* Add missing docstring

* Add period to end of docstring

* Add second blank line
2017-08-29 15:38:42 +02:00
mjj4791
5d800c1d51 Prevent error when no forecast data was available (#9176)
* Prevent error when no forecast data was available

Prevent an Error when buienradar data was available, but no forecasted data was retrieved for the requested day.

* Update buienradar.py

* Update buienradar.py
2017-08-29 15:33:47 +02:00
Trevor
75559cb81f Add "status" to Sonarr sensor (#9204)
* Use X-Api-Key header

* Increase timeout

* Add "status" to Sonarr sensor

* Update test_sonarr.py

* Update test_sonarr.py

* Update test_sonarr.py

* Update sonarr.py

* Update sonarr.py
2017-08-29 15:33:27 +02:00
J.J.Barrancos
67007aed40 Updated requirements_all.txt 2017-08-29 14:08:55 +02:00
J.J.Barrancos
df1c3dfb67 Hound issue "whitespace" 2017-08-29 13:47:47 +02:00
J.J.Barrancos
689484216d Using latest module and fixed state issue
- pyrainbird 0.0.9 allows the override (if ever needed) connection retry/sleep
- Forces state towards the Entity when switching the switches. Gives better UI experience.
2017-08-29 13:45:18 +02:00
aetolus
0de6a37822 fix worldtidesinfo #9184 (#9201) 2017-08-29 08:28:40 +02:00
bobnwk
6505019701 Update pushbullet.py (#9200) 2017-08-29 05:40:33 +02:00
Mario Wenzel
e76e9e0966 Fix dht22 when no data was read initially #8976 (#9198)
This fixes https://github.com/home-assistant/home-assistant/issues/8976
When no data was available the module crashes.
2017-08-28 22:46:31 +03:00
J.J.Barrancos
51c6029fe5 Fixed issue with missing key 2017-08-28 21:07:40 +02:00
Paulus Schoutsen
bd71a33ba8 Merge pull request #9196 from home-assistant/release-0-52-1
0.52.1
2017-08-28 09:22:00 -07:00
Nolan Gilley
0ccff6c03e bump ecobee version to fix issue 9190 (#9191) 2017-08-28 09:15:34 -07:00
mjj4791
3509ecf07f Prevent iCloud exceptions in logfile (#9179)
* Prevent iCloud exceptions in logfile

With this change ValueError exceptions in the logfile caused by this component will disappear.
These errors are caused by the iCloud API returning an HTTP 450 error and the external lib throwing a ValueError because of it.

A PR has been raised against the external library, but that fix did not yet make it into a new version of the library. This will catch the exception in the mean time.... https://github.com/picklepete/pyicloud/pull/138

* Align log messages
2017-08-28 09:15:34 -07:00
Paulus Schoutsen
308b822832 Wrap state when iterating a domain in templates (#9157) 2017-08-28 09:15:34 -07:00
Adam Mills
d986b8f4c2 Bump aioautomatic to prevent leaking exceptions (#9148) 2017-08-28 09:15:33 -07:00
Sean Dague
e6892a4077 Fix import for foscam (#9140)
While waiting for a new pyfoscam release, we can fix this for users
just by changing the import. Foscam devices a pretty widely deployed,
so a regression here is definitely no fun.

Fixes Bug #8940
2017-08-28 09:15:33 -07:00
Daniel Høyer Iversen
422be25d22 bug fix pushbullet (#9139) 2017-08-28 09:15:33 -07:00
Daniel Høyer Iversen
0ae1f85f9f Fix issue #9116 in pushbullet (#9128)
* Fix issue #9116 in pushbullet
2017-08-28 09:15:32 -07:00
Andrey Kupreychik
8a89643338 Close stream request once we end up with proxy (#9110)
* Close stream request once we end up with proxy

* Update aiohttp_client.py

* Update aiohttp_client.py

* Removed trailing whitespace
2017-08-28 09:15:32 -07:00
Paulus Schoutsen
10e3c00f07 Version bump to 0.52.1 2017-08-28 09:11:11 -07:00
mjj4791
cc18b5af3d Prevent iCloud exceptions in logfile (#9179)
* Prevent iCloud exceptions in logfile

With this change ValueError exceptions in the logfile caused by this component will disappear.
These errors are caused by the iCloud API returning an HTTP 450 error and the external lib throwing a ValueError because of it.

A PR has been raised against the external library, but that fix did not yet make it into a new version of the library. This will catch the exception in the mean time.... https://github.com/picklepete/pyicloud/pull/138

* Align log messages
2017-08-28 09:09:36 -07:00
Paulus Schoutsen
924290adb0 Update frontend 2017-08-28 09:04:34 -07:00
J.J.Barrancos
0eee544d17 Changed component to use entity and switch
Changed component to use entity and switch.
2017-08-28 17:57:45 +02:00
Nolan Gilley
f9c22b0e61 bump ecobee version to fix issue 9190 (#9191) 2017-08-28 10:12:21 -05:00
Ryan Kraus
2533b49aef Merge pull request #9182 from home-assistant/pyisy-update
Bumped the version of PyISY
2017-08-28 00:02:28 -04:00
Ryan Kraus
f6a701e843 Bumped the version of PyISY
PyISY has been updated to better support newer ISY994 firmware. This
should resolve #7601.
2017-08-27 23:24:29 -04:00
Brian Hopkins
bd039b8c53 Mycroft notify/component (#9173)
* working mycroft notification platform

* Update mycroft.py

* Update mycroft.py

* Update mycroft.py

* Update mycroft.py

* updating to use new api

updating code to use new api.

* updating changes

updating files

* updating typos

fixing some typos

* Update mycroft.py

adding text

* fixing pep issues

fixing pep issues

* adding new mycroft component

adding mycroft component

* updating

updating code

* updating typo

fixing typo

* updating file

adding updates

* updating notify

updating notify component for new changes

* Update mycroft.py

* Update mycroft.py

* Update mycroft.py

* updating for tox

updating to pass tox tests

* updating for tox

fixing tox errors

* fixing tox issues

fixing tox issues

* fixing tox issues

fixing more tox issues

* updating requirement

adding requirement for component

* fixed typo

fixed typo

* updating requirements

updating requirements

* updating code

updating code

* updating files

updating

* updating

* adding logging

adding in logging

* fixing typo

fixing typo

* updating debugs

* updating files

updating files

* updating dependencies

updating dependencies

* updating to load notification

updating to load notification

* cleaning up whitespace

* updating requirements_all.txt

* adding requirement

adding requirement

* Update mycroft.py

* Update .coveragerc

updated .coveragerc
2017-08-27 13:53:20 -07:00
Sebastian Muszynski
de48d42f33 "TypeError: write_to_hub() takes 2 positional arguments but 4 were given" fixed. (#9174) 2017-08-27 21:41:47 +02:00
Sebastian Muszynski
bf315da8df Xiaomi gateway: Device support for the Aqara Water Leak Sensor (sensor_wleak.aq1) (#9172)
* Device support for the Aqara Water Leak Sensor (sensor_wleak.aq1) added.

* Required version of PyXiaomiGateway changed.
2017-08-27 21:06:11 +02:00
EmitKiwi
654f6892f9 Mysensors nodes can be renamed in config file (#9123)
* Mysensors nodes can be renamed in the config file

* Replace nodes array with dict. Replace whole name of the node.

* Improved iteration on node names
2017-08-27 20:40:38 +02:00
Adam Mills
cd3f0f8f96 Use node_modules gulp in script/build_frontend (#9170) 2017-08-27 13:46:37 -04:00
Daniel Høyer Iversen
499d54c8fc upgrade xiaomi lib to 0.3.1 to supprt water sensor (#9168) 2017-08-27 19:31:34 +02:00
Paulus Schoutsen
5629157740 Allow getting number of available states in template (#9158) 2017-08-27 18:33:25 +02:00
Andrey
c367021aa4 Allow specifying custom html urls to load. (#9150)
* Allow specifying custom html urls to load.

* Change add_extra_html_urls to accept a single URL
2017-08-27 09:07:58 -07:00
Fabian Affolter
8fdd9712e6 Upgrade uber_rides to 0.5.2 (#9149) 2017-08-27 11:31:06 +02:00
Fabian Affolter
f47de06f02 Upgrade sphinx-autodoc-typehints to 1.2.3 (#9151) 2017-08-27 11:30:42 +02:00
Fabian Affolter
7062c2b257 Remove links to gitter (#9155) 2017-08-27 11:30:26 +02:00
Fabian Affolter
ae5fca1ec9 Upgrade async_timeout to 1.3.0 (#9156) 2017-08-27 11:30:04 +02:00
Paulus Schoutsen
8605098ea0 Wrap state when iterating a domain in templates (#9157) 2017-08-26 17:00:59 -07:00
Adam Mills
21bf089b17 Bump aioautomatic to prevent leaking exceptions (#9148) 2017-08-26 17:09:57 -04:00
Andrey
c73338bf3e Backend changes for customize config panel. (#9134)
* Backend changes for customize config panel.

* Backend changes for customize config panel.

* Add customize.yaml to default config

* Precreate customize.yaml

* Add tests
2017-08-26 10:02:32 -07:00
Andrey Kupreychik
c537770786 Close stream request once we end up with proxy (#9110)
* Close stream request once we end up with proxy

* Update aiohttp_client.py

* Update aiohttp_client.py

* Removed trailing whitespace
2017-08-26 09:56:39 -07:00
Daniel Høyer Iversen
493353e4de bug fix pushbullet (#9139) 2017-08-26 09:12:51 -07:00
Sean Dague
f4d464c008 Fix import for foscam (#9140)
While waiting for a new pyfoscam release, we can fix this for users
just by changing the import. Foscam devices a pretty widely deployed,
so a regression here is definitely no fun.

Fixes Bug #8940
2017-08-26 09:08:37 -07:00
Daniel Høyer Iversen
0d3fa59d77 Fix issue #9116 in pushbullet (#9128)
* Fix issue #9116 in pushbullet
2017-08-26 09:36:54 +02:00
Paulus Schoutsen
50e5032f86 Merge pull request #9131 from home-assistant/release-0-52
0.52
2017-08-25 22:11:12 -07:00
Martin Hjelmare
1d615ea6c3 Refactor mysensors callback and add validation (#9069)
* Refactor mysensors callback and add validation

* Add mysensors entity class. The mysensors entity class inherits from
  a more general mysensors device class.
* Extract mysensors name function.
* Add setup_mysensors_platform for mysensors platforms.
* Add mysensors const schemas.
* Update mysensors callback and add child validation.
* Remove gateway wrapper class.
* Add better logging for mysensors callback.
* Add discover_persistent_devices function.
* Remove discovery in mysensors component setup.
* Clean up gateway storage in hass.data.
* Update all mysensors platforms.
  * Add repr for MySensorsNotificationDevice.
  * Fix bug in mysensors climate target temperatures.
  * Clean up platforms. Child validation simplifies assumptions in
    platforms.
  * Remove not needed try except statements. All messages are validated
    already in pymysensors.
* Clean up logging.
* Add timer debug logging if callback is slow.
* Upgrade pymysensors to 0.11.0.

* Make dispatch callback async

* Pass tuple device_args and optional add_devices

* Also return new_devices as list instead of dictionary.
2017-08-25 21:47:22 -07:00
Sebastian Muszynski
56083c0c64 Xiaomi Philips Lights integration (#9087)
* Adds support for the Xiaomi Philips LED Ball and Ceiling Lamp

* Documentation url updated.

* New component to .coveragerc added.

* Unused import removed.

* translate labeled as static method.

* Mixed parameters in log message fixed.

* Order of requirements_all.txt fixed.

* Plattform updated. It's async now.

* Simplifiable if-statement fixed.

* Some more clean-up of unneeded stuff.

* Platform schema updated.

* Component is called xiaomi_philipslight now.

* Requirements all updated.

* Initialization of some variables updated.

* Raise PlatformNotReady exception if light cannot be discovered.

* Import of math removed.
Missing space added.

* Remove unnecessary updates
2017-08-25 21:27:31 -07:00
Martin Hjelmare
8775c54d29 Refactor mysensors callback and add validation (#9069)
* Refactor mysensors callback and add validation

* Add mysensors entity class. The mysensors entity class inherits from
  a more general mysensors device class.
* Extract mysensors name function.
* Add setup_mysensors_platform for mysensors platforms.
* Add mysensors const schemas.
* Update mysensors callback and add child validation.
* Remove gateway wrapper class.
* Add better logging for mysensors callback.
* Add discover_persistent_devices function.
* Remove discovery in mysensors component setup.
* Clean up gateway storage in hass.data.
* Update all mysensors platforms.
  * Add repr for MySensorsNotificationDevice.
  * Fix bug in mysensors climate target temperatures.
  * Clean up platforms. Child validation simplifies assumptions in
    platforms.
  * Remove not needed try except statements. All messages are validated
    already in pymysensors.
* Clean up logging.
* Add timer debug logging if callback is slow.
* Upgrade pymysensors to 0.11.0.

* Make dispatch callback async

* Pass tuple device_args and optional add_devices

* Also return new_devices as list instead of dictionary.
2017-08-25 08:58:05 -07:00
Paulus Schoutsen
044b96e3cd Version bump to 0.53.0.dev0 2017-08-25 08:44:35 -07:00
Paulus Schoutsen
2e1b1635b1 Version bump to 0.52 2017-08-25 08:44:02 -07:00
Paulus Schoutsen
fe7dca5144 Merge remote-tracking branch 'origin/master' into dev 2017-08-25 08:43:26 -07:00
J.J.Barrancos
21cca21124 Recommit corrected
Recommit corrected
2017-08-25 17:04:38 +02:00
J.J.Barrancos
f837451633 St*pid mistake.. wrong place 2017-08-25 16:59:37 +02:00
J.J.Barrancos
cce4a569e4 Changed doc and added default schema 2017-08-25 16:06:49 +02:00
Fabian Affolter
fdeef2f707 Use const (#9127)
* Use const

* Align quotes
2017-08-25 13:30:00 +02:00
J.J.Barrancos
4feea9d7ec pydocstyle fixes
pydocstyle fixes
2017-08-25 13:26:38 +02:00
PhracturedBlue
2ec0d25a38 optimistic mode for template covers (w/o timed movement) (#8402)
* Emulate set_current_position in cover.template

* Add opportunistic mode

* Prevent another move when cover is already moving.  Add tests for opotunistic/timed-delay mode

* Remove timed-move capabilities

* Set init state to unknown

* cleanup template

* Update test_template.py
2017-08-25 12:33:53 +02:00
J.J.Barrancos
7aff588bf0 pylint, coverage and requirement fix
pylint, coverage and requirement fix
2017-08-25 12:01:32 +02:00
Daniel Høyer Iversen
fb5019e73f refactor pushbullet (#9125)
* refactor push bullet
2017-08-25 11:25:06 +02:00
Daniel Høyer Iversen
1e276a7b07 Xiaomi (#9126)
* small fixes xiaomi
2017-08-25 10:22:32 +02:00
jbarrancos
41a046a69d Typo 2017-08-25 00:08:40 +02:00
Daniel Høyer Iversen
d72a181e30 Update flux_led.py (#9122) 2017-08-24 23:31:57 +02:00
jbarrancos
e548bd5312 PIP8 Fixes
PIP8 Fixes
2017-08-24 22:49:54 +02:00
jbarrancos
88098283c7 Markup fixes
Markup fixes
2017-08-24 22:40:45 +02:00
jbarrancos
6c6ed29329 Fixed some markup and removed not yet needed class
Fixed issues during hound run (markup) and a class which is obsolete
2017-08-24 22:35:30 +02:00
jbarrancos
c4f4e492e5 Removed some whitelines
Removed some whitelines
2017-08-24 18:41:25 +02:00
jbarrancos
c286e2c434 Rainbird WiFi LNK Irrigation Implementation
This is a component which adds support for the Rainbird WiFi LNK Irragation system.
2017-08-24 18:30:36 +02:00
lekobob
698d133455 Simplisafe unknown status fix (#9111)
* Simplisafe unknown status fix

Changed simplisafe-python requirement to 1.0.5 and changed state return
case statements to lower case

* Bump requirements_all.txt
2017-08-24 08:09:50 +02:00
Jeroen ter Heerdt
0dccef4063 pythonegardia package requirement to .18 (#9104)
* Bumping pythonegardia package requirement up to .18

* Updating requirements_all to reflect updated pythonegardia package .18
2017-08-23 17:11:13 +02:00
Daniel Høyer Iversen
feb85b90b4 upgrade Xiaomi Gateway lib to 0.3 (#9101) 2017-08-23 12:37:17 +02:00
Robin
48909539be Fix issue 8894 with uk_transport component if no next_buses or next_trains (#9046)
* Fix bug if no next_buses or trains

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

* Requested fixes
2017-08-23 00:05:06 -07:00
Fabian Affolter
2355216f61 Catch exceptions (#9085)
* Catch exceptions

* Fix pylint disable

* Move check for emtpy target list
2017-08-22 22:21:09 -07:00
Teemu R
55a44b0a1c Yeelight fix updates on hsv mode (#9093)
* cast strings to integers for hsv_to_rgb conversion, fixes #6473

* remove type_checking, flake8 does not like that.

* use hsv_to_rgb to convert to correct rgb value
2017-08-22 22:19:33 -07:00
happyleavesaoc
27b0d648a6 bump fedex version (#9099) 2017-08-22 22:14:06 -07:00
happyleavesaoc
90724847a3 bump snapcast version (#9100) 2017-08-22 22:13:52 -07:00
Teemu R
90fb33f610 Support changing the bulb color for tplink smartbulbs, fixes #8766 (#8780)
* Support changing the bulb color for tplink smartbulbs, related to #8766

* existence of ATTR_RGB_COLOR in kwargs, not just its existence...

* return modified supported features

* rgb-hsv conversion utils from hass return bogus values (at least for this device), so doing conversions directly with colorsys

* add typing & documentation for color model conversions

* make linters happy

* cast hsv to integer before passing it to the backend library

* make sure the bulb is on before adjusting the other settings

* allow floats as inputs for conversions, return always integers

* use typing hint in the parameter list instead of at assignment

* do not assign local color state inside turn_on, but let update handle doing it

* use forward declaration for typing, fixes travis requirements build hopefully

* rename hsv and rgb

* remove type-checking check, forward declarations should work just fine without it

* disable (broken) pylint warnings, these can be removed after astroid is updated from 1.4.9 to 1.5
2017-08-22 22:11:44 -07:00
aetolus
cb59b3fee1 Add worldtidesinfo sensor component (#8860)
* Style fixes for worldtidesinfo sensor component

* Fix D202 for worldtidesinfo sensor component

* Multiple fixes

* Multiple fixes

* Fixes

* more

* working with changes

* changes

* changes

* fix style errors

* fix style errors

* Complete rewrite

* worldtidesinfo

Fix D202 for worldtidesinfo sensor component

Multiple fixes

Multiple fixes

Fixes

more

working with changes

changes

changes

fix style errors

fix style errors

Complete rewrite

PR Changes

* Fix

* fix scan interval & lint
2017-08-23 00:40:16 +02:00
Michaël Arnauts
90689c38f7 Fix netdata system_load and add disk_free. (#9091) 2017-08-22 17:52:29 +02:00
Jan Losinski
fd6fd765b2 Pilight switch: restore last state after restart (#8580)
* Pilight switch: restore last state after restart

This uses the restore_state helper to set the last known state to
pilight switches when the devices are initialized after a HA
restart.

Without this HA forget the state on every restart and needs to be told
the sttae by retoggling the switches. This can cause unwanted effects
as a switch toggling may emit an RF signal.

* Make hound happy

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Remove entity_id generation as requested in review.

* Make hound happy again.

* fix comments

* fix lint
2017-08-22 16:40:14 +02:00
William Scanlon
06a20d0d15 Fix octoprint errors when printer is off/disconnected (#8988)
* Fix octoprint errors when printer is off/disconnected
2017-08-22 09:37:06 -04:00
Fabian Affolter
252aea37d2 Don't redefine consts (#9086) 2017-08-22 13:12:01 +02:00
Alex
5a3a43cd5b 9043 Fixed error while running dev docker (#9044) 2017-08-22 13:48:50 +03:00
Fabian Affolter
dd0ca0adc4 Upgrade credstash to 1.13.3 (#9088) 2017-08-22 13:32:46 +03:00
Fabian Affolter
c77d2ea341 Remove dash (#9089) 2017-08-22 13:31:53 +03:00
Fabian Affolter
4a3be6d514 Upgrade youtube_dl to 2017.8.18 (#9079) 2017-08-22 10:26:31 +03:00
Max
da2cb8e97e Fix device attribute in fritz_callmonitor.py (fixes #9055) (#9081) 2017-08-22 10:24:36 +03:00
Fabian Affolter
42fcaf9a75 Upgrade discord.py to 0.16.10 (#9082) 2017-08-22 10:24:02 +03:00
Fabian Affolter
af8aec001c Upgrade uber_rides to 0.5.1 (#9080) 2017-08-22 10:23:11 +03:00
Tom Harris
f6c5e5ff00 Added insteonplm device_override multiple capabilities (#9078) 2017-08-22 10:22:37 +03:00
Erik Eriksson
398735c9be async_query returns False if connection to server failed, handle this properly (#9070) 2017-08-22 07:09:11 +02:00
Alok Saboo
8ceeee032c Bump abodepy to 0.7.1 (#9077)
* Version bump to 0.7.1

* Update abodepy version
2017-08-22 07:08:27 +02:00
Nolan Gilley
54f01f3f11 bump python-ecobee-api version to 0.0.8 (#9074) 2017-08-21 23:16:17 +02:00
Alok Saboo
bc549e9525 Use builtin constants for Abode alarm_control_panel (#9059)
* Use builtin constants for alarm_control_panel

* Made it consistent with other alarm panels

* Replaced STATE_UNKNOWN with None
2017-08-21 22:20:38 +02:00
Erik Eriksson
4bb78097a7 eliqonline: channel id is an integer (#9072) 2017-08-21 21:57:12 +02:00
Ståle Semb Hauknes
7c380588a0 Workday sensor offset (#8824)
* Add support for offset for the workday sensor

* Update tests for workday sensor

* Changed from 'offset' to 'days_offset'

* Attributes bugfix (dictionary key variable repeated with different values)
2017-08-21 13:24:30 +02:00
Fabian Affolter
f7daefd7a5 Upgrade onkyo-eiscp to 1.2.4 (fixes #8995) (#9068) 2017-08-21 11:25:34 +02:00
Martin Berg
97e6a69adb Add support for Prowl notifications. (#9028)
* Add support for Prowl notifications.

* Use HA session handler.

* Simplify http request logic.

* flake

* fix double fetch data

* Remove periods from log messages
2017-08-21 10:46:07 +02:00
Fabian Affolter
fe7384a4ef Upgrade slacker to 0.9.60 (#9065)
* Upgrade slacker to 0.9.60

* Group imports
2017-08-21 10:23:29 +02:00
Fabian Affolter
3c9e09ce16 Upgrade sendgrid to 5.0.0 (#9062) 2017-08-21 07:15:37 +02:00
Matt Schmitt
c3d548a0dd Update fitbit.py (#9064)
Minor format update, set ‘type’ attribute to lowercase (Fitbit returns
all uppercase currently)
2017-08-21 07:15:15 +02:00
Alok Saboo
ebd64cded9 Bump dlib face_recognition to 0.2.2 (#9060) 2017-08-20 22:30:35 +02:00
Anders Melchiorsen
fee89d8d16 LIFX: avoid rare NoneType errors (#9054)
* Get full multizone state during registration

We used to rely on the periodic update to get the state of each zone, only
establishing the number of zones during registration. This resulted in errors
if the current state was needed for a partial color change before the first
async_update happened.

Now we do a full update before adding the light. Thus async_update can no
longer assume device.color_zones to be defined and must instead use the
response message to decide the total number of zones.

* Insist on getting the initial state

If a response to the initial state query is lost we used to just carry on.
This resulted in type errors when we next tried to access the undefined state.

After this commit the light is not added before we have the full state.

This scenario mostly happens when something is misbehaving and the type errors
were actually useful in figuring out what happend. So an error message is
logged in their place.

* Remove lint
2017-08-20 20:29:54 +02:00
Alok Saboo
b3d16e8f89 Add Abode home security component (#9030)
* Add Abode home security component

* Remove protected member

* Remove debug messages

* Remove unwanted debug messages

* Updated based on script/gen_requirements_all

* Commit to restart the build process

* Remove unwanted return

* Removed unused listener

* Address Pascal's comments

* Updated alarm control panel based on Pascal's comments

* Removed debug messages

* Removed unused hass object
2017-08-20 16:55:48 +02:00
Matt Schmitt
c059dfdb67 Update Fitbit sensor (icons, formatting, client update) (#9031)
* Update fitbit.py

Add variable icon for battery status, clean up formatting for resource
names and values

* Update fitbit.py and requirements_all.txt

Fix PR comments and update client

* Update fitbit.py

Add dict map for battery levels and use icon util
2017-08-19 22:47:31 +02:00
boojew
d153ee0b9f Add speeds to fan dropdown in ISY fan component (#9004)
* Add speeds to fan dropdown in ISY fan component

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py

* Update isy994.py
2017-08-19 21:17:47 +02:00
David
0f9ae8827c Upgrade python-pushover to 0.3 (#9045)
* Upgrade python-pushover

* Upgrade python-pushover
2017-08-19 17:00:07 +02:00
Steve
5d52993231 Support Windows in UPNP discovery (#8936)
* Support WIndows and Linix

* Correct indentation

* reduce line length

* Lint
2017-08-19 15:26:27 +02:00
Matt Schmitt
84025e46ff Update ios.py (#9041)
Use battery icon util for charging condition also
2017-08-19 15:24:13 +02:00
Sören Oldag
bf66019c66 Configurable timeout for webostv. (#9042)
* Configurable timeout for webostv.

* Make PEP257 validation to pass
2017-08-19 15:14:02 +02:00
Sören Oldag
a748b5ee5e Update pwmled to 1.2.1. (#9040) 2017-08-19 13:23:46 +02:00
Robin
98370560e1 Adds London_air component (#9020)
* Adds London_air component

* Fix lints

* Reduce fixture

* Fix config validate

* Fix naming

* fix tests
2017-08-19 11:05:16 +02:00
Matt Schmitt
597f53ae30 Update iOS sensor (battery icon fix and format updates) (#9032)
* Update ios.py

Clean up battery and charging icons (MDI was missing some versions),
fix minor bug when battery level = 95%

* Update ios.py

Migrated function to battery icon util
2017-08-19 10:59:54 +02:00
Steven Looman
7ac1e469b7 Set password after connecting. Fixes #8983 (#9039) 2017-08-19 10:58:42 +02:00
John Mihalic
ecc249aa27 Refactor USPS into component with Sensors+Camera (#8679)
* Inital USPS Camera expansion

* Cleanup debugging, add camera change interval

* Change to local nomail image

* Explicitly pass in date

* Move camera date info to model property

* Fix copy typo

* Fix hound line-length

* Fix lint whitespace

* Fix requirements

* Bump myusps version, clarify interval, alter update scheme

* Add units

* Code cleanup, address comments

* Use built-in scan interval, remove nomail image

* Remove logging line
2017-08-18 23:47:36 +02:00
celeroll
6215e27de4 Fix Geizhals index issue when not 4 prices available (#9035)
* Out of index issue, when not 4 prices are available

* Removed the parenthesis, to fix the lint error.
2017-08-18 19:59:20 +02:00
Paulus Schoutsen
b282167f26 Add state_with_unit property to state objects in templates (#9014)
* Wrap state objects in templates

* Fix tests

* Fix bugs

* Lint

* Remove invalid state warning
2017-08-17 23:19:35 -07:00
Pascal Vizeli
c278209c7b Update ffmpeg to 1.7 to fix severals problems (#9029)
* Update ffmpeg to 1.7 to fix severals problems

* Update ffmpeg.py

* Update requirements_test_all.txt
2017-08-18 00:51:52 +02:00
Tom Matheussen
427d7ee1fc Check if album image(s) exist in spotify (#9024)
* Check if album image(s) exist in spotify

* Actually set the image to None

* Simplified using ternary operator
2017-08-17 22:39:20 +02:00
Dan
55234a7fa3 Update onkyo-eiscp to 1.2.3 (#9019) 2017-08-16 21:51:03 -07:00
BioSehnsucht
3765f882c7 Add HipChat notify service. (#8918)
* Add HipChat notify service.

* Change HipChat notify service to use python-simple-hipchat-v2.

* Change HipChat notify service to use hipnotify

* Change HipChat notify service to remove redundant validation
2017-08-16 19:26:30 -04:00
Michael Hertig
b75ce4f1b2 Fix #9010 - Swiss Public Transportation shows departure time in the past (#9011) 2017-08-16 21:28:51 +02:00
Dan Cinnamon
95663f8126 Update to pyenvisalink 2.2, and remove range validation on zonedump i… (#8981)
* Update to pyenvisalink 2.2, and remove range validation on zonedump interval.

* Keep using default timer dump variable, only remove minimum check.

* Fix lint issue

* Indentation issue
2017-08-16 12:08:15 +02:00
karlkar
f114263845 Pushbullet, fix multiple messages sent when url param is set (#9006) 2017-08-16 09:29:42 +02:00
mjj4791
e7ce110dc6 Buienradar newconditions (#8897)
* new monitored conditions and support for new weathercard

* new monitored conditions and support for new weathercard

* minor changes
2017-08-15 23:07:04 -07:00
timstanley1985
3342db33e4 MQTT Switch - Add configurable availability payload (#8934)
* Add configurable availabilty payload

* Fix

* Fix

* Lint fixes

* Fix tests

* Fix tests

* Move from const.py to mqtt switch

* New test

* Fix flake*
2017-08-15 23:04:57 -07:00
Paulus Schoutsen
0fb281c5b3 Update frontend 2017-08-15 22:34:46 -07:00
Paulus Schoutsen
2dab239021 Add scripts editor backend (#8993)
* Add scripts editor backend

* Fix docstrings
2017-08-15 22:09:10 -07:00
Adam Mills
95c57412ff Automatic device tracker remove password (#9002)
* Remove now disabled password auth from automatic

* Fallback to configurator more permissively

* Fix test for changes

* Bump lib
2017-08-15 21:04:44 -04:00
Aaron Bach
eb42d59210 Adds port/SSL config options for RainMachine (#8986)
* Adding port/SSL config updates

* New requirements generated

* Made `port` and `ssl` parameters optional

* Add defaults for new parameters

* Re-adding guard clause

* pass > continue
2017-08-15 20:03:40 +02:00
Tim Lyakhovetskiy
6507cc1dc8 Fix #8960 - Decora Wi-Fi Switch unable to set brightness (#8989) 2017-08-15 16:12:16 +02:00
Daniel Høyer Iversen
1892eb654f Is_allowed_path raise for None path (#8953)
* is_allowed_path

* Fix #8948

* assert path is not None

* Update test_core.py

* Update test_core.py

* Update test_core.py
2017-08-15 15:41:37 +02:00
Jack
5309006494 Added continue-on-errors, added value template (#8971)
* Added continue-on-errors, added value template

* Refactored long lines

* Fixed whitespace issues
2017-08-14 16:31:06 +02:00
Philipp Schmitt
e2920ce5e5 Nello.io lock support (#8957)
* Initial Nello.io lock support

* Log an error when unlocking failed

* Make the lock's state always locked
2017-08-14 10:02:37 +02:00
Adam Mills
19d1d748d4 Add support for Automatic OAuth2 authentication (#8962)
* Add support for Automatic OAuth2 authentication

* Fix async conversion of configurator

* Rename method for async

* Use hass.components to get configurator component

* Fix typo

* Move session data to hidden directory

* Make configurator callback optional
2017-08-13 22:37:50 -07:00
Paulus Schoutsen
8d661f8dea Merge pull request #8980 from home-assistant/release-0-51-2
0.51.2
2017-08-13 22:18:05 -07:00
Paulus Schoutsen
9363b189ba Sabnzbd: do not assume discovery info is a dict (#8951) 2017-08-13 21:54:21 -07:00
Eugenio Panadero
4da876e5c2 fix DeviceException handling when updating xiaomi vacuum (#8954)
* Fix DeviceException handling when updating entity

* add DeviceException error handling to generic request
2017-08-13 21:54:21 -07:00
Martin Hjelmare
335008ae5c Fix call to ha_send_commands (#8956)
* Name keyword arguments correctly according to dependency lib.
* Only pass keyword arguments that are not None.
2017-08-13 21:54:20 -07:00
Paulus Schoutsen
a4da31b573 fix issue #8948 in pushbullet (#8965)
* fix issue #8948 in pushbullet

* pushbullet
2017-08-13 21:54:20 -07:00
Andrey
cd795489ca Turn foscam verbose mode off (#8967) 2017-08-13 21:54:20 -07:00
Andrey
a8a037db49 Fix zwave power_consumption attribute (#8968) 2017-08-13 21:54:19 -07:00
Paulus Schoutsen
fc8e8e5d8c Update frontend 2017-08-13 21:53:26 -07:00
Paulus Schoutsen
56597d290c Version bump to 0.51.2 2017-08-13 21:53:22 -07:00
Paulus Schoutsen
8fcec03adf Update frontend 2017-08-13 21:52:36 -07:00
Andrey
a0ddb24245 Turn foscam verbose mode off (#8967) 2017-08-13 18:16:38 -07:00
Andrey
23273d3e88 Fix zwave power_consumption attribute (#8968) 2017-08-13 18:15:59 -07:00
Paulus Schoutsen
74adebc2fd fix issue #8948 in pushbullet (#8965)
* fix issue #8948 in pushbullet

* pushbullet
2017-08-13 13:28:36 -07:00
Paulus Schoutsen
4b3a932d88 Sabnzbd: do not assume discovery info is a dict (#8951) 2017-08-13 11:29:48 -07:00
Martin Hjelmare
cbe5225e04 Fix call to ha_send_commands (#8956)
* Name keyword arguments correctly according to dependency lib.
* Only pass keyword arguments that are not None.
2017-08-13 11:28:33 -07:00
Matt Schmitt
811fdc5533 Add service to alarm control panel for night mode arming (#8614)
* Update const.py

* Update __init__.py

* Update services.yaml

* Update totalconnect.py

* Update manual.py

Add night arm service for manual alarm control panel

* Update test_manual.py

Add tests for night mode arming

* Update manual.py

Fix docstring
2017-08-13 19:57:48 +02:00
Eugenio Panadero
c92e5c147a fix DeviceException handling when updating xiaomi vacuum (#8954)
* Fix DeviceException handling when updating entity

* add DeviceException error handling to generic request
2017-08-13 15:02:48 +02:00
Sebastian Muszynski
73d6227021 Remove spaces from Xiami switch attributes (#8952)
* Attributes of the xiaomi zigbee plug changed.

* Reformat.
2017-08-13 09:54:43 +02:00
Alok Saboo
79f45b5176 Fixed cert_expiry sensor to delay firing on HA startup (#8920)
* Fixed cert_expiry sensor to delay firing on HA startup

* Addressed Travis complaints

* Added imports

* Fixed cert_expiry sensor to delay firing on HA startup

* Changed comment
2017-08-12 23:49:15 -07:00
Paulus Schoutsen
b18679ec0b Merge pull request #8942 from home-assistant/release-0-51-1
0.51.1
2017-08-12 14:59:38 -07:00
Paulus Schoutsen
7d566c2c3d Version bump to 0.51.1 2017-08-12 14:56:34 -07:00
Paulus Schoutsen
46d9d77d03 Update frontend 2017-08-12 14:56:24 -07:00
Paulus Schoutsen
4a98b32a03 Update frontend 2017-08-12 14:54:50 -07:00
Paulus Schoutsen
adbcbe3a67 Merge pull request #8919 from home-assistant/release-0-51
0.51
2017-08-12 11:31:30 -07:00
Martin Hjelmare
eef3dda1e9 Fix SET_TEMPERATURE_SCHEMA in climate component (#8879)
* Require either temperature or high/low target temperatures.
* Add tests.
2017-08-12 10:57:10 -07:00
William Scanlon
08899ade00 Update python-wink version to fix Dome water valve bug. (#8923) 2017-08-12 10:57:10 -07:00
Philipp Schmitt
5814fdadd0 Update roombapy to 1.3.1 to avoid installing all the mapping dependencies (#8925) 2017-08-12 10:57:09 -07:00
cribbstechnologies
daf7d9ea7f fixing emulated hue issue and testing it (#8928)
* fixing emulated hue issue and testing it

* fixing hound issues

* I should probably stop using vim

* Check against dict directly instead of items.
2017-08-12 10:57:09 -07:00
Martin Hjelmare
956543ae1e Remove not needed call to update (#8930)
* This will ensure no I/O in entity properties.
2017-08-12 10:57:09 -07:00
Martin Hjelmare
fbb6782081 Fix SET_TEMPERATURE_SCHEMA in climate component (#8879)
* Require either temperature or high/low target temperatures.
* Add tests.
2017-08-12 09:39:05 -07:00
cribbstechnologies
369caeedbd fixing emulated hue issue and testing it (#8928)
* fixing emulated hue issue and testing it

* fixing hound issues

* I should probably stop using vim

* Check against dict directly instead of items.
2017-08-12 08:50:02 -07:00
groth-its
489a02b2c2 Fix hue lights for Philips and non-philips lights (#8905) 2017-08-12 08:38:12 -07:00
Fabian Affolter
c4550d02c5 Add version sensor (#8912)
* Add version sensor

* Set version directly

* Rework tests and fix typo

* Remove additional blank line
2017-08-12 08:52:56 +02:00
Martin Hjelmare
49733b7fdf Remove not needed call to update (#8930)
* This will ensure no I/O in entity properties.
2017-08-11 19:55:57 -07:00
Philipp Schmitt
0999e2ddc4 Update roombapy to 1.3.1 to avoid installing all the mapping dependencies (#8925) 2017-08-11 11:22:22 +02:00
William Scanlon
d427063acd Update python-wink version to fix Dome water valve bug. (#8923) 2017-08-11 08:35:45 +02:00
Fabian Affolter
ff3a4637a4 Version bump to 0.52.0.dev0 2017-08-10 23:28:04 +02:00
Fabian Affolter
8523aaca64 Prepare for release 2017-08-10 23:26:19 +02:00
Fabian Affolter
e3236d1a3b Honor PEP8 naming convention (#8909)
* Honor PEP8 naming convention

* Update validator
2017-08-10 19:31:28 +02:00
Marcus Schmidt
d7e8616651 Added possibilities to use template in the command_line sensor (#8505)
* Added possibilities to use template in the command_line sensor

* Minor style guideline conforms

* Minor style guideline conforms

* Added new test for template rendering

* Minor style guideline conforms

* Minor style guideline conforms

* Fixed failing testcases

* Fix style violations

* fix code pretty
2017-08-10 18:52:52 +02:00
Fabian Affolter
c0663bf722 Add Shodan sensor (#8902) 2017-08-10 17:27:49 +02:00
Abílio Costa
d195fd47f7 Add new device tracker for Huawei Routers. (#8488)
* Add new device tracker for Huawei Routers.

	This was tested with the HG8247H model, used by Vodafone
	Portugal for the Fiber service.

* add to .coveragerc; remove import and space

* add comments and fix lint

* rename methods

* huawei_router: add constants to scanner class

* huawei_router: remove lock; use format() in string

* huawei_router: use tupple instead of member only class

* huawei_router: reduce min scan time

* huawei_router: lint

* huawei_router: lint

* huawei_router: add missing lines in imports

* huawei_router: correctly decode string after router firmware update

* Remove things that is done on core now
2017-08-10 17:01:52 +02:00
Erik Eriksson
e84ff61d4a Support media position and media duration (will display progressbar in ui) (#8904) 2017-08-10 16:56:34 +02:00
Anders Melchiorsen
317bc10ccb LIFX: improve performance of multi-light transitions (#8873)
* LIFX: improve performance of multi-light transitions

To avoid hub overload, the light.turn_on call will change each light
sequentially.

As LIFX has no hub we can safely increase performance by starting all
light transitions concurrently.

* Improve state updates after light changes

The light.turn_on call will set a new state and then immediately read it
back. However, reading the state of a LIFX light right after a state
change can still return the old value.

To handle this situation we have previously delayed the update request a
little while to allow a potential state change to settle. Because light
updates are now run in parallel, this delay might be too short when many
lights are set at once.

This commit introduces a per-light Lock to make it explicit when the
state cannot yet be trusted.

We must then do the state update ourselves. This was already done at the
end of a long transition and that code can be reused for also doing the
update at the start of a transition.
2017-08-10 10:29:04 +02:00
William Scanlon
1cb42087f9 Update simplisafe-python version (#8908) 2017-08-10 07:58:39 +02:00
karlkar
b035577cf5 Fix for Neato D3 Connected state obtaining (#8817) 2017-08-09 23:22:08 +02:00
Paulus Schoutsen
55c84eaee3 Update frontend 2017-08-09 00:47:29 -07:00
kfcook
eb6017e16c added support for setting/getting position of lutron caseta covers (#8898) 2017-08-09 06:57:32 +02:00
PhracturedBlue
19ee3c42b6 Add longer text strings to mailbox demo to test string truncation (#8893)
* Add longer text strings to mailbox demo to test string truncation in frontend

* Remove lorem ipsum txt file

* Use format instead of %
2017-08-08 23:37:16 +02:00
Aaron Bach
af70054692 Changed Pi-hole graphs from stacked bar to line (#8896) 2017-08-08 22:57:35 +02:00
Fabian Affolter
be94f6e939 Do not call update() in constructor (#8892) 2017-08-08 22:36:59 +02:00
Fabian Affolter
f513f6271e Do not call update() in constructor (#8878)
* Do not call update() in constructor

* Fix lint issues
2017-08-08 20:21:33 +02:00
Alexey
588b36dff2 Fix media_extractor for some sites (#8887) 2017-08-08 15:21:32 +02:00
Fabian Affolter
cc5893ed8b Upgrade youtube_dl to 2017.8.6 (#8880) 2017-08-08 11:53:19 +02:00
Fabian Affolter
124a6cc8c0 Change level (#8883) 2017-08-08 11:53:04 +02:00
Fabian Affolter
0fe4245620 Allow usage of colorlog 3.0.1 (#8885) 2017-08-08 10:16:04 +02:00
Aaron Bach
289c88ff71 Add RainMachine switch platform (#8827)
* Add RainMachine switch platform

* Updated requirements_all.txt

* Cleaning up CI and coverage results

* Small update to deal with older pylint

* Fixed small indentation-based error

* Added some more defensive try/except logic around calls

* I'm not a fan of importing a library multiple times :)

* Making PR-requested changes

* Fixed ref to positional parameter

* Attempting to fix broken linting

* Ignoring no-value-for-parameter pylint error
2017-08-08 09:49:25 +02:00
Fabian Affolter
57f3bed465 Do not call update() in constructor (#8881) 2017-08-08 06:52:27 +02:00
Oleksii Serdiuk
62e86270e6 RFLink: Add send_command service (#8876)
Add an optional extended description…
2017-08-07 17:37:30 +02:00
Philipp Schmitt
3aceca9d8a Add nuki lock'n'go and unlatch services and add attributes (#8687)
* Add lock'n'go service

* Add unlatch service

* Implement changes requested by @MartinHjelmare

* Fix service domain
2017-08-07 14:58:31 +02:00
Philipp Schmitt
e81b3f7bc0 Implement Roomba fan speed (#8863)
* Implement Roomba fanspeed

* Fix: fan_speed_list is always empty

* Log instead of raising an exception when incorrect fan speed has been provided

* Don't attempt to set any preference if fan speed is invalid
2017-08-06 23:43:33 +02:00
Andy Castille
cc6c2bf25e Fix spelling error and update link (#8869) 2017-08-06 21:18:44 +02:00
Paulus Schoutsen
9575cbde09 Consolidate config panels (#8857)
* Remove automation panel registration

* Move Z-Wave config API to config.zwave

* Remove no longer needed test

* Lint

* Update frontend
2017-08-06 12:05:34 -07:00
Paulus Schoutsen
4e79517971 Update mailbox panel icon 2017-08-06 11:51:58 -07:00
Tim Lyakhovetskiy
4ec4cfc44e Add Leviton Decora Smart WiFi Device Platform (#8529)
* Add Leviton Decora Smart WiFi Device Platform

* Decora WiFi Code Review Fixes
2017-08-06 11:30:28 -07:00
PhracturedBlue
d74f4eaf52 Add Initial Mailbox panel and sensor (#8233)
* Initial implementation of Asterisk Mailbox

* Rework asterisk_mbox handler to avoid using the hass.data hash.  Fix requirements.

* Handle potential asterisk server disconnect.  bump asterisk_mbox requirement to 0.4.0

* Use async method for mp3 fetch from server

* Add http as dependency

* Minor log fix. try to force Travis to rebuild

* Updates based on review

* Fix error handling as per review

* Fix error handling as per review

* Refactor voicemail into mailbox component

* Hide mailbox component from front page

* Add demo for mailbox

* Add tests for mailbox

* Remove asterisk_mbox sensor and replace with a generic mailbox sensor

* Fix linting errors

* Remove mailbox sensor.  Remove demo.mp3.  Split entity from platform object.

* Update mailbox test

* Update mailbox test

* Use events to indicate state change rather than entity last-updated

* Make mailbox platform calls async.  Fix other review concerns

* Rewrite mailbox tests to live at root level and be async.  Fixmailbox dependency on http

* Only store number of messages not content in mailbox entity
2017-08-06 11:19:47 -07:00
Paulus Schoutsen
5696e38dd6 Warn instead of raise on duplicate YAML key (#8834)
* Warn instead of raise on duplicate key

* Update test_yaml.py

* Lint

* Change to error
2017-08-06 10:47:19 -07:00
Eugenio Panadero
c6aaacbb08 Add new service clean_spot to vacuums (#8862)
* Add new service `clean_spot` to vacuums

    - Add as base component service, with associated support flag to make it optional
    - Implement on Demo vacuum
    - Implement on Xiaomi vacuum
    - Update tests for platforms Demo and Xiaomi
    - Change default icon for vacuums to `mdi:roomba`, but keep the one for the Xiaomi
    - (In a polymer PR: add new service to command toolbar in the 'more-info' card)

* Add `clean_spot` service description

* fix default properties for vacuum component
2017-08-06 10:23:22 -07:00
Fabian Affolter
d8ca04a4bc Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
Paulus Schoutsen
ac9c1235bb Allow get local ip to work without internet (#8855) 2017-08-06 09:15:17 -07:00
Andrey Kupreychik
c49cce7243 Do not use pychromecast.Chromecast for Cast Groups (#8786)
* Do not use pychromecast.Chromecast for Cast Groups

pychromecast.Chromecast creates Chromecast instance with friendly_name and cast_type of the device and not of a group.
Which leads to collisions

* Update cast.py

* using hass.data

* Fixed and extended tests

* Line length in tests

* Lint in tests
2017-08-06 09:15:01 -07:00
John Arild Berentsen
99a20c845c Fix off_delay for zwave trigger sensors (#8864) 2017-08-06 18:31:32 +03:00
Kevin Fronczak
3723f67dc1 Added rounding to Google Wifi (#8866) 2017-08-06 18:29:52 +03:00
Fabian Affolter
b655fe6e04 Allow to set coordinates (#8858) 2017-08-06 15:20:51 +02:00
Fabian Affolter
24e9fa238a Upgrade pyasn1 to 0.3.2 and pyasn1-modules to 0.0.11 (#8856) 2017-08-06 15:20:13 +02:00
Charles Blonde
83afd12807 Add support to Dyson 360 Eye robot vacuum using new vacuum platform (#8852)
* Add support to Dyson 360 Eye robot vacuum using new vacuum platform

* Fix tests with Python 3.5

* Code review

* Code review - v2

* Code review - v3
2017-08-06 13:08:46 +02:00
Philipp Schmitt
82a7dffc03 Wi-Fi enabled Roomba support (#8825)
* Roomba vacuum component

* Update requirements and coveragerc

* Update error handling message

* Implement changes requested by @azogue

* Add missing import

* Don't wrap commands with functools.partial

* Refactoring

* Remove state attribute and use double quotes for log messages strings

* Remove unused constants

* Sorting

* Sorting + remove None arg from dict.get() calls

* Re-sort imports
2017-08-06 11:08:45 +02:00
Fabian Affolter
c11b6798dc Upgrade pylast to 1.9.0 (#8854) 2017-08-06 10:08:45 +02:00
Fabian Affolter
8e4c799ad1 Upgrade sqlalchemy to 1.1.13 (#8850) 2017-08-06 10:08:24 +02:00
Fabian Affolter
5059d4c54b Catch ConnectionRefusedError (#8844)
* Do not call update() in constructor

* Catch ConnectionRefusedError
2017-08-06 10:08:00 +02:00
Fabian Affolter
569d9764ab Do not call update() in constructor (#8847) 2017-08-06 10:07:45 +02:00
Fabian Affolter
058deb5be3 Make 'monitored_conditions' optional (#8848)
* Do not call update() in constructor

* Update tests
2017-08-06 10:07:22 +02:00
Fabian Affolter
cd36a71f64 Do not call update() in constructor (#8849)
* Do not call update() in constructor

* Fix pylint issues
2017-08-06 10:07:05 +02:00
Fabian Affolter
6832a2e642 Make 'monitored_conditions' optional (#8843)
* Do not call update() in constructor

* Make 'monitored_conditions' optional

* Update tests
2017-08-06 10:05:37 +02:00
Fabian Affolter
2c7b2fe19e Do not call update() in constructor (#8840) 2017-08-06 10:03:57 +02:00
Fabian Affolter
45ec7f6180 Upgrade sendgrid to 4.2.1 (#8839) 2017-08-06 10:03:32 +02:00
Fabian Affolter
cb8517834a Do not call update() in constructor. (#8837) 2017-08-06 10:03:09 +02:00
Jeroen ter Heerdt
f41ef5d727 Egardia (#8389)
* Added support for Egardia / Woonveilig alarm control panel

* Added support for Egardia / Woonveilig alarm control panel

* Added support for Egardia / Woonveilig alarms

* Updating egardia support with exception handling and other fixes

* Egardia platform, requirements file updated

* Fixing state checking

* Adding exception handling

* Removing unnecessary logging

* Removing unnecessary logging

* Updating to egardiadevice component 1.0.10

* Improving exception handling

* Adding implementation of egardiaserver for alarm triggered status

* Clean-up

* Fix my previous change
2017-08-05 22:04:00 +02:00
Eugenio Panadero
a221b10694 Update xiaomi vacuum tests and include in coverage (#8845)
* Fix tests for Demo vacuum platform (and increase coverage)

* increase coverage of xiaomi vacuum tests and include in coverage

Also little fixes

* remove print statement
2017-08-05 21:45:59 +02:00
Greg Laabs
6e1785173f History query and schema optimizations for huge performance boost (#8748)
* Add DEBUG-level log for db row to native object conversion

This is now the bottleneck (by a large margin) for big history queries, so I'm leaving this log feature in to help diagnose users with a slow history page

* Rewrite of the "first synthetic datapoint" query for multiple entities

The old method was written in a manner that prevented an index from being used in the inner-most GROUP BY statement, causing massive performance issues especially when querying for a large time period.

The new query does have one material change that will cause it to return different results than before: instead of using max(state_id) to get the latest entry, we now get the max(last_updated). This is more appropriate (primary key should not be assumed to be in order of event firing) and allows an index to be used on the inner-most query. I added another JOIN layer to account for cases where there are two entries on the exact same `last_created` for a given entity. In this case we do use `state_id` as a tiebreaker.

For performance reasons the domain filters were also moved to the outermost query, as it's way more efficient to do it there than on the innermost query as before (due to indexing with GROUP BY problems)

The result is a query that only needs to do a filesort on the final result set, which will only be as many rows as there are entities.

* Remove the ORDER BY entity_id when fetching states, and add logging

Having this ORDER BY in the query prevents it from using an index due to the range filter, so it has been removed.

We already do a `groupby` in the `states_to_json` method which accomplishes exactly what the ORDER BY in the query was trying to do anyway, so this change causes no functional difference.

Also added DEBUG-level logging to allow diagnosing a user's slow history page.

* Add DEBUG-level logging for the synthetic-first-datapoint query

For diagnosing a user's slow history page

* Missed a couple instances of `created` that should be `last_updated`

* Remove `entity_id` sorting from state_changes; match significant_update

This is the same change as 09b3498f41 , but applied to the `state_changes_during_period` method which I missed before. This should give the same performance boost to the history sensor component!

* Bugfix in History query used for History Sensor

The date filter was using a different column for the upper and lower bounds. It would work, but it would be slow!

* Update Recorder purge script to use more appropriate columns

Two reasons: 1. the `created` column's meaning is fairly arbitrary and does not represent when an event or state change actually ocurred. It seems more correct to purge based on the event date than the time the database row was written.
2. The new columns are indexed, which will speed up this purge script by orders of magnitude

* Updating db model to match new query optimizations

A few things here: 1. New schema version with a new index and several removed indexes
2. A new method in the migration script to drop old indexes
3. Added an INFO-level log message when a new index will be added, as this can take quite some time on a Raspberry Pi
2017-08-04 23:16:53 -07:00
Fabian Affolter
52cff83267 Upgrade aiohttp to 2.2.5 (#8828) 2017-08-04 23:14:05 -07:00
Paulus Schoutsen
e49b970665 Block dependencies that depend on enum34 (#8698)
* Block dependencies that depend on enum34

* Remove uninstalling enum34

* Update validation script

* Add constraints to tox.ini

* Upgrade yeelight to version that uses enum-compat

* Disable sensor.skybeacon

* Lint
2017-08-04 23:06:10 -07:00
Paulus Schoutsen
a0530d8b9c Update frontend 2 2017-08-04 23:02:07 -07:00
Paulus Schoutsen
99d4021f47 Update frontend 2017-08-04 22:58:19 -07:00
Charles Blonde
7f0d0607f1 Fix Dyson sensors if devices are configured without standby monitoring. Fixes #8569 (#8826)
Upgrade libpurecoolink libraries without unused enum34 dependency
2017-08-04 14:27:23 -07:00
Hellowlol
cf298c2435 Make HA discover sabnzbd and add it to the Configurator (#8634)
* Init discover sab.

* Fix hound errors

Nobody likes being hound at :(

* sabnzbd discovery says if ssl is active.

* Fixups after codereview.
2017-08-04 23:24:55 +02:00
Boyi C
77cdc833f0 Update yweather.py (#8820)
Fix missing weather unit support.
Move some weather code to their correct classes.
2017-08-04 17:22:38 +02:00
Eugenio Panadero
96f8c37dcd Xiaomi vacuum as platform of new vacuum component derived from ToggleEntity, and services (#8623)
* Xiaomi vacuum as component with switch, sensors and services

- Conversion from switch platform to async component.
- Add services proposed in #8416 to the new component, with shorter names.
- Add sensors for the vacuum robot as a selectable list from `battery`, `state`, `error`, `fanspeed`, `clean_time` and `clean_area` (the state attributes of the switch). The sensors don't poll, but listen to a signal to update the state, the switch fires this signal when updating.
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)

* path change in requirements_all (from switch platform to component)

* copy pasting is a bad habit

* services to the components services.yaml, modify .coveragerc

* review: use with multiple hosts, fix calls to async_add_devices, fix ranges for services

* `icon_for_battery_level` util method

* Xiaomi vacuum as platform of new component vacuum

- Created new component `vacuum` from a ToggleEntity.
- Add services `turn_on`, `turn_off`, `cleaning_play_pause`, `stop`, `return_to_base`, `locate`, `set_fanspeed` and `send_command`.
- Remove the main switch for the xiaomi vacuum (the toggable main entity is the switch).
- Add `support flags` for the common services
- Assign default icons to sensors and the switch (`mdi:google-circles-group` looks like the robot!)
- Move services descriptions to a yaml file for the new component.
- Update requirements_all.
- Update coveragerc.

* fix coveragerc

* fix battery icon helper to use more icons

* remove sensors, create properties and support flags for custom UI

* cleaning

* updated state_attrs for filtering in UI, renamed platform to simply `xiaomi`

* fix platform rename

* change fanspeed and expose `fanspeed_list` to use speed steps

* minor fixes

- Rename service `start_pause`
- Add 'Error' attribute only if `got_error`.
- Minor changes

* rename state attrs

* rename state attrs

* review changes: cut fan__speed, style changes, remove logging, and more

* add ATTR_COMMAND = 'command' to const

* pop entity_id from service data

* remove property accessor for vacuum object

* lint fix

* fix extra attrs names

* module level functions for calling the services

* params as optional keyword for `send_command`

* params as optional keyword for `send_command`, remove debug logs

* explicit parameters for `set_fan_speed` and `send_command`

* Demo platform for the vacuum component

* vacuum tests for the Demo platform

* some fixes

* don't omit vacuum

* vacuum tests for the Xiaomi platform

* fix test

* fix

* fix xiaomi test

* fix coveragerc

* test send command

* fix coveragerc

* fix string formatting

* The coverage is to low. It need 93% or more
2017-08-04 15:27:10 +02:00
Julian Kahnert
5b4e30cde3 geizhals sensor component (#8458)
* initial create of the geizhals component

* only .coveragerc, geizhals.py, and requirements_all.txt included
2017-08-04 12:11:33 +02:00
Paulus Schoutsen
d4dfb4d80c Polymer 2 (#8815)
* Update build for Polymer 2

* Update webcomponents polyfills/helpers

* Load ES5 class adapter when not in dev mode

* Update frontend
2017-08-03 23:46:57 -07:00
Andrey
c895f1f1db When Sonos gets a tts source - dont't show an image (#8777) 2017-08-03 17:39:11 +03:00
Haim Gelfenbeyn
944af9cd7d InfluxDB component improvements (#8633)
* Allow reporting some state attributes as tags to InfluxDB

Some state attributes should really be tags in InfluxDB. E.g.
it is helpful to be able to group by friendly_name, or add a custom
attribute like "location" and group by that. Graphs in Grafana are much
easier to read when friendly names are used, and not node ids.

This commit adds an optional setting to InfluxDB config:
'tags_attributes'. Any attribute on this list will be reported as tag
and not as field to InfluxDB.

* Allow overriding InfluxDB measurement for each reported item separately

Bundling all items with the same "unit of measurement" together does not
always makes sense. For example, both "relatively humidity" and "battery
level" are reported as "%", but I'd rather see them as separate
measurements in InfluxDB. This commit allows for 'influxdb_measurement'
attribute. When set on node, it will take precedence over the global
'override_measurement' and component-specific 'unit_of_measurement'.

* Minor updates to InfluxDB component improvements, as suggested by
@MartinHjelmare.

* Moved per-component config from 'customize' into 'influxdb'
configuration section. The following three sub-sections were added:
'component_config', 'component_config_domain' and
'component_config_glob'. The sole supported per-component attribute
at this point is 'override_measurement'.

* Lint

* Fixed mocked entity_ids in InfluxDB tests to be in domain.entity_id
format, to satisfy EntityValues requirements.

* Added tests for new InfluxDB configuration parameters

* Fixes to some docstrings
2017-08-03 16:26:01 +02:00
John Mihalic
f3e16ca304 Catch divide by zero errors when a sleep type is 0 (#8809)
Add an optional extended description…
2017-08-03 15:58:40 +02:00
Fabian Affolter
6de38cb941 Upgrade aiohttp to 2.2.4 (#8805) 2017-08-03 11:37:02 +02:00
Pascal Vizeli
8e51e66c9b Update numpy 1.13.1 (#8806)
* Update opencv.py

* Update requirements_all.txt
2017-08-03 11:36:50 +02:00
Matthew Treinish
57dfe378a1 Add mochad light component (#8476)
* Add mochad light component

This commit adds a new component to control x10 dimmers/lights with
mochad.

* Create comm_type and address constants

The comm_type and address conf constants are shared between all mochad
devices because they are required information used for configuring a
device. This commit moves the definition into const.py so they're
consistent between all component types.
2017-08-03 10:51:01 +02:00
Fabian Affolter
d8cded637c Revert "Upgrade aiohttp to 2.2.4"
This reverts commit 7c92f7e1ad.
2017-08-03 10:11:32 +02:00
Fabian Affolter
7c92f7e1ad Upgrade aiohttp to 2.2.4 2017-08-03 10:08:09 +02:00
Abílio Costa
ccf0559059 mqtt switch: add voluptuous for availability topic (#8797) 2017-08-03 07:18:18 +02:00
Paulus Schoutsen
2d38e70268 Merge branch 'polymer-build' into dev 2017-08-02 21:34:20 -07:00
Paulus Schoutsen
9dae1ca5c2 Update frontend 2017-08-02 21:34:04 -07:00
Luuk
6ac8caa857 Fix referencing unset variable in tado climate component (causes update to fail when tado zone is in manual mode) (#8723)
Add an optional extended description…
2017-08-02 15:07:03 +02:00
Fabian Affolter
39131d06ba Improvements (configuration and validation) (#8785) 2017-08-02 14:51:09 +02:00
Fabian Affolter
8a626e1572 Upgrade sphinx-autodoc-typehints to 1.2.1 (#8783)
Add an optional extended description…
2017-08-02 14:15:00 +02:00
Fabian Affolter
bc376f7045 Upgrade pyasn1 to 0.3.1 and pyasn1-modules to 0.0.10 (#8787) 2017-08-02 14:14:01 +02:00
Paulus Schoutsen
cad1de790e Build frontend with polymer-build 2017-08-02 01:46:08 -07:00
Sebastian Muszynski
32b7f4d16f Fixes UnboundLocalError: local variable 'setting' referenced before assignment (#8782) 2017-08-02 09:14:28 +02:00
Steve Rhoades
1adb5040e7 Feature alexa launch request (#8730)
* Add support for LaunchRequest alexa intent

* Support LaunchRequest for multiple skills

* formatting

* adding tests to cover launch request

* formatting
2017-08-01 22:53:36 -07:00
Lukas Barth
47dad547eb Add 'forecast' ability to yr weather sensor (#8650)
* Add forecast option to YR sensor

* Fix some style issues

* Fix linting
2017-08-01 22:42:51 -07:00
thrawnarn
86c06ad76e New component: bluesound (#7192)
* New component: bluesound

* New component: bluesound

* Removed response.release()
Fixed update_sync_status bug
Changed should_poll to True

* Fix lint error

* Changes to init

* Fixed blank line

* updated requirements

* bump to xmltodict 0.11.0
2017-08-01 22:41:51 -07:00
pezinek
7dbcf63543 flux_led: support for property "available" (#8764)
* flux_led: support for property "available"

* Implemented changes from code review

* Implemented changes from code review

* Implemented changes from code review
2017-08-01 21:26:27 -07:00
Thomas Friedel
6ff340492b use updated osram lightify 1.0.6 component, including bugfix allowing more than 27 devices (#8774) 2017-08-01 20:36:31 +02:00
Fabian Affolter
50cd6c9a9c Catch exception (fixes #8724) (#8731) 2017-08-01 19:30:26 +02:00
Dan Sarginson
365f21b209 Honeywell fixes and improvements (#8756)
* Honeywell fixes and improvements

Give the Honeywell device a state ('On', 'Off', etc) that
can be displayed to user and understood by other components.
Previously this was always 'Unknown'. Update also raises a
state_changed event when a new temperature is polled.

These two together fix an issue (#8688) where Honeywell
climate data couldn't be logged in InfluxDB.

* Roll back some changes

These were not necessary to achieve the result I wanted.

* Renamed RoundThermostat's 'device' member for greater clarity

Now called 'client'

* Improve and simplify discovering thermostat mode

Per code review, this is a rather neater way to discover the thermostat mode

* Update tests for compatibility with new component

The tests previously relied upon the update() method being
called in the constructor. This is no longer the case.

* Address formatting review comment

Parens not necessary

* This system mode is not certain to apply to domestic hot water

Moved the mode lookup to only happen on update of radiator devices,
since hot water devices seem to be treated differently and I can't test.
2017-08-01 16:18:14 +02:00
Tsvi Mostovicz
075422e7ad Add support for file attachments in pushbullet (#8763)
* Add support for file attachments in pishbullet

* Check filepath is allowed
2017-08-01 14:55:46 +02:00
Steven Looman
342ec8ec99 mpd improvements (#8655)
* Don't require the MPD device to online during HASS startup

* Hide private variables

* Keep tox/flake8 happy

* Fix typo

* Force direct update

* Implement MpdDevice.available

* Fix typo
2017-07-31 23:18:26 -07:00
Matt Colyer
2b59b917c4 Allow sonos to select playlists as a source (#8258)
* Allow sonos to select playlists as a source

Most of this was taken from
https://github.com/home-assistant/home-assistant/issues/5598#issuecomment-278229895
however I made a few small improvements so that it works for other
services than Spotify and it should properly switch to playing the queue
if you had another song playing previously.

/cc @PatBoud

* Attempt to fix style issues

* More indent changes

* Fix misplaced period

* Move playlist replacement to function

* Privatize replace_queue_with_playlist and explain

* Remove unneeded decorator

* Fix doc formatting
2017-07-31 23:16:05 -07:00
viswa-swami
e40388e7ad Enable/Disable Motion detection for Foscam Cameras (#8582)
* Added support to enable/disable motion detection for foscam cameras. This support was added in 0.48.1 as a generic service for cameras. Motion detection can be enabled/disabled for foscam cameras with this code-set.

* Fixed the violation identified by hound-bot

* Fixed the comment posted by HoundCI-Bot regarding using imperative mood statement for pydocstyle

* Fixed the error that travis-ci bot found.

* As per comment from @balloob, Instead of directly using the URL to talk to foscam, used a 3rd party foscam library to communicate with it. This library already has support to enable/disable motion detection and also APIs to change the motion detection schedule etc. Need to add more support in the pyfoscam 3rd party library for checking if motion was detected or even if sound was detected. Once that is done, we can add that into HASS as well.

* Lint

* Removed the requests library import which is not used anymore

* Updating requirements_all.txt based on the code-base of home assistant that i have. Generated using the gen_requirements_all.py script

* Updating requirements_all.txt and requirements_test_all.txt generated by gen_requirements_all.py after latest pull from origin/dev

* Updated requirements_all.txt with script

* Updated the foscam camera code to fix lint errors

* Fixed houndci violation
2017-07-31 23:14:34 -07:00
William Scanlon
cb292a0b18 Wink discovery (#8739)
* Support for Wink discovery

* Switched try/except for if/else
2017-07-31 20:54:07 -07:00
Martin Hjelmare
33663f9502 Clean up remote component (#8728)
* Clean up remote component

* Don't have device be required in send_command service and method.
* Don't have entity_id be required in the base service schema.
* Don't always add activity in the data dict for a service call.
* Update harmony remote platform according to new service schema.
* Remove not needed properties and attributes from the Kira remote
  platform.
* Add send_command method to demo platform.
* Add tests and remove duplicate tests.

* Break out required argument as positional argument
2017-07-31 20:52:39 -07:00
emlt
e57d6f679a Change units from KW to W (#8761)
* Change units from KW to W

Change power unit from KW to W to be consistent with other energy sensors.

* Change units from kW to W
2017-07-31 20:41:45 -07:00
mjj4791
775185896a buienradar dates tz-aware (#8767) 2017-07-31 20:37:33 -07:00
Paulus Schoutsen
e6331aafb2 Merge remote-tracking branch 'origin/master' into dev 2017-07-31 18:30:40 -07:00
Paulus Schoutsen
fbb4c43353 Merge pull request #8757 from home-assistant/release-0-50-2
0.50.2
2017-07-31 18:28:14 -07:00
gwhiteCL
455ac9724a added invert_state optional parameter (#8695)
* added invert_state optional parameter

* removed superfluous parens

* moved state inversion to the is_closed method

* added relay_invert feature

* fixed syntax to comply with houndci-bot rules

* changed state_invert to invert_state and relay_invert to invert_relay
2017-07-31 20:24:21 -04:00
Alan Fischer
e6be560e00 Add toggle to remotes (#8483)
* Add toggle to remotes

* Only include activity if specified, and add service description
2017-07-31 19:46:12 +02:00
Adam Mills
59891fa838 Fix Z-Wave barrier discovery for new API (#8706) 2017-07-31 09:15:10 -07:00
Adam Mills
475ab68853 Correctly discover GE Fan Controllers (#8682) 2017-07-31 09:15:10 -07:00
Paulus Schoutsen
d3f8ad15a4 Version bump to 0.50.2 2017-07-31 09:14:07 -07:00
Sean Gollschewsky
c45fc84859 Move I/O outside of properties for light/tplink platform (#8699)
* Add new component for TPLink light bulbs.

* Update with result of gen_requirements_all.

* Add new component light.tplink.

* Move I/O outside of properties as per https://goo.gl/Nvioub.
2017-07-31 09:10:04 -07:00
Adam Mills
2a09ac017f Fix Kodi reconnection after websocket disconnect (#8704) 2017-07-31 09:10:04 -07:00
Paulus Schoutsen
f9e8d4237d Fix alexa cards (#8708) 2017-07-31 09:10:04 -07:00
Kevin Fronczak
30e16c97fc Fixed sensor issue with Google Wifi routers in bridge mode (#8710)
* Fixed issue with routers in bridge mode

- Router in brdige mode apparently don't report all of the stats
- Re-wrote the data_format function so it's a bit easier to follow and able to log keys that aren't supported by a router in a given mode
- Changed config so that it properly ignores conditions when not explicitly listed
- Added tests to check for the above and also to verify we log that a key doesn't exist rather than throwing an exception

* Mistakenly was calling MONITORED_CONDITIONS in data_format

- Changed to be the actual config values to prevent log error
2017-07-31 09:10:04 -07:00
Eugenio Panadero
0e1f664102 Retry set_webhook up to three times, reduce timeout to 5s again (#8716) 2017-07-31 09:10:04 -07:00
Fabian Affolter
60ca79ce35 Supress exception if host is not available (fixes #8684) (#8732) 2017-07-31 09:10:04 -07:00
Martin Hjelmare
f576b37e9f Fix tradfri error spam (#8738)
* Catch tradfri timout exception

* Remove not needed return statement

* Remove test logging

* Log warning instead of error
2017-07-31 09:10:04 -07:00
Nathan Henrie
592f9901f9 Fix typo (#8754) 2017-07-31 09:10:04 -07:00
Sean Gollschewsky
7991e2df5f Fix brightness issue #8744. (#8755) 2017-07-31 09:10:04 -07:00
Paulus Schoutsen
91b062f9b7 Update frontend 2017-07-31 09:06:50 -07:00
Sean Gollschewsky
9919eec596 Fix brightness issue #8744. (#8755) 2017-07-31 09:02:04 -07:00
Nathan Henrie
e525d13a5d Fix typo (#8754) 2017-07-31 09:00:09 -07:00
Martin Hjelmare
ce67be2fff Fix tradfri error spam (#8738)
* Catch tradfri timout exception

* Remove not needed return statement

* Remove test logging

* Log warning instead of error
2017-07-31 08:58:47 -07:00
Fabian Affolter
53048f71a0 Supress exception if host is not available (fixes #8684) (#8732) 2017-07-31 08:58:13 -07:00
Martin Donlon
164e953e8c New media_player platform for Russound devices using the RIO protocol (#8448)
* New media_player platform for Russound devices using the RIO protocol
Auto discovers zones and sources
Handles media metadata from sources that support it
asyncio implementation
Push updates for any zone or source changes so no polling required.

* Fixed up linting issues

* Addressing PR feedback

Updated russound_rio dependency to 0.1.3
Use enumerate_zones and enumerate_sources methods instead of doing it in
the platform.
Register callbacks in async_added_to_hass coroutine
Corrected behavior of async methods
2017-07-31 14:42:55 +02:00
David McNett
7156e4782e python-insteonplm module version bump (#8736)
Requiring python-insteonplm v0.7.5 (up from 0.7.4) now
2017-07-31 14:33:51 +02:00
Eugenio Panadero
37fef4016e Add proxy support for telegram_bot (#8717)
* Add proxy support for telegram_bot

New optional config parameters `proxy_url` and `proxy_params` (a dict)
```yaml
telegram_bot:
  platform: polling
  api_key: !secret telegram_bot_api_key
  allowed_chat_ids:
    - !secret telegram_bot_chatid
  proxy_url: socks5://proxy_ip:proxy_port
  proxy_params:
    username: my-username
password: my-secret-password
```

* change `ATTR_` for `CONF_` for config params
2017-07-30 12:08:19 +02:00
Eugenio Panadero
cee49f313f Retry set_webhook up to three times, reduce timeout to 5s again (#8716) 2017-07-30 11:14:28 +02:00
Eugenio Panadero
05330ac763 bump python-telegram-bot to 7.0.1 for fully support Bot API 3.2 (#8715) 2017-07-30 11:13:51 +02:00
Nicholas Sielicki
6884965c80 directv: add configuration glue for Genie slaves (#8713)
DirectPy, the third party library used for controlling directv boxes,
has the ability to accept an ID in order to act as a remote for Genie
slaves instead of just the master directv box. This commit adds glue
such that one can configure home assistant to interface with these slave
genie boxes.

Signed-off-by: Nicholas Sielicki <sielicki@yandex.com>
2017-07-30 10:17:56 +02:00
Adam Mills
e992527c68 Fix Kodi reconnection after websocket disconnect (#8704) 2017-07-29 21:55:08 -07:00
Sean Gollschewsky
431a381c8d Move I/O outside of properties for light/tplink platform (#8699)
* Add new component for TPLink light bulbs.

* Update with result of gen_requirements_all.

* Add new component light.tplink.

* Move I/O outside of properties as per https://goo.gl/Nvioub.
2017-07-29 21:53:37 -07:00
Paulus Schoutsen
22088d192a Fix alexa cards (#8708) 2017-07-29 21:52:26 -07:00
Kevin Fronczak
418a8bab11 Fixed sensor issue with Google Wifi routers in bridge mode (#8710)
* Fixed issue with routers in bridge mode

- Router in brdige mode apparently don't report all of the stats
- Re-wrote the data_format function so it's a bit easier to follow and able to log keys that aren't supported by a router in a given mode
- Changed config so that it properly ignores conditions when not explicitly listed
- Added tests to check for the above and also to verify we log that a key doesn't exist rather than throwing an exception

* Mistakenly was calling MONITORED_CONDITIONS in data_format

- Changed to be the actual config values to prevent log error
2017-07-29 21:50:02 -07:00
Adam Mills
a94e7ec25d Fix Z-Wave barrier discovery for new API (#8706) 2017-07-30 00:40:56 -04:00
Adam Mills
8ac63fd70c Remove deprecated sensor_class config options (#8702) 2017-07-29 19:46:27 -04:00
Adam Mills
8ba9e8016b Remove deprecated substitute interfaces (#8701) 2017-07-29 19:18:06 -04:00
Adam Mills
750ea44b4b Remove deprecated host and ssl logic from Kodi (#8700) 2017-07-29 19:17:41 -04:00
Paulus Schoutsen
5876d6766d Version bump to 0.50.1 2017-07-29 15:11:45 -07:00
Paulus Schoutsen
78428b0acd Version bump to 0.51.0.dev0 2017-07-29 13:33:52 -07:00
Paulus Schoutsen
72db28abac Merge remote-tracking branch 'origin/master' into dev 2017-07-29 13:33:15 -07:00
Paulus Schoutsen
e13fd05e7d Merge pull request #8685 from home-assistant/release-0-50
0.50
2017-07-29 13:28:22 -07:00
Adam Mills
80ab02c3e8 Correctly discover GE Fan Controllers (#8682) 2017-07-29 16:24:15 -04:00
Paulus Schoutsen
a760673ad6 Persist shopping list + clear completed (#8697) 2017-07-29 12:22:52 -07:00
Paulus Schoutsen
0bde0a6f3a Persist shopping list + clear completed (#8697) 2017-07-29 12:22:38 -07:00
Paulus Schoutsen
12dec93565 Update frontend 2017-07-29 12:18:50 -07:00
William Scanlon
c376bc2e45 Support for Wink local control (#8607)
* Support for Wink local control
2017-07-29 10:50:56 -07:00
Paulus Schoutsen
f0e5f68865 Shopping List: edit name / complete status (#8666)
* Shopping List: edit name / complete status

* Change ID to be UUID based
2017-07-29 10:50:56 -07:00
Paulus Schoutsen
56f4486e0b Update frontend 2017-07-29 10:45:14 -07:00
kfcook
d1b73a96f4 Added Lutron Caseta Scene Support (#8690)
* added scene support

* Updated pylutron_caseta version number

* Updated pylutron_caseta version number

* Fixed lint errors

* fix style
2017-07-29 18:07:28 +02:00
Paulus Schoutsen
1749859cdf Shopping List: edit name / complete status (#8666)
* Shopping List: edit name / complete status

* Change ID to be UUID based
2017-07-29 17:48:09 +02:00
Fabian Affolter
931f4d8161 Upgrade mypy to 0.521 (#8692) 2017-07-28 23:22:56 -07:00
Fabian Affolter
61508deed3 Upgrade pushbullet.py to 0.11.0 (#8691)
* Upgrade pushbullet.py to 0.11.0

* Update sensor as well
2017-07-28 23:22:35 -07:00
Paulus Schoutsen
828c469ef7 Fix Lint 2017-07-28 20:53:15 -07:00
William Scanlon
1b57566e8e Support for Wink local control (#8607)
* Support for Wink local control
2017-07-28 12:02:16 -04:00
Paulus Schoutsen
0a6d519b9d Merge remote-tracking branch 'origin/master' into release-0-50 2017-07-28 02:42:58 -07:00
Paulus Schoutsen
0c97fe7eac Version bump to 0.50 2017-07-28 02:38:06 -07:00
Chris
e8ce41874c Fix COMMAND_CLASS_BARRIER_OPERATOR for dev branch of OpenZwave (#8574)
* Update zwave.py to work with updated OpenZwave library

Update zwave.py to work with updated OpenZwave library

* Update zwave.py

* Update zwave.py

* Update to fix garage door openers

Update to fix garage door support for latest version of openzwavelib

* Update to cover.zwave list of states

Update to cover.zwave to provide list of states based on dev version of
openzwave lib

* Some values not saved

* Formatting fix

* Formatting fix

* Variable typo

* Formatting fix

* Formatting

* Variable Update

Variable Update and properties added

* Formatting fixes

* Formatting Fix

* Update test case for door states

* Formatting / Testing process fix

* Formatting

* Formatting / Test Fixes

* Variable rename

* Added members to CoverDevice

* Removed un-needed else

* Formatting

* Formatting

* Variable name changes and const updates

* Changed variable names to cover_state
* Added constains into const.py
* Updated to change the main state on the cover device

* Fixes

* Formatting fixes

* Formatting/Variables

* Formatting

* Variable fixes

* Import update

* Formatting  / Variables

* Update test for new states

* Revert state changes

* Test fix

* Variable Fix

* Formatting

* Variable typo

* Missing constant

* Variable fix

* Requested changes

* Added is_opening
* Added is_closing
* Updated test based on changes

* Formatting

* Changed cover_state back to _state

* Formatting and variable fixes

* Test fixes

* Formatting and variable touchup

* Formatting

* Optimizations

* Add new cover features to demo

* Add tests for demo cover closing/opening

* Remove unused STATE_STOPPED

* Add tests for new zwave cover values
2017-07-27 18:57:30 -04:00
Brian Gehrich
0ab0e35d59 Updated pysnmp to 4.3.9 (#8675) 2017-07-27 22:33:17 +02:00
Pascal Vizeli
51108b8fe9 Hass.io: logo support / timeout handling (#8668)
* Disable auth on logo / no timeout for addons update/install

* fix tests
2017-07-27 12:23:22 -07:00
Daniel Perna
9e6817b6d0 Upgrade pyhomematic to 0.1.30 (#8673) 2017-07-27 17:45:59 +02:00
Fabian Affolter
74581b57f8 Upgrade sqlalchemy to 1.1.12 (#8669) 2017-07-27 17:23:51 +02:00
Fabian Affolter
4fcaea23a8 Upgrade libnacl to 1.5.2 (#8670) 2017-07-27 17:23:07 +02:00
Fabian Affolter
b59c29943b Upgrade fuzzywuzzy to 0.15.1 (#8671) 2017-07-27 17:22:40 +02:00
Richard Cox
1e8c00ac02 Adding support for mapping keys to value in statsd (#8665)
* Adding ability to map specific states to values

* Adding test for mapping
2017-07-27 08:58:34 +02:00
Abílio Costa
9d5c61b2f0 MQTT Switch: add availability_topic for online/offline status (#8593)
* mqtt switch: add availability_topic for online/offline status

* fix method doc strings

* MQTT Switch: add test
2017-07-27 08:24:15 +02:00
kfcook
f5eeb252a7 Added support for SerenaHoneycombShades to Lutron Caseta (#8662)
Add an optional extended description…
2017-07-27 08:14:12 +02:00
Robin
3b4ea864a1 Add uk_transport component. (#8600) 2017-07-26 20:49:52 +01:00
Jeff Wilson
3318f02664 Add transition support to light.zha (#8548)
* Add transition support to light.zha

* Address hound formatting

* Address hound comments

Look, nobody is perfect... alright?

* Update zha.py
2017-07-26 17:22:31 +02:00
Greg Laabs
438edc5ca1 History performance improvements for single-entity requests (#8632)
* Bugfix: remove superfluous domain filter

This filter is already applied later in the function by the `filters` object, where it is conditionally applied when appropriate. This fixes the problem where we get a domain filter even when searching for a single entity_id, which needlessly harms the query's performance.

* Performance: build different query when only getting single entity

When querying the history of a single entity, we can use an entirely different method for the "synthetic zero data point" by simply sorting by date and doing a LIMIT 1. This performs thousands of times better than the multi-entity query when the current recorder_run has been going for a while.

* Add entity_id filter to single-entity request

The entity_id filter was handled inside the `filters.apply` logic which is used in most cases, BUT didn't work when no `filters` was passed in to the method. Now it'll work even if no `filters` object is passed in.

* Fix linting errors in history.py

* Undo removal of domain filter

Putting back the domain filter that was removed in 76a6371705 - there are use-cases where get_states is called without a filter object, so we need the domain filter to work in those cases as well.

* Fix truncated comment
2017-07-26 11:22:01 -04:00
Boyi C
abcfcdd887 Yahoo Weather update, supports forecast for more days (#8626)
* work on weather panel

* update yahooweather with more forecast details

* Update yweather to allow user input forecast date

* fix for houndci

* fix long line

* fix1

* Revert "work on weather panel"

This reverts commit 28b4972233.

revert unintentional submodule change

* fix2

fix typo, add try catch to another int()

* fix pylint

* fix3

* fix4

* Update yweather.py

* Update yweather.py

* Remove global data construct

* Yahoo API support only 5 days forecast

* remove forecast

* fix lint

* fix lint p2

* Update yweather.py
2017-07-26 16:46:21 +02:00
Thomas Delaet
fff269e790 Velbus (#8076)
* add Velbus changes

* update library version

* fix python-velbus version

* bug fix and update python-velbus

* change config handling

* update velbus components/platforms

* add support for Velbus switches

* fix bugs

* typo

* add velbus fan

* update velbus library

* bug fix in logic of fan handling of speed settings

* add Velbus changes

change config handling

update velbus components/platforms

add support for Velbus switches

add velbus fan

* remove duplicate entry

* fix documentation links

* fix linting error

* regen requirements_all.txt

* add support for Velbus cover

* bugfix in cover component

* bugfix in cover component

* remove unused imports

* Travis fixes

* fix style

* fix style

* Update velbus.py

* Update velbus.py

* Update velbus.py

* Update requirements_all.txt

* Update velbus.py

* Update velbus.py

* Update velbus.py

* Update velbus.py

* fix style

* Update velbus.py

* Update velbus.py

* Update velbus.py

* Update velbus.py

* Update velbus.py

* Update velbus.py
2017-07-26 14:03:29 +02:00
Anders Melchiorsen
81a27e726c Upgrade aiolifx (#8648)
This release includes a fix for multizone lights with zone counts that are not
a multiple of eight.
2017-07-26 12:33:00 +02:00
Marcelo Moreira de Mello
7c120748ce Fixes Fitbit sensor to report battery level with the expected device (#8647)
Add an optional extended description…
2017-07-26 11:05:48 +02:00
Sean Gollschewsky
e83816c055 Add component Light TPLink (#8643)
* Add new component for TPLink light bulbs.

* Update with result of gen_requirements_all.

* Add new component light.tplink.
2017-07-26 09:04:40 +02:00
Paulus Schoutsen
cd2703e121 Update dependencies cast + discovery (#8646) 2017-07-25 23:35:05 -07:00
Paulus Schoutsen
c2828bac2c Tweak conversation/intent/shopping list (#8636) 2017-07-25 00:42:59 -07:00
Paulus Schoutsen
ad7370e1c2 Update frontend 2017-07-25 00:29:05 -07:00
Adam Mills
3b7f16f189 Catch and log Lyft API errors (#8635) 2017-07-25 00:05:47 -04:00
Colin O'Dell
cc03f7ee6a Manual alarm with MQTT control (#8257)
* Manual alarm with MQTT control

* Duplicate manual control panel code instead of extending it

* Duplicate manual alarm test as well; modify for manual_mqtt

* Add MQTT-specific tests for manual_mqtt alarm
2017-07-24 09:06:38 -07:00
Corey Pauley
ecc1429453 Added support for default value when environment variable is missing (#8484)
* Added support for a default value when an environment variable is missing

* Shouldn't have used docstring
2017-07-24 09:00:01 -07:00
Justin Dray
98568b5eb7 Add support for using credstash as a secret store (#8494) 2017-07-24 08:59:10 -07:00
Paulus Schoutsen
9d9ca64f26 Update README.rst 2017-07-24 07:53:14 -07:00
Paulus Schoutsen
1d31137616 Update README.rst 2017-07-24 07:47:57 -07:00
Pascal Vizeli
f86bd15580 Cleanup old device_tracker stuff (#8627)
* Cleanup old device_tracker stuff

* Fix lint
2017-07-24 07:45:02 -07:00
Paulus Schoutsen
cbf65220aa Merge pull request #8625 from home-assistant/release-0-49-1
0.49.1
2017-07-24 07:35:29 -07:00
Daniel Høyer Iversen
c100b8cb52 Add is_lighting4 to RfxtrxBinarySensor (#8563) 2017-07-24 07:33:37 -07:00
matt2005
654ad41464 added onvif camera fix for non-virtual env installations (#8592)
* added fix for non-virtual env installations

* fixed new line at end of file

* moved import os to top of file
2017-07-24 15:22:12 +02:00
Paulus Schoutsen
a2abb4ae0a Update frontend 2017-07-24 00:11:58 -07:00
Jeff Wilson
36e266442f Properly slugify switch.flux update service name (#8545) 2017-07-23 23:53:21 -07:00
Jeff Wilson
f3d9086ff4 Properly slugify switch.flux update service name (#8545) 2017-07-23 23:53:03 -07:00
Anton Lundin
0c09cfc6c4 ubus: Make multiple instances work again (#8571)
Back in "ubus: Refresh session on Access denied (#8111)" I added the
decorator _refresh_on_acccess_denied. Somehow that stopped multiple ubus
trackers from working in parallel, and only the one first init'ed
worked.

Changing the order of the decorators fixes the issue but, I'm sorry to
say I can't figure out why. There's some magic somewhere which I'm
missing.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-07-23 23:51:25 -07:00
Anton Lundin
b0b6026c68 ubus: Make multiple instances work again (#8571)
Back in "ubus: Refresh session on Access denied (#8111)" I added the
decorator _refresh_on_acccess_denied. Somehow that stopped multiple ubus
trackers from working in parallel, and only the one first init'ed
worked.

Changing the order of the decorators fixes the issue but, I'm sorry to
say I can't figure out why. There's some magic somewhere which I'm
missing.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-07-23 23:51:07 -07:00
Russell Cloran
8f47a9109c prometheus: Fix zwave battery level (#8615) 2017-07-23 23:49:22 -07:00
Russell Cloran
f0293eeac2 prometheus: Fix zwave battery level (#8615) 2017-07-23 23:49:03 -07:00
Phil Cole
e4317a6741 Tado Fix #8606 (#8621)
Handle case where 'mode' and 'fanSpeed' are missing JSON. Based on
changes in commit
adfb608f86
2017-07-23 23:48:33 -07:00
Phil Cole
4b449f5f93 Tado Fix #8606 (#8621)
Handle case where 'mode' and 'fanSpeed' are missing JSON. Based on
changes in commit
adfb608f86
2017-07-23 23:48:20 -07:00
Daniel Schaal
8760dc9b29 Check if /dev/input/by-id exists (#8601) 2017-07-23 23:47:52 -07:00
Daniel Schaal
1831a7da68 Check if /dev/input/by-id exists (#8601) 2017-07-23 23:47:38 -07:00
Marcelo Moreira de Mello
3e34f34f6b Bumped Amcrest version (#8624) 2017-07-23 23:46:35 -07:00
Marcelo Moreira de Mello
3fec2955a5 Bumped Amcrest version (#8624) 2017-07-23 23:46:23 -07:00
Chia-liang Kao
2cf9254a08 Fix STATION_SCHEMA validation on longitude (#8610) 2017-07-23 23:35:49 -07:00
Russell Cloran
333da0dc6d zha: Update to bellows 0.3.4 (#8594) 2017-07-23 23:35:49 -07:00
Yannick POLLART
7b10f0a14f Fix broken status update for lighting4 devices (#8543)
* Fix broken status update for lighting4 devices

* Fixed indentation
2017-07-23 23:35:49 -07:00
Anders Melchiorsen
fb6bdfaba9 LIFX: assume default features for unknown products (#8553)
This makes the detection work for prototypes as well.
2017-07-23 23:35:48 -07:00
Pierre Ståhl
d7da90ae54 Fix support for multiple Apple TVs (#8539) 2017-07-23 23:35:48 -07:00
Eugenio Panadero
a5bfcceacd Attach the chat_id for a callback query from a chat group (fixes #8461) (#8523) 2017-07-23 23:35:48 -07:00
Pascal Vizeli
4961ece931 Realfix for dlib (#8517)
* Update dlib_face_detect.py

* fix lint

* Update dlib_face_detect.py
2017-07-23 23:35:48 -07:00
Pascal Vizeli
7d99d6aad9 Update dlib_face_detect.py (#8516) 2017-07-23 23:35:48 -07:00
Russell Cloran
6dc93c2751 prometheus: Convert fahrenheit to celsius (#8511) 2017-07-23 23:35:48 -07:00
Maikel Wever
5c39eebea8 Fix TP-Link device tracker regression since 0.49 (#8497)
* Fix TP-Link device tracker regression since 0.49

This regression was introduced by #8322.

Fix is to utf encode the password like the other TP-Link backends do.

* Fix linting issue introduced in previous commit

Commit in question: 677f3fbb7f
2017-07-23 23:35:48 -07:00
Paulus Schoutsen
ffd295b38b Update to 0.49.1 2017-07-23 23:34:08 -07:00
Phil Hawthorne
5d810dae86 REST binary sensor value_template optional (#8596)
According to the documentation, the `value_template` for the REST
binary_sensor is not required. However, if you don't provide this when
setting up a binary sensor, the component fails. Looks like a variable
was not being set, which I've now included.

This should make the REST binary sensor act the same way as the REST
sensor now.
2017-07-23 22:42:41 +02:00
Fabian Affolter
486bcc4cae Upgrade mypy to 0.520 (#8616) 2017-07-23 20:20:38 +02:00
Fabian Affolter
cc2de5e1dc Upgrade youtube_dl to 2017.7.23 (#8617) 2017-07-23 20:20:23 +02:00
cribbstechnologies
77d8e393a1 better but still not great (#8618) 2017-07-23 20:19:58 +02:00
Koen Ekelschot
c6bf529d38 Allow set_cover_position in scenes (#8613) 2017-07-23 15:59:27 +02:00
Chia-liang Kao
dac9716cf4 Fix STATION_SCHEMA validation on longitude (#8610) 2017-07-23 10:22:49 +02:00
Thomas Klingbeil
9043895407 make attributes in the fritzdect module easier to process (#8436)
* make attributes in the fritzdect module easier to process
* remove spaces in attribute names
* move units to separate attributes

* make attributes in the fritzdect module easier to process
* remove spaces in attribute names
* move units to separate attributes

* Use new python formating syntax and attribute constant

* Shorten too long line

* Fix indent
2017-07-22 20:34:58 +02:00
Open Home Automation
2f08a91fdd Simplified percent conversion, better logging (#8568)
* Simplified percent conversion, better logging

*  Unnecessary pass statement (unnecessary-pass)
2017-07-22 20:00:13 +02:00
Sean Gollschewsky
1807b45222 Binary sensor ping fixed for hassio (#8573)
* Add support for multiple ping utilities.

* Added support for differing flavours of ping included with
different distributions (specifically alpine linux for hassio's
homeassistant).

* Updated as per comments in PR
2017-07-22 19:50:31 +02:00
Teemu R
b4f392b181 bump python-mirobo version for more robust protocol handling, make the platform to update on startup (#8602) 2017-07-22 19:36:14 +02:00
William Scanlon
8e8ec7a7c3 Remove code in wink.py overwriting hass.data configurator (#8595) 2017-07-22 09:21:38 -04:00
Paulus Schoutsen
7edf14e55f Add Intent component (#8434)
* Add intent component

* Add intent script component

* Add shopping list component

* Convert Snips to use intent component

* Convert Alexa to use intent component

* Lint

* Fix Alexa tests

* Update snips test

* Add intent support to conversation

* Add API to view shopping list contents

* Lint

* Fix demo test

* Lint

* lint

* Remove type from slot schema

* Add dependency to conversation

* Move intent to be a helper

* Fix conversation

* Clean up intent helper

* Fix Alexa

* Snips to use new hass.components

* Allow registering intents with conversation at any point in time

* Shopping list to register sentences

* Add HTTP endpoint to Conversation

* Add async action option to intent_script

* Update API.ai to use intents

* Cleanup Alexa

* Shopping list component to register built-in panel

* Rename shopping list intent to inlude Hass name
2017-07-21 21:38:53 -07:00
Paulus Schoutsen
7bea69ce83 update frontend 2017-07-21 21:29:58 -07:00
Russell Cloran
8d31c5fbf6 zha: Update to bellows 0.3.4 (#8594) 2017-07-21 21:22:43 -07:00
William Scanlon
dc42b6358a Support for Wink oauth application authorization (#8208) 2017-07-21 20:18:57 -04:00
Per Osbäck
06ceadfd54 upgrade pywebpush and PyJWT (#8588) 2017-07-21 22:35:19 +02:00
Daniel Høyer Iversen
4359e0babf xiaomi binary sensor bug fix (#8586)
* xiaomi binary sensor bug fig

* Is not need on binary_sensor
2017-07-21 12:39:25 +02:00
Marcelo Moreira de Mello
ee153062ab Extends Fitbit sensors to track the device battery level (#8583)
* Extends Fitbit sensors to track the device battery level

* cleanup old stuff

* remove update from init
2017-07-21 10:19:26 +02:00
Sebastian Muszynski
fada6d3f49 Device support for different new sensors of the xiaomi aqara gateway (#8577)
* The gateway configuration accepts a MAC address or a SID value in uppercase already.
The ringtone services accepts the same values now. I hope it will avoid confusion.

* Device support for the new wall switches with neutral lead (ctrl_ln1, ctrl_ln2) added.

* Measurement unit from pressure of weather.v1 fixed.

* Device support for sensor_magnet.aq2 added.

* Device support for sensor_motion.aq2 (motion and lux) added.

* Code reformatted.

* The ringtone service (start/stop) uses the parameter gw_mac instead of gw_sid now.

* Version of the required library updated.
2017-07-21 10:13:42 +02:00
Daniel Høyer Iversen
f6a5e0887d upgade xiaomi lib to 0.2 (#8584) 2017-07-21 10:10:03 +02:00
William Scanlon
4f8d2ec317 Added Time Remaining and Time Elapsed sensors for octoprint (#8581)
Add an optional extended description…
2017-07-21 09:40:07 +02:00
Aaron Bach
e63a96cf53 Bumped python-simplisafe version (#8578)
* Bumped python-simplisafe version
2017-07-20 18:59:41 -04:00
Daniel Høyer Iversen
a5c0831dc1 xiaomi bug fix (#8576) 2017-07-20 23:04:21 +02:00
namadori
718949481f fix #8263 corrected Adafruit DHT library version from 1.3.0 to 1.3.2 (#8562)
Add an optional extended description…
2017-07-20 15:53:06 +02:00
Daniel Høyer Iversen
90639d33ab Xiaomi gw support (#8555)
* xiaomi support

* xiaomi support

* style

* style

* style

* style

* style

* coveragerc

* Update xiaomi.py

* Update xiaomi.py

* Update xiaomi.py

* refactorization

* refactorization

* config validation

* style

* package

* refactorization

* refactorization

* refactorization

* HA integration
2017-07-20 15:20:00 +02:00
Greg Dowling
966809c1a1 Merge pull request #8564 from home-assistant/bump_pyvera
Bump pyvera to fix colour exception
2017-07-20 11:53:53 +01:00
pavoni
bc27d173d0 Bump pyver to fix exception in fetching colours. 2017-07-20 10:21:08 +01:00
Daniel Høyer Iversen
fde291f866 Add is_lighting4 to RfxtrxBinarySensor (#8563) 2017-07-20 11:12:42 +02:00
Paulus Schoutsen
49c399c358 Update persistent deps dir version in config.py (#8479)
* Update persistent deps dir version in config.py

* Update last version to remove deps dir in tests
2017-07-19 22:59:21 -07:00
Sean Dague
8d1999dc12 Enhance python_script to support "_getitem_" (#8541)
* Enhance python_script to support "_getitem_"

In order to use dict / list structures in python scripts we need
_getitem_ allowed in the RestrictedPython environment. There is a
default_guarded_getitem included with RestrictedPython, which is a
pass through used in the Eval code paths.

* Add tests for dict/list support in python_scripts

* Lint
2017-07-19 22:56:24 -07:00
Yannick POLLART
ee05a4ab89 Fix broken status update for lighting4 devices (#8543)
* Fix broken status update for lighting4 devices

* Fixed indentation
2017-07-19 22:56:11 -07:00
Anders Melchiorsen
8a42e1551a LIFX: assume default features for unknown products (#8553)
This makes the detection work for prototypes as well.
2017-07-19 22:54:46 -07:00
Jeff Wilson
9cc3e7e47b Handle manual edits to emulated_hue_ids.json (#8560) 2017-07-19 22:51:50 -07:00
Open Home Automation
54755df9ea Added a service to write to KNX group addressed including documentation (#8491)
* Added a service to write to KNX group addressed including documentation

* Define parameters as required

* Reformating

* Moved service documentation to service.yaml

* Moved service documentation to services.yaml

* Update knx.py
2017-07-20 07:01:05 +02:00
William Scanlon
84ebcd8a59 Support for Wink Switch and Light groups also fix fan speed selection (#8501)
* Support for Switch and Light groups, fix fan speed

* Fixed hound violations
2017-07-20 00:27:39 +02:00
Marcelo Moreira de Mello
f1280d3edb Extends Pi-hole sensor to support the new sensors: (#8549)
- domains_being_blocked
  - queries_cached
  - queries_forwarded
  - unique_clients
  - unique_domains
2017-07-19 19:45:53 +02:00
Eugenio Panadero
c27074e6f7 turn_on_action and turn_off_action with script syntax (#8558) 2017-07-19 13:33:16 -04:00
viswa-swami
c8bfcd2ed4 Upgrade the alarmdecoder dependency library from 0.12.1 to 0.12.3. (#8542)
* Upgrade the alarmdecoder dependency library from 0.12.1 to 0.12.3. Nutech software who owns this library have upgraded this library with some fixes regarding arming it to home/away and then disarming the alarm. Without this upgraded library, HASS is having a problem when we try to disarm an armed alarm after around 8 hours or so.

* Updated the requirements_all.txt by running the script gen_requirements_all.py
2017-07-19 12:21:39 +02:00
Jeff Wilson
42699b7a60 Report Harmony remote off if state is unknown (#8547)
Add an optional extended description…
2017-07-19 12:20:45 +02:00
Aliaksandr
6bc07298d3 [media_extractor] Add support for custom stream queries for media_extractor (#8538)
* Add support for different stream formats

* Encapsulate logic inside MediaExtractor class

* Add CONFIG_SCHEMA

* Fix for cases when youtube-dl returns content of playlist as list
2017-07-19 08:14:48 +01:00
Marcelo Moreira de Mello
4ece4bf241 Fix exception dlib_face_identify when image is not recognized by face_recognition module (#8552)
*   Some images are not supported by face_recognition, so this patch treats the error
  messages instead throwing a traceback. Fixes #7867

* Makes lint happy
2017-07-19 09:04:01 +02:00
Kevin Fronczak
1a86fa5a02 Initial support for Google Wifi/OnHub (#8485)
* Initial support for Google Wifi/OnHub

* Moved state logic to update function of API class

- Throttle added to update
- State logic implementation is cleaner
- Modified tests to work with the new throttle on update
2017-07-19 00:16:32 +02:00
Paulus Schoutsen
d54a634f11 Update demo.py 2017-07-18 15:11:17 -07:00
Thibault Cohen
5e1ff20b09 Decora: Fix set brightness and improve reconnection (#8522) 2017-07-19 00:02:42 +02:00
Pierre Ståhl
29266213a0 Fix support for multiple Apple TVs (#8539) 2017-07-18 19:19:36 +01:00
Fabian Affolter
2aa89cfe07 Upgrade TwitterAPI to 2.4.6 (#8535) 2017-07-18 16:24:32 +02:00
Fabian Affolter
879c816f5c Update docstrings (#8536) 2017-07-18 16:23:57 +02:00
Thibault Cohen
4ae11c009d Fix #6469 and #6828 (#8537) 2017-07-18 16:23:39 +02:00
Phil Lavin
dcd6f7a29e Return a 0 temperature value when none is found (#8518)
* Return a 0 temperature value when none is found

It's well documented that these TRVs will only return the current temperature
for a short time after the actuator has moved. This means that, usually, they will
not return the current temperature. Setting a non-value here causes errors in the logs
and for the TRV to not show on the dashboard at all

* Fix lint issue
2017-07-17 23:34:38 +02:00
Jan Losinski
fde4a7d029 Citybikes: Allow None as result for empty slots (#8528)
The citibykes API returns "null" as value for empty_slots on some
stations (see #8527). This causes the component to not process the data.

This is fixed by accepting None as valid data. The row in the frontend
is left empty if "null" was returned by the service.

fixes #8527
2017-07-17 22:50:55 +02:00
Anders Melchiorsen
b83ff739bc Remove deprecated automation keywords (#8510)
* Remove deprecated automation keywords

* Remove retired test case

* Remove retired keyword
2017-07-17 22:24:05 +02:00
Eugenio Panadero
8c9b3898fc handle timeout errors without logging.exception when updating hue lights; double quotes in log msgs (#8524) 2017-07-17 22:16:18 +02:00
Fabian Affolter
95e0027924 Fix KeyError 2017-07-17 20:21:16 +02:00
Mike Christianson
c67c20f752 fix for a bug introduced with media support in #8282 (#8513)
data may be None if twitter data property unconfigured:
  File "/opt/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/notify/twitter.py", line 63, in send_message
    media = data.get(ATTR_MEDIA)
2017-07-17 19:45:42 +02:00
Kevin Fronczak
1a1571cd52 Added sensor state rounding (#8499) 2017-07-17 19:21:41 +02:00
Eugenio Panadero
cca0d3ed44 Attach the chat_id for a callback query from a chat group (fixes #8461) (#8523) 2017-07-17 13:47:28 +02:00
Pascal Vizeli
f0479855bd Realfix for dlib (#8517)
* Update dlib_face_detect.py

* fix lint

* Update dlib_face_detect.py
2017-07-17 12:09:42 +02:00
Russell Cloran
40aafcdf5d prometheus: Convert fahrenheit to celsius (#8511) 2017-07-17 11:25:20 +02:00
Pascal Vizeli
8c9557401f Update dlib_face_detect.py (#8516) 2017-07-17 11:03:16 +02:00
Alexander Rust
ffd3081743 Added additional attributes to OwnTracks device_tracker (#8503)
* Added additional attributes to OwnTracks device_tracker

* Added missing space after :
2017-07-16 21:43:47 +02:00
Paulus Schoutsen
d0275c8075 Persistent notification import (#8507)
* Rewrite persistent notification creation

* Update components.is_on to use auto loading

* Fix two hass parameters
2017-07-16 21:39:38 +02:00
Maikel Wever
f6c3832e90 Fix TP-Link device tracker regression since 0.49 (#8497)
* Fix TP-Link device tracker regression since 0.49

This regression was introduced by #8322.

Fix is to utf encode the password like the other TP-Link backends do.

* Fix linting issue introduced in previous commit

Commit in question: 677f3fbb7f
2017-07-16 10:27:48 -07:00
Paulus Schoutsen
d29bdddaa7 Add bind_hass to components (#8502)
* Add bind_hass to components

* Add bind_hass to group
2017-07-16 10:14:46 -07:00
Paulus Schoutsen
d3be056d15 Expose all components on hass [Concept] (#8490)
* Add components concept

* Lint

* Raise ImportError if component not found
2017-07-16 09:23:06 -07:00
Open Home Automation
bffa0d2b04 Bump to KNXIP 0.5 (#8492)
* Bump to KNXIP 0.5

* Updated requirements file
2017-07-16 13:34:13 +02:00
Paulus Schoutsen
23b65bfb30 Version bump to 0.50.0dev0 2017-07-15 21:07:15 -07:00
Paulus Schoutsen
1d4a7f1160 Version bump to 0.49 2017-07-15 21:06:20 -07:00
Paulus Schoutsen
dc08852fc2 Merge pull request #8468 from home-assistant/release-0-49
0.49
2017-07-15 21:05:07 -07:00
Andrey
3377f30613 Make themes API work even when themes are not defined. (#8473) 2017-07-15 19:43:06 -07:00
Anders Melchiorsen
84ca4d2a21 Accept transition for light.toggle (#8466) 2017-07-15 19:43:06 -07:00
Bryce Edwards
1366c93c83 Radarr sensor fix for issue #8250 (#8456)
* Radarr sensor fix for issue #8250

* Radarr sensor fix for issue #8250
2017-07-15 19:43:06 -07:00
Sean Gollschewsky
e5e2a151aa Remove km from visibility, add visibility_distance (#8454)
* Remove km from visibility, add visibility_distance

* Fix line length

* Fix trailing space and line break indentation

* Indentation

* More whitespace
2017-07-15 19:43:06 -07:00
dersger
bd1e533409 Fix media_position for cast component (#8452)
* Make it available during state paused.

* Don't adjust for media_position_updated_at. I.e. do as vlc, sonos etc
  so that returned position is the position at the time of
  media_position_updated_at, not now.
2017-07-15 19:43:06 -07:00
Dougal Matthews
21e82bd037 Add RGB support to switch.flux (#8417) 2017-07-15 19:43:06 -07:00
Anders Melchiorsen
af9a0e8fea LIFX: support for multizone (#8399)
* Make aiolifx modules easily available

* Use aiolifx features_map for deciding bulb features

Also move the feature detection out of Light so it is available even
during the initial detection.

* Move each LIFX light type to a separate class

* Simplify AwaitAioLIFX

This has become possible with recent aiolifx that calls the callback even
when a message is lost.

Now the wrapper can be used also before a Light is added though the register
callback then has to become a coroutine.

* Refactor send_color

* Add support for multizone

This lets lifx_set_state work on individual zones.

Also update to aiolifx_effects 0.1.1 that restores the state for individual
zones.
2017-07-15 19:43:05 -07:00
Paulus Schoutsen
abc5c3e128 Fix iFrame panel test 2017-07-15 19:42:17 -07:00
Martin Hjelmare
543e8bb62e Fix check for running inside venv (#8481)
* Import and use the function from pip instead of defining it
  ourselves.
* Fix tests.
2017-07-15 07:25:02 -07:00
Andrey
6ca828fd14 Make themes API work even when themes are not defined. (#8473) 2017-07-14 11:26:26 -07:00
Anders Melchiorsen
87b83f3602 Accept transition for light.toggle (#8466) 2017-07-13 20:04:23 -07:00
Bryce Edwards
5829cdfdf1 Radarr sensor fix for issue #8250 (#8456)
* Radarr sensor fix for issue #8250

* Radarr sensor fix for issue #8250
2017-07-13 20:02:07 -07:00
Sean Gollschewsky
d473f3407b Remove km from visibility, add visibility_distance (#8454)
* Remove km from visibility, add visibility_distance

* Fix line length

* Fix trailing space and line break indentation

* Indentation

* More whitespace
2017-07-13 20:01:25 -07:00
dersger
9373d5e901 Fix media_position for cast component (#8452)
* Make it available during state paused.

* Don't adjust for media_position_updated_at. I.e. do as vlc, sonos etc
  so that returned position is the position at the time of
  media_position_updated_at, not now.
2017-07-13 20:00:23 -07:00
Dougal Matthews
d8abef9210 Add RGB support to switch.flux (#8417) 2017-07-13 19:53:19 -07:00
Anders Melchiorsen
4fde0ffe9c LIFX: support for multizone (#8399)
* Make aiolifx modules easily available

* Use aiolifx features_map for deciding bulb features

Also move the feature detection out of Light so it is available even
during the initial detection.

* Move each LIFX light type to a separate class

* Simplify AwaitAioLIFX

This has become possible with recent aiolifx that calls the callback even
when a message is lost.

Now the wrapper can be used also before a Light is added though the register
callback then has to become a coroutine.

* Refactor send_color

* Add support for multizone

This lets lifx_set_state work on individual zones.

Also update to aiolifx_effects 0.1.1 that restores the state for individual
zones.
2017-07-13 19:38:36 -07:00
Martin Hjelmare
ba019c799a Make deps directory persistent over upgrades (#7801)
* Use pip install --user if venv not active

* Set PYTHONUSERBASE to deps directory, when installing with --user
  option.
* Reset --prefix option to workaround incompatability when installing
  with --user option. This requires pip version 8.0.0 or greater.
* Require pip version 8.0.3.
* Do not delete deps directory on home assistant upgrade.
* Fix local lib mount and check package exist.

* Update and add tests

* Fix upgrade from before version 0.46

* Extract function to get user site

* Add function(s) to package util to get user site.
* Use async subprocess for one of the functions to get user site.
* Add function to package util to check if virtual environment is
  active.
* Add and update tests.

* Update version for last removal of deps dir

* Address comments

* Rewrite package util tests with pytest

* Rewrite all existing unittest class based tests for package util as
  test functions, and capitalize pytest fixtures.
* Add test for installing with target inside venv.
2017-07-13 19:26:21 -07:00
Paulus Schoutsen
5581c6295e Fix iFrame panel test 2017-07-13 10:19:59 -07:00
Paulus Schoutsen
192db5bec3 Update frontend 2017-07-13 09:22:15 -07:00
Andrey
b8eaec565a Add kiosk-mode panel (#8457) 2017-07-13 09:11:49 -07:00
Daniel Perna
e0f35c0279 HomeMatic dependency upgrade + IP Wall Thermostat support (#8465)
* Upgrade dependency + added IP Wall Thermostat
2017-07-13 17:55:30 +02:00
Abílio Costa
2eeeb9075a Plex: Add exception handler when connection fails (#8179)
* add exception handler when connection fails

* plex: improve exception handling

* remove uneeded exception handler
2017-07-13 08:01:12 -07:00
Daniel Høyer Iversen
71ee290bfd upgrade rfxtrx lib (#8463) 2017-07-13 14:57:44 +02:00
Daniel Høyer Iversen
7aad93e90d upgrade broadlink (#8462) 2017-07-13 14:42:30 +02:00
Andrey
a65f22378e Backend support for themes (#8419)
* Backend support for themes

* Fix test

* Add theme_updated event

* Shorten name

* Add tests
2017-07-12 18:08:13 -07:00
Anders Melchiorsen
bb9db28c95 LIFX: make broadcast address configurable (#8453) 2017-07-12 23:08:18 +02:00
Anders Melchiorsen
d10f017441 LIFX: improve light availability (#8451)
The default aiolifx timers are tuned for a network with few lost packets.
This means that lights can become "unavailable" from just a two second
dropout. An unavailable light is completely useless for HA until it is
rediscovered so this is an undesirable state to be in.

These tweaks make aiolifx try harder to get its messages through to the
bulbs, at the cost of some latency in detecting lights that actually are
unavailable.
2017-07-12 19:24:24 +02:00
Open Home Automation
b6e0286d71 Implement a bridge between HASS event bus and KNX bus to send events (#8449)
* Implement a bridge between HASS event bus and KNX bus to send events as KNX messages

* Formatting
2017-07-12 12:21:15 +02:00
Fabian Affolter
4451d2e847 Upgrade youtube_dl to 2017.7.9 (#8450) 2017-07-12 10:38:08 +02:00
Niccolò Maggioni
229000b834 Support for Plex servers with enforced SSL (#8341)
* Support for Plex servers with enforced SSL

* Fixed HoundCI warnings

* Fixed HoundCI warnings (2nd)

* Configurator data validation

* Travis linting
2017-07-11 23:26:29 -07:00
viswa-swami
9704057959 Fix Arlo Q not working with 0.48.1 (#8446)
* This change will enable the functionality for Arlo Q cameras. When we added the code to enable/disable motion detection, we assumed that base station will be present for all arlo type of cameras. But found recently that Arlo Q cameras does not have base station. So, removed the base_station dependency in the init code. Also added code in enable/disable motion detection code to first check if base station is detected by library. If base station is detected then it will use it to enable the motion detection. If not detected, even if service was called, it will not do anything.  Enabling/disabling the motion detection for Arlo Q cameras have to added by someone who has that camera.  I don't have the Arlo Q cameras.

* Fixed a typo in the code.
2017-07-11 23:25:55 -07:00
Paulus Schoutsen
effb9e9d23 Hass.io: Disable timeout when updating OS/supervisor/hass (#8447) 2017-07-11 23:24:35 -07:00
Sean Dague
effbb3bd4c Add support for rain and moisture sensors (#8440) 2017-07-11 23:09:05 +02:00
gitmopp
471501d386 DHT support for humidity and temperature offset (#8238)
* Added support for temperature_offset and humidity_offset

Some DHT sensors require some offsets to work.

* Support for temperature and humidity offset

* Changed lines with 79 characters

* Moved const to dht.py from const.py

* Changed temperature_offset range

* Removed the const

const.py is at original state.

* Fixed continuation line under-indented

* Removed first round and added debug info
2017-07-11 23:04:00 +02:00
Vlad Korniev
ef94b5c77a Vizio SmartCast support (#8260)
* Vizio SmartCast support

* Requested changes
Added new config params

* Vizio SmartCast support

* Requested changes
Added new config params
2017-07-11 22:55:46 +02:00
Andrey
60dcc9a5c0 Switch pyW215 to pypi (#8445) 2017-07-11 22:44:01 +02:00
Fabian Affolter
5b4862cc3c Exclude 'TAXI' product (fixes #8401) (#8438) 2017-07-11 21:23:23 +02:00
Fabian Affolter
fbf945c18b Add effects (#8442) 2017-07-11 21:22:00 +02:00
Fabian Affolter
609c25691a Upgrade phue to 1.0 (fixes #7749) (#8444) 2017-07-11 21:21:17 +02:00
Paulus Schoutsen
6e77877743 Update frontend 2017-07-11 09:11:36 -07:00
Alan Fischer
7b105a2150 Updated pyvera (#8437) 2017-07-11 15:14:46 +02:00
Aliaksandr
ee57a823af Added media_helper service (#8369)
* Added media_helper service

* Fixed lint warning

* media_helper renamed to media_extractor
2017-07-11 10:16:34 +02:00
Andrew
04b1621b65 Fix radiothermostat -1 value issue (#8395)
* Fix -1 value issue

Fixed issue where thermostat will sometimes return a current temperature or set temperature value of -1

* Update radiotherm.py

* Update radiotherm.py

* Update radiotherm.py

Added retry limit

* Update radiotherm.py

* Update radiotherm.py
2017-07-11 10:12:51 +02:00
Marcelo Moreira de Mello
f5e24cb0bb Refactored Amcrest to use central hub component (#8184)
* Refactored Amcrest to use central hub component

* Set default streaming source to snapshot

* Simplified code by using discovery platforms

* Makes lint happy

* Update authentication method to basic

* Fixed lint issues

* Makes Amcrest hub async

*  Make Amcrest hub IO synchronous and disabled ffmpeg dependency on sensor/amcrest.

* Removed async to load component

* Organized import order

* Update amcrest.py
2017-07-11 10:10:10 +02:00
Russell Cloran
ac72dea09a Add support for Prometheus (#8211)
Prometheus (https://prometheus.io/) is an open source metric and alerting
system. This adds support for exporting some metrics to Prometheus, using
its Python client library.
2017-07-10 21:20:17 -07:00
Russell Cloran
2f474a0ed8 zha: Handle both input and output clusters (#8410)
bellows 0.3.0 changes the API to have both, renaming the attribute which used
to be for input clusters in the process.

This is in preparation for remotes.
2017-07-10 21:16:44 -07:00
thecynic
7a4cc8e082 Fix typo (sending USERNAME instead of PASSWORD) introduced in #7963 (#8433) 2017-07-10 20:52:37 -07:00
Mike Christianson
92dc76773a Allow Twitter notifications to include media (#8282)
* Allow notifications to include media, with Twitter as the first implementation. The Twitter notifier uses the Twitter-recommended async chunked media/upload approach and tries to convey the correct mime type of the media. Twitter implementation based on https://github.com/geduldig/TwitterAPI/blob/master/examples/upload_video.py.

* Changes based on balloob's review:
balloob: "Please remove this file. We fixed the issue in our tests that left this artifact."
balloob: "…prefer a guard clause"
balloob: "This is very inefficient. You are now generating up to 99 values."
balloob: "Since media_id is going to be None, why not just return None and you can remove the else."

* balloob: "Other notify platforms are using ATTR_DATA for it. That way if a platform requires extra metadata, we don't need to add extra fields. So please add it to Twitter via ATTR_DATA."
2017-07-10 19:58:01 -07:00
Open Home Automation
fe4abc8454 Integrate utility functions into restricted Python environment (#8427) 2017-07-10 18:42:42 -07:00
Eugenio Panadero
821d01f82c New service send_magic_packet with new component wake_on_lan (#8397)
* New service `send_magic_packet` in new component `wake_on_lan`

* fix

* Unit tests for new component wake_on_lan

* Add wakeonlan to tests requirements

* remove wakeonlan from tests requirements and remake the component tests

* remove wakeonlan from tests requirements

* link domain and service names to component

* fix mocking in test_setup_component

* send_magic_packet as coroutine, better use of mock_calls in tests

* fix imports

* review changes

* better async calls

* Update test_wake_on_lan.py
2017-07-10 18:37:51 -07:00
Teemu R
b453834b2f bump python-mirobo requirement to support newer firmwares and more (#8431) 2017-07-10 23:18:58 +02:00
Fabian Affolter
97f14015ea Use HA lat/long for the start (fixes #3971) (#8429) 2017-07-10 23:16:37 +02:00
Fabian Affolter
4fb25cf16d Fix KeyError (fixes #3721, fixes #7241) (#8428) 2017-07-10 23:15:59 +02:00
Julius Mittenzwei
e7b5c5812c Fixed link to documentation (#8424)
* Issue #8203: fixed link to documentation

* Revert URL change

* Minor changes to docstring
2017-07-10 12:11:16 +02:00
James Marsh
2ac423bd9d Do not overwrite a custom hyperion light name with the hostname of the server. (#8391)
Do not overwrite a custom name with the hostname of the hyperion server.
Correct comment in name() method.

Fixes #8390
2017-07-10 00:06:31 +02:00
Adam Mills
ec7ca9a560 Make gzips reproducible by excluding timestamp (#8420) 2017-07-09 16:21:17 -04:00
Matthew Treinish
cb298123d4 Add set_operation_mode support to generic_thermostat (#8392)
This commit adds support for the set_operation_mode system call to the
generic thermostat component. This enables users to set whether the
thermostat is enabled or not by either setting it to auto or off.
2017-07-08 09:21:10 -07:00
Andrey
c5bf4fe339 Properly handle the case when a group includes itself. (#8398)
* Properly handle the case when a group includes itself.

* Fix lint
2017-07-08 09:20:11 -07:00
Julius Mittenzwei
57c5ed33ee New component to connect to VELUX KLF 200 Interface (#8203)
* New component to connect to VELUX KLF 200 Interface

* Issue #8203: modifications as suggested by hound

* Issue #8203: added entries to .coveragerc

* moving velux/__init__p.y to velux.py

* Issue #8203: Using hass.data for storing global object, updated docstrings

* Issue #8203: validation of config, using standard approach for getting config values

* Issue #8203: Exception handling if connection to velux component fails

* Issue #8203: removed unused import

* Issue #8203: Some minor changes within docstrings

* Issue #8203: Some minor changes within docstrings

* Issue #8203: added dependency for pyvlx to requirements_all.txt

* Issue #8203: less broad exception

* Issue #8203: increased version

* Issue #8203: changed position of pyvlx within requirements_all.txt

* Issue #8203: bumped version of pyvlx to 0.1.3 (better handling of retries when token expires)

* reset pointer to home-assistant-polymer

* Issue #8203: modifications as suggested by fabaff

* hound *sigh*
2017-07-08 16:12:19 +02:00
Oliver
3be0103259 Marrantz SR5006 & SR5006 treated as AVR-X device | Fixed Mapping of Media Player and AUX input functions (#8409) 2017-07-08 16:02:59 +02:00
Andy Castille
614b5da170 Use upstream RachioPy, fix manual run switches (#8286)
* use upstream RachioPy, fix manual run switches

* Update requirements for PyPi version of rachiopy

* Use upstream RachioPy 0.1.2 (partial revert of 39c6484d89)

* Revert rachiopy downgrade
2017-07-08 11:34:34 +02:00
Fabian Affolter
acf6d4ab82 Upgrade Sphinx to 1.6.3 (#8405) 2017-07-08 11:57:24 +03:00
Adam Mills
d3acb25070 Fix CODEOWNERS z-wave team name (#8400) 2017-07-07 17:00:14 -07:00
Charles Blonde
222ad3ab6d Add new Dyson sensors (#8199)
* Add new Dyson sensors

* Add unit of measurement for dust and air quality

* Code review
2017-07-07 16:59:41 -07:00
Paulus Schoutsen
5ae2bcdbb7 Code owners (#8393)
* Add initial code owners file

* Add component author owners

* Add link to blog

* Sort

* Add setup.py

* Update CODEOWNERS
2017-07-07 11:40:04 -07:00
Anders Melchiorsen
6c9742afc4 Update aiolifx (#8396) 2017-07-07 19:57:14 +02:00
Andrey
cf924cd14d Update waqi sensor (#8385) 2017-07-07 07:55:58 -07:00
Paulus Schoutsen
f2267437df Update snips.py 2017-07-07 07:53:04 -07:00
Tom Matheussen
233920f22c Sets spotify media_type to music (#8387)
* Sets spotify media_type to music

* Removed whitespace

* Update spotify.py
2017-07-07 07:52:11 -07:00
Open Home Automation
7536e825fa LaMetric platform and notify module (#8230)
* First version of a LaMetrci platform with a Notify module

* Cleanup, fix formatting bugs

* More formatting

* Formatting

* Updated requirements

* formatting

* Formatting

* More formatting

* Dummy commit for new Travis CI run

* Refactoring class methods to instance methods

* Cleanup unused classed

* Removed Eddystone_weatherurl that had nothing to do with this component

* Cleanup class methods

* Cleanup requirements

* Removed broad excepts
Removed storage of LaMetric devices

* Removed unused import
2017-07-07 08:21:06 +02:00
Pascal Vizeli
e12a9eaadd Update avion.py (#8364)
* Update avion.py

* Update decora.py

* Update decora.py

* Update decora.py

* Update avion.py

* Update decora.py

* Update decora.py

* Update decora.py

* Update decora.py
2017-07-06 23:20:39 -07:00
Simao
fb184b4b6f Added support for upload of remote or local files to slack (#8278)
* Added support for upload of remote or local files to slack

* Checking local file with hass.config.is_allowed_path prior to posting it
2017-07-06 23:14:24 -07:00
Andy Castille
63ff173305 Use user-set device names for Linksys Smart Wi-Fi routers (3) (#8300)
* Use user-set device names for Linksys Smart Wi-Fi routers (3)

* Newline at end of linksys_smart.py

* Remove spaces in last line of linksys_smart.py

* Update linksys_smart.py
2017-07-06 23:07:12 -07:00
Diogo Gomes
903e6b5aee Upnp mapping notification (#8303)
* make port mapping optional

* dependencies + improvements

* Added bytes and packets sensors from IGD

* flake8 check

* new sensor with upnp counters

* checks

* whitespaces in blank line

* requirements update

* added sensor.upnp to .coveragerc

* downgrade miniupnpc

Latest version of miniupnpc is 2.0, but pypi only has 1.9

Fortunately it is enough

* revert to non async

miniupnpc will do network calls, so this component can’t be moved to
coroutine

* hof hof

forgot to remove import ot asyncio

* UPnP mapping overlap

Addressing: https://community.home-assistant.io/t/upnp-new-module/20839

* removed whitespaces
2017-07-06 23:05:09 -07:00
Russell Cloran
46ce26eb7a zha: Try multiple reads to get manufacturer/model (#8308)
Some devices don't seem to return the information properly when asked for
multiple attributes in one read. This separates out the reads if it didn't
work as expected the first time.

Because this data is cached in bellows, I don't expect any extra reads in
the "happy" case.
2017-07-06 23:02:22 -07:00
Russell Cloran
b1bba3675d zha light: Refresh at startup (#8310)
* zha light: Refresh at startup

* Add asyncio.coroutine annotation
2017-07-06 22:59:17 -07:00
Alex
ed5d10448e Presence detection for tp link eap225 (#8322)
* Added support for TP-Link EAP 225

* code style changes

* more code style changes

* more understandable variable name

* Added support for TP-Link EAP 225

* code style changes

* more code style changes

* more understandable variable name

* Fix pylint issue (#8325)

* Added support for TP-Link EAP 225

* code style changes

* more code style changes

* more understandable variable name

* Added support for TP-Link EAP 225

* code style changes

* Update snips.py
2017-07-06 22:52:40 -07:00
William Scanlon
652c006cbc Prevent errors on Octoprint sensors and binary_sensors when Octoprint and/or Printer are off (#8343)
* Added platformnotready

* Only log the first failure if octoprint/printer isn't up

Remove blank line
2017-07-06 22:39:11 -07:00
PhracturedBlue
b67c5df525 cover_template:i open/close/stop actions no longer required. Improve tests (#8344) 2017-07-06 22:35:59 -07:00
Matthew Schick
a7d5a8d93e Cleanup the asuswrt component (#8359)
* Get the list of wireless interfaces from nvram so tri-band routers
  work
* ARP checks don't work reliably for ap mode so remove it, associated
  list seems pretty solid
* Match on 'mac' instead of 'ip' since we can't use it for ap mode
* The `client_info_tmp` nvram reference, Asus removed it some time ago
* Update AsusWrtResult
2017-07-06 22:34:21 -07:00
Sabesto
c48c2b00a8 Modbus fixes to work with pymodbus 1.3.1 (#8365)
* Fixed a bug where changing fan speed was not possible

* Bump pymodbus version to 1.3.1 to fix issue #8285

* Changed all modbus components so that they use CONF_SLAVE from const.py

* Fix checking result from a modbus transaction

* Add missing decorator

* Added modbus write coil service and added descriptions

* Removed a hiding debug print
2017-07-06 22:30:23 -07:00
Charles Blonde
9bc5cd2d4b Add Soundtouch support for playing an HTTP url (#8370) 2017-07-06 22:28:09 -07:00
Open Home Automation
ecf3a9cb36 Implement KNX dimming functionality (#8371)
* Implement KNX dimming functionality

* Formatting

* Formatting

* Formatting
2017-07-06 22:24:25 -07:00
Marc Plano-Lesay
074e31bcf9 GTFS: check start/end date on services (#8373)
Fixes #8372
2017-07-06 22:22:31 -07:00
Open Home Automation
63cc658010 Add address-specific KNX listeners that fire events on the HASS bus (#8374)
* Add address-specific KNX listeners that fire events on the HASS bus

* Added docstring
1-byte messages will be converted from a list to the value

* Formating
2017-07-06 22:21:40 -07:00
Charles Blonde
8682f21fc5 Fix TTS options. #8375 (#8376) 2017-07-06 22:20:49 -07:00
Charles Blonde
aa28e6727d Fix Amazon Polly with non english voices. #8377 (#8378) 2017-07-06 22:19:05 -07:00
Sean
12129f0e6a Try catch around database updates in recorder. Resolves 6919 (#8349)
* Try catch around database updates in recorder. Resolves 6919

* Fixing failed test for line length

* Catch only OperationalError and retry connections before giving up

* Including alchemy exceptions in single function
2017-07-06 21:46:50 -07:00
Teemu R
8a7cfce67b Add component for xiaomi robot vacuum (switch.xiaomi_vacuum) (#7913)
* add component for xiaomi robot vacuum (switch.xiaomi_vacuum)

* enforce token length, update requirements_all.txt and .coveragerc

* bump version to avoid catching generic exception
2017-07-06 21:44:34 -07:00
mjj4791
5e71e9b826 buienradar==0.7, fix winddirection/azimuth, logging (#8281)
* buienradar==0.7, fix winddirection/azimuth, logging

* prevent multiple update cycles

* prevent multiple update cycles

* prevent multiple sensor updates for precipitation forecast

* prevent multiple sensor updates for precipitation forecast

* Update comments

* Adapted logging

* Adapted logging
2017-07-06 21:39:28 -07:00
Pierre Ståhl
db8bb53984 Add One-Time Password sensor (OTP) (#8332) 2017-07-06 21:25:54 -07:00
Craig J. Ward
692f4c293b update version (#8380) 2017-07-06 21:24:04 -07:00
John Mihalic
da37380410 Update pyHik to catch XML errors (#8384) 2017-07-06 21:23:47 -07:00
Paulus Schoutsen
fa4aa2244e Allow all panel urls (#8368)
* Allow all panel urls

* Lint
2017-07-06 20:58:21 -07:00
Michael Heinemann
c63bdd5afe Mqtt client_id fix for #8315 (#8366)
This applies what was the intended fix in #8336.

moves the fallback for setting client_id to the case when no mqtt config was provided at all. This should reflect the most common use case that fails.

This commit is a workaround and should be reverted when hbmqtt is fixed to allow empty client_id again.
2017-07-06 14:47:30 -07:00
clarkewd
20a9899354 Allow Pilight Binary Sensor to control reset_delay_sec through configuration (#8358)
* Allow Pilight Binary Sensor to control reset_delay_sec through configuration

* Define constant in platform

* Don't define constant twice
2017-07-06 21:09:31 +02:00
Johan Bloemberg
fe6a4b8ae5 Correct spelling of aliases, deprecate old config options. (#8348)
* correct spelling of aliases

* add deprecation

* Fix style.
2017-07-06 15:59:54 +02:00
Paulus Schoutsen
143044f8f1 Remove some more usage of run_in_executor (#8352)
* Remove usage of run_in_executor

* Lint
2017-07-06 14:08:32 +02:00
Fabian Affolter
d655c0e358 Upgrade aiohttp to 2.2.3 (#8363) 2017-07-06 13:56:50 +02:00
Paulus Schoutsen
46e030662d Fix pylint 1.7.2 no-else-return issues (#8361)
* Fix pylint 1.7.2 no-else-return issues

* Update tomato.py
2017-07-05 23:30:01 -07:00
Paulus Schoutsen
5779d64e98 Fix some issues for PyLint 1.7.2 (#8356)
* Fix some issues for PyLint 1.7.2

* More fixes

* Revert position change for cover
2017-07-05 20:02:16 -07:00
Lev Aronsky
83a5f932d1 Add citybikes platform (#8202)
* Initial commit - new CityBikes platform

* Several syntax fixes.

* Added imperial unit support.

* Added station list lenght validation.

* Style fixes.

* Updated requirements.

* Updated .coveragerc.

* Fixed style problems according to pylint output.

* Updated SCAN_INTERVAL value.

* Fixed station names.
Removed unnecessary calls to `slugify`.
Changed the base name to reflect the name of the bike sharing
network, instead of the more generic `citybikes`.

* Small style fix.

* Use async version of python-citybikes

* Made platform setup async.

* Made some more things async.

* Switched to constants.

* WIP: different approach to async.

* Removed python-citybikes depnedency to fix async issues.

* Removed unnecessary hidden property.

* Style fixes.

* Retry network detection.

* Style fixes, and base name usage.

* Fixes according to comments.

* Use cv.latitude instead of coercing to float.

* Updated requirements.

* Several fixes and improvements.

* Started using PlatformNotReady exception.
* Cached the networks list result to avoid unnecessary API requests.
* Switched the asyncio.timeout to use a constant.
* Refactored CityBikes API requests into a separate function

* Fixed linting errors.

* Removed unnecessary requirement.
2017-07-04 22:55:21 -07:00
Paulus Schoutsen
a12fa2e5bf Merge branch 'master' into dev 2017-07-04 21:53:35 -07:00
Paulus Schoutsen
ee37fc344b Merge pull request #8351 from home-assistant/release-0-48-1
0.48.1
2017-07-04 21:51:57 -07:00
Fabian Affolter
8cc0748db3 Temporary fix for the client_id generation (fixes #8315) (#8336)
* Temporary fix for the client_id generation (fixes #8315)

* Fix comment

* Move client id setting.

* Lint
2017-07-04 21:47:48 -07:00
Fabian Affolter
0ecceb601b Temporary fix for the client_id generation (fixes #8315) (#8336)
* Temporary fix for the client_id generation (fixes #8315)

* Fix comment

* Move client id setting.

* Lint
2017-07-04 21:47:30 -07:00
Fabian Affolter
2a1a5e53a1 Fix hass.data (fixes #8288) (#8290) 2017-07-04 21:43:15 -07:00
Paulus Schoutsen
c8b782189e Fix harmony (#8302)
* Fix harmony

* Fix 1 reference
2017-07-04 21:43:15 -07:00
Pascal Vizeli
74016c4179 Fix pathlib resolve (#8311)
* Fix pathlib resolve

* fix test
2017-07-04 21:43:15 -07:00
Adrien Ball
c30c8df449 Fix Snips json schema (#8317)
* Fix Snips json schema

* Fix test
2017-07-04 21:43:14 -07:00
Eugenio Panadero
58de661ad5 API POST has new state validation (fix for state = 0) (#8324)
* Fix validation of get new state

* Add unittest to check posting a state with zero value
2017-07-04 21:43:14 -07:00
bergemalm
f4a97db783 Fix arlo sensors. (#8333) 2017-07-04 21:43:14 -07:00
Paulus Schoutsen
b220ceec9c Update frontend 2017-07-04 21:41:22 -07:00
Paulus Schoutsen
fb796b5481 Version bump to 0.48.1 2017-07-04 21:38:48 -07:00
Pierre Ståhl
ea5bec3ef4 Add new feature to Apple TV platform (#8122)
* Lift Apple TV to pyatv 0.3.2

Update code to use basic new features.

* Support button presses in Apple TV

* Support device authentication

* Convert Apple TV to a component

A media_player platform and a remote platform will be loaded for each
manually configured or discovered device.

* Move device auth to apple_tv component

* Update requirements and coverage config

* Add scan support to apple_tv
2017-07-04 21:37:18 -07:00
Flavien Charlon
8185587100 Fix the "302" error in the UPC Connect component and remove the need to specify the router password (#8335)
* Remove the need to login on the UPC Connect component

* Remove unnecessary imports

* Update the unit tests for the UPC Connect component

* Fix the "302" error with the UPC Connect component

* Fix a flake8 error

* Update the unit tests for the UPC Connect component
2017-07-04 21:06:24 -07:00
Matthew Garrett
061a38cc3b Update Avion and Decora switches to match upstream changes (#7903)
The upstream Avion and Decora code has changed to punt retry logic out to
consumers, so update to match. As a bonus, Avion also gains support for
pulling switch configuration off the web rather than requiring manual
configuration.
2017-07-05 00:39:51 +02:00
Pascal Vizeli
23fc5e2c9f Bump dlib face_recognition to 0.2.0 (#8345)
* Update dlib_face_detect.py

* Update dlib_face_identify.py

* Update requirements_all.txt
2017-07-04 23:07:53 +02:00
Sabesto
6496c38ce6 Fix issue #8285 (#8340)
* Fixed a bug where changing fan speed was not possible

* Bump pymodbus version to 1.3.1 to fix issue #8285

* Changed all modbus components so that they use CONF_SLAVE from const.py
2017-07-04 17:01:35 +02:00
Fabian Affolter
3363b88a73 Only allow 'tls_insecure_set()' if cert is present (fixes #8329) (#8337)
Add an optional extended description…
2017-07-04 15:22:05 +02:00
Fabian Affolter
2e17d0926a Revert "Only allow 'tls_insecure_set()' if cert is present (fixes #8329)"
This reverts commit 85ac50cc77.
2017-07-04 13:46:38 +02:00
Fabian Affolter
85ac50cc77 Only allow 'tls_insecure_set()' if cert is present (fixes #8329) 2017-07-04 13:40:38 +02:00
Fabian Affolter
da61b18392 Partially revert #7931 (#8326) 2017-07-04 10:07:06 +02:00
bergemalm
8a88af20da Fix arlo sensors. (#8333) 2017-07-04 10:06:46 +02:00
John Mihalic
f8527e9773 Update pyEmby to fix media images (#8331) 2017-07-04 08:02:29 +02:00
Per Sandström
7977996c0d vsure 1.3.7 (#8321) 2017-07-04 06:26:55 +02:00
Eugenio Panadero
22681fbe08 API POST has new state validation (fix for state = 0) (#8324)
* Fix validation of get new state

* Add unittest to check posting a state with zero value
2017-07-03 23:35:57 +02:00
Fabian Affolter
1e655eea74 Fix pylint issue (#8325) 2017-07-03 22:02:43 +02:00
Adrien Ball
8d940fb585 Fix Snips json schema (#8317)
* Fix Snips json schema

* Fix test
2017-07-03 15:07:59 +02:00
Fabian Affolter
afe3dd8dbb Upgrade aiohttp to 2.2.2 (#8314)
* Upgrade aiohttp to 2.2.1

* Upgrade to aiohttp to 2.2.2
2017-07-03 13:48:53 +02:00
Fabian Affolter
bf96f28e95 Upgrade chardet to 3.0.4 (#8313) 2017-07-03 11:49:23 +02:00
Russell Cloran
5cba3085b4 zha: Strip whitespace from device names (#8306) 2017-07-03 08:31:16 +02:00
Fabian Affolter
407a419c83 Upgrade discord.py to 0.16.8 (#8304) 2017-07-03 08:30:54 +02:00
Robin
4ab778fd97 Fix doc link in header (#8305)
* Fix doc link in header

* Add missing `/`
2017-07-03 08:30:42 +02:00
Pascal Vizeli
ee7d4710c4 Fix pathlib resolve (#8311)
* Fix pathlib resolve

* fix test
2017-07-03 07:24:08 +02:00
Paulus Schoutsen
3a6434f566 Fix harmony (#8302)
* Fix harmony

* Fix 1 reference
2017-07-02 13:05:07 -07:00
Wolfgang Malgadey
a2f5b630d6 pytado moved to pypi (#8298) 2017-07-02 12:54:59 -07:00
Paulus Schoutsen
3f2fa0ed5a Disable Python 3.6-dev while it's broken 2017-07-02 11:52:24 -07:00
Robin
865865ca0f Add london_underground (#8272)
* Add tube_state

Add tube_state sensor

* Final cleanup

* Make corrections

Correct PLATFORM_SCHEMA

* Fix space

* Make test pass

* Correct format of test

Test still failing, don’t understand why

* correct description

* Make test pass

Preferred method below returns None

state = self.hass.states.get('sensor.london_overground')

* Format for hound

* indent

* Make requested changes to test, not working

Test fails with:

AssertionError: assert 0 > 0
where 0 = len([])

Surely I need tube_state.setup_platform ?

* Fixed test

Config was wrong

* Change component name to london_tube

* Update name to london_underground

Make consistent

* cleanup
2017-07-02 11:32:38 -07:00
Open Home Automation
05ced33648 Update knxip to 0.4 (better handling of reconnects) (#8289) 2017-07-02 12:59:45 +02:00
Fabian Affolter
b4165fe9f3 Fix hass.data (fixes #8288) (#8290) 2017-07-02 12:02:41 +02:00
Michaël Arnauts
47aa8c387a Update apcaccess to 0.0.13. Add "Percent Load Capacity" to INFERRED_UNITS. (#8277) 2017-07-02 11:24:07 +02:00
Paulus Schoutsen
2b94857ffd Merge branch 'master' into dev 2017-07-01 17:42:23 -07:00
Paulus Schoutsen
7461c57542 Merge pull request #8270 from home-assistant/release-0-48
0.48
2017-07-01 16:58:10 -07:00
Paulus Schoutsen
632f9a21b6 Update frontend 2017-07-01 16:53:50 -07:00
Mike Megally
da44f80b32 Create an index on the states table to help hass startup time (#8255) 2017-07-01 14:10:39 -07:00
Mike Megally
0bf5021c2c Create an index on the states table to help hass startup time (#8255) 2017-07-01 14:10:17 -07:00
Michael Fester
8fb49e8687 Snips ASR and NLU component (#8156)
* Snips ASR and NLU component

* Fix warning

* Fix warnings

* Fix lint issues

* Add tests

* Fix tabs

* Fix newline

* Fix quotes

* Fix docstrings

* Update tests

* Remove logs

* Fix lint warning

* Update API

* Fix Snips
2017-07-01 13:58:35 -07:00
Michael Fester
b82003ae08 Snips ASR and NLU component (#8156)
* Snips ASR and NLU component

* Fix warning

* Fix warnings

* Fix lint issues

* Add tests

* Fix tabs

* Fix newline

* Fix quotes

* Fix docstrings

* Update tests

* Remove logs

* Fix lint warning

* Update API

* Fix Snips
2017-07-01 13:58:12 -07:00
Will W
5f8dc8af20 components.knx - KNXMultiAddressDevice corrections (#8275)
1. The has_attributes was comparing names to addresses
2. Some errors outside of an except block were using
_LOGGER.except. This will cause an exception itself because there is no
trance context available to the logger
3. Added alias names for the address and state addresses so that they
can be accessed with the same
4. Added return values for the set_int_value and set_percentage methods
to allow error checking similar to the set_value method
5. Added the name of the configured object to the log messages to make
them more meaningful (otherwise multiple similar log messages are
received without any hint as to the target device)
2017-07-01 13:31:01 -07:00
Will W
c13fdd23c1 components.knx - KNXMultiAddressDevice corrections (#8275)
1. The has_attributes was comparing names to addresses
2. Some errors outside of an except block were using
_LOGGER.except. This will cause an exception itself because there is no
trance context available to the logger
3. Added alias names for the address and state addresses so that they
can be accessed with the same
4. Added return values for the set_int_value and set_percentage methods
to allow error checking similar to the set_value method
5. Added the name of the configured object to the log messages to make
them more meaningful (otherwise multiple similar log messages are
received without any hint as to the target device)
2017-07-01 13:30:39 -07:00
Fabian Affolter
e6e0e5263a Don't call update() in constructor (#8276) 2017-07-01 16:14:18 +02:00
Fabian Affolter
0981956caa Upgrade pyowm to 2.7.1 (#8274) 2017-07-01 12:53:29 +02:00
lrmate
d267fc608f Update modbus.py (#8256)
* Update modbus.py

Prevents Modbus binary sensors showing up as "unnamed_device".
Originally proposed here https://community.home-assistant.io/t/modbus-sensor/6751/11 by user Pjeter

* Update modbus.py
2017-06-30 23:56:46 -07:00
lrmate
e077998d38 Update modbus.py (#8256)
* Update modbus.py

Prevents Modbus binary sensors showing up as "unnamed_device".
Originally proposed here https://community.home-assistant.io/t/modbus-sensor/6751/11 by user Pjeter

* Update modbus.py
2017-06-30 23:32:10 -07:00
Paulus Schoutsen
d3bc8519c0 Update frontend 2017-06-30 22:34:55 -07:00
viswa-swami
d3adc6ddfb Camera services arm disarm including Netgear Arlo (#7961)
* Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type.

* Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type.

* Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type.

* Fixed the spaces and indentation related issues that houndci found

* Fixed the spaces and indentation related issues that houndci found

* Missed the const file which has the macros defined.

* Fixed the CI build error

* Fixed the CI build error because of unused variable in exception case

* Updating the arlo code based on comment from @balloob. Changed the arm and disarm to enable_motion_detection and disable_motion_detection respectively. Similarly fixed the AttributeError handling. Added dummy code to the demo camera also. Moved out the definitions in const.py into the camera __init__ file

* Fixed the comments posted by houndci-bot

* Fixed the comments posted by houndci-bot

* Fixed the comments posted by houndci-bot

* Fixed the comments posted by travis-ci integration bot

* Fixed the comments posted by travis-ci integration bot

* Fixed the comments posted by travis-ci integration bot for demo.py: expected 2 lines, found 1

* Updated code in camera __init__.py to use the get function instead of directly calling the member in the structure.

* Updated code in camera __init__.py

* Posting the updated code for PR based on @balloob's suggestions/recommendations

* Removed the arlo reference from demo code. Copy-paste error

* Removed the unused import found by hound bot

* Expected 2 lines before function, but found only 1.

* Based on @balloob's comments, moved these constants to the camera/arlo.py

* Added test_demo.py to test the motion enabled and motion disabled in camera component

* Fixing issues found by houndci-bot

* Fixing issues found by houndci-bot

* Fixing the code as per @balloob's suggestions

* Fixing the code as per @balloob's suggestions

* Fixing the test_demo failure. Tried to rewrite a base function to enable the motion in __init__.py and missed to add it to as a job.

* Fixing the hound bot comment

* Update arlo.py

* Update arlo.py
2017-06-30 22:24:36 -07:00
Josh
a3f586d097 Adding done_message to alert (#8116)
* Adding done_message to alert

Adding an optional entry to the config that will send a notification when an
alarm goes from on to off.

* Update test_alert.py

* Update test_alert.py
2017-06-30 22:24:36 -07:00
Paulus Schoutsen
f8c7fd212f Revert "Make Android app shortcut use 'Home Assistant' as name." (#8271)
* Revert "Version bump to 0.49.0.dev0 (#8266)"

This reverts commit 8e4394f173.

* Revert "Adding done_message to alert (#8116)"

This reverts commit 5e56bc7464.

* Revert "Camera services arm disarm including Netgear Arlo (#7961)"

This reverts commit ed20f7e359.

* Revert "Make Android app shortcut use 'Home Assistant' as name instead of just 'Assistant'. (#8261)"

This reverts commit 0bcb7839fb.
2017-06-30 22:24:36 -07:00
Paulus Schoutsen
b1f3492fd0 Notify.smtp: default to STARTTLS 2017-06-30 22:15:41 -07:00
Paulus Schoutsen
7123ec14be Revert "Make Android app shortcut use 'Home Assistant' as name." (#8271)
* Revert "Version bump to 0.49.0.dev0 (#8266)"

This reverts commit 8e4394f173.

* Revert "Adding done_message to alert (#8116)"

This reverts commit 5e56bc7464.

* Revert "Camera services arm disarm including Netgear Arlo (#7961)"

This reverts commit ed20f7e359.

* Revert "Make Android app shortcut use 'Home Assistant' as name instead of just 'Assistant'. (#8261)"

This reverts commit 0bcb7839fb.
2017-06-30 21:57:38 -07:00
Fabian Affolter
8e4394f173 Version bump to 0.49.0.dev0 (#8266) 2017-06-30 21:07:50 -07:00
Josh
5e56bc7464 Adding done_message to alert (#8116)
* Adding done_message to alert

Adding an optional entry to the config that will send a notification when an
alarm goes from on to off.

* Update test_alert.py

* Update test_alert.py
2017-06-30 21:07:12 -07:00
viswa-swami
ed20f7e359 Camera services arm disarm including Netgear Arlo (#7961)
* Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type.

* Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type.

* Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type.

* Fixed the spaces and indentation related issues that houndci found

* Fixed the spaces and indentation related issues that houndci found

* Missed the const file which has the macros defined.

* Fixed the CI build error

* Fixed the CI build error because of unused variable in exception case

* Updating the arlo code based on comment from @balloob. Changed the arm and disarm to enable_motion_detection and disable_motion_detection respectively. Similarly fixed the AttributeError handling. Added dummy code to the demo camera also. Moved out the definitions in const.py into the camera __init__ file

* Fixed the comments posted by houndci-bot

* Fixed the comments posted by houndci-bot

* Fixed the comments posted by houndci-bot

* Fixed the comments posted by travis-ci integration bot

* Fixed the comments posted by travis-ci integration bot

* Fixed the comments posted by travis-ci integration bot for demo.py: expected 2 lines, found 1

* Updated code in camera __init__.py to use the get function instead of directly calling the member in the structure.

* Updated code in camera __init__.py

* Posting the updated code for PR based on @balloob's suggestions/recommendations

* Removed the arlo reference from demo code. Copy-paste error

* Removed the unused import found by hound bot

* Expected 2 lines before function, but found only 1.

* Based on @balloob's comments, moved these constants to the camera/arlo.py

* Added test_demo.py to test the motion enabled and motion disabled in camera component

* Fixing issues found by houndci-bot

* Fixing issues found by houndci-bot

* Fixing the code as per @balloob's suggestions

* Fixing the code as per @balloob's suggestions

* Fixing the test_demo failure. Tried to rewrite a base function to enable the motion in __init__.py and missed to add it to as a job.

* Fixing the hound bot comment

* Update arlo.py

* Update arlo.py
2017-06-30 21:06:56 -07:00
Fabian Affolter
74acc5cf41 Merge branch 'master' into dev 2017-06-30 18:56:26 +02:00
Michaël Arnauts
0bcb7839fb Make Android app shortcut use 'Home Assistant' as name instead of just 'Assistant'. (#8261) 2017-06-30 18:51:07 +02:00
PhracturedBlue
17237e9d3f Implement templates for covers (#8100)
* Implement templates for covers

* Fix a few remaining pylint warnings

* Fix hound line-length warnings

* Fix one more hound line-length warning

* Fix quadruple-quotes an line length code-quality issues

* Irrelevant change to retrigger travis due to timeout

* Use volutuous Exclusive to check for mutex condition

* Fix incorrect state check
2017-06-30 08:24:29 -07:00
Michaël Arnauts
a663dbada0 Docker cleanup. (#8226) 2017-06-30 08:07:33 -07:00
Fabian Affolter
96e1d5524a Upgrade libnacl to 1.5.1 (#8259) 2017-06-30 11:12:21 +02:00
JudgeDredd
33fd2250fd further document add_node_secure (#8229)
added documentation to *attempt* explanation that add_node_secure will also function for adding unsecure nodes.
2017-06-30 10:00:38 +03:00
Per Sandström
31f17a91e6 verisure component names (#8251) 2017-06-30 08:53:14 +02:00
Andrey
d0720ac699 Add PlatformNotReady support for Sensibo (#8252) 2017-06-30 08:50:25 +02:00
Fabian Affolter
05acf1c10a Use constant and update ordering (#8246) 2017-06-30 08:46:22 +02:00
Fabian Affolter
27c92937f2 Use 'hass.data' instead of global (#8245) 2017-06-30 08:46:03 +02:00
Anders Melchiorsen
a328df6014 LIFX: Small code cleanups (#8228) 2017-06-30 02:10:28 +02:00
Eugenio Panadero
1fb4eefc2c better logging to debug when a message is not sent (#8248) 2017-06-29 21:13:46 +02:00
Fabian Affolter
0f12b4c955 Do not call update() in constructor (#8247)
Add an optional extended description…
2017-06-29 16:21:29 +02:00
Fabian Affolter
a9f14b67a8 Update docstrings (#8244) 2017-06-29 11:44:35 +02:00
Eugenio Panadero
445065700c update i2csense requirement (#8242) 2017-06-29 11:03:52 +02:00
Fabian Affolter
4bd96fd437 Upgrade python-digitalocean to 1.12 (#8241) 2017-06-29 10:52:12 +02:00
Michaël Arnauts
5dde0c2201 Comfoconnect fan component (#8073)
* Comfoconnect fan component.

* Fix linter. Don't store hass object when not needed.

* More code style.

* Rebase to dev and add to coverage ignore list.

* Use published package from pypi.
2017-06-28 18:04:54 +02:00
Open Home Automation
6846a76c46 KNX Cover tilt control (#8159)
* Added invert flag for position for actuators that uses 100% for fully closed position

* Implementation of tilt functionality

* Bugfix check tilt

* Formatting

* Formatting fixes

* Formatting

* Bugfix set_tilt

* Minor modifications in configuration section

* Formatting

* Update knx.py
2017-06-28 14:08:07 +02:00
Fabian Affolter
fa6e93f0c7 Do not call update() in constructor (#8148)
* Do not call update() in constructor

* Move handling to update and re-add throttle

* Fix indent

* Fix interval
2017-06-27 10:56:25 +02:00
Paulus Schoutsen
5ef274adce Cleanup automations yaml (#8223) 2017-06-27 10:36:26 +02:00
Eugenio Panadero
e39f7d3ef5 Fix homeassistant.start trigger (#8220)
* Fix homeassistant.start trigger

* ooops

* set sleep(0) just before changing to running state, revert async_block_till_done changes
2017-06-27 10:36:00 +02:00
Will W
88b9503962 add percentage (DPT_Scaling) KNX sensors (#8168)
* add percentage (DPT_Scaling) KNX sensors

1. moved basic functionality to KNXSensorBaseClass instead of
KNXSensorFloatClass
2. added "if" clause in setup for a "percentage" sensor type and added KNXSensorDPTScalingClass

* support-knx-percentage-sensor: lint correction

Updated convert method base sensor class to avoid lint warning
(R201 - Method could be a function)

* added PLATFORM_SCHEMA for configuration

1. added SCHEMA extension for defined keywords
2. moved fixed data for internal settings out of sensor logic
3. moved everything into standard KNXSensor object
4. added parsing of extra config parameters in __init__

* correct lint errors on support-knx-percentage-sensor
2017-06-26 22:25:54 -07:00
Eugenio Panadero
596093d564 telegram_bot platform to only send messages (#8186)
* add new telegram_bot platform to only send messages

* Fix async
2017-06-26 22:22:33 -07:00
natemason
23400c4b0a Fixed mqtt subscription filter on sys $ topics (#8166)
* Fixed mqtt subscription filter on sys $ topics

* fixed linting issue

* added unit tests for $ topics and changed fix to use re.escape

* merge upstream/dev mqtt unit tests

* Update test_init.py
2017-06-26 22:17:55 -07:00
Anders Melchiorsen
af54311718 LIFX: Move light effects to external library (#8222)
* LIFX: Move light effects to external library

This moves the LIFX light effects to the external library aiolifx_effects.

To get the light state synchronized between that library and HA, the LIFX
platform no longer maintains the light state itself. Instead, it uses the
cached state that aiolifx maintains.

The reorganization also includes the addition of a cleanup handler.

* Fix style
2017-06-26 22:05:32 -07:00
Pascal Vizeli
442dcd584b Improve executor pool size / speedup python 3.5 (#8215)
* Improve executor pool size / speedup python36

* fix style

* Add comment
2017-06-26 18:18:42 -07:00
Eugenio Panadero
1e4aec63ed guess the content_type in local_file cameras (#8217)
* guess the content_type in local_file cameras

* add unittest to check content_type of local_file cameras
2017-06-26 22:36:35 +02:00
Per Sandström
80c187f8ea WIP: Verisure app api (#7394)
update to verisure app api
2017-06-26 22:30:25 +02:00
Paulus Schoutsen
d73b695e73 EntityComponent to retry platforms that are not ready yet (#8209)
* Add PlatformNotReady Exception

* lint

* Remove cap, adjust algorithm
2017-06-26 09:41:48 -07:00
Adam Baxter
f02d169864 Fix Plex component to use port number in discovery. (#8197)
* Fix Plex component to use port number in discovery.

* Break line

* Correctly save port to config

* Handle port with fewer code changes

* This is stuck configuring and I'm not sure why

* Changes suggested by @dale3h
2017-06-25 18:06:15 -05:00
Pascal Vizeli
2dd7f0616e Add security layer to send file output things (#8189)
* Add security layer to send file output things

* Make telegram secure

* fix lint

* fix handling

* invert check

* resolve relative paths

* add test for relative paths

* fix lint

* fix tests

* Address paulus comments

* fix style

* fix tests

* Add more tests

* fix tests

* fix tests

* fix test p2

* fix lint

* fix tests

* Make it available for windows

* Change name / address comments

* fix set

* fix test

* fix tests

* fix test

* fix lint
2017-06-26 00:10:30 +02:00
Wim Haanstra
2f2952e0ec Openhardwaremonitor (#8056)
* Open Hardware Monitor sensor

Platform which is able to connect to the JSON API of Open Hardware Monitor and adds sensors for the devices.

* Remove copyright in header, not needed.

* - Removed old code
- Fixed typo’s in comments
- Removed log spamming
- Removed code that was unnecessary
- Use requests instead of urllib
- Moved sensor update functionality to data handler, to remove unwanted constructor parameters

* Fixed typo in comment
Added tests

* Added default fixture, to stabilize tests

* - Fix for values deeper than 4 levels, no longer relies on fixed level
- Fixed tests

* Removed timer in preference of helper methods

* Moved update functionality back to Entity….
Updated SCAN INTERVAL

* Added timeout to request
Removed retry when Open Hardware Monitor API is not reachable
Fixed naming of sensors
Flow optimalisations
Fixed tests to use states

* Remove unused import
2017-06-25 13:48:05 -07:00
Adam Mills
8358542ce0 Remove unnecessary thread_ident assignment (#8194)
* Remove mocking of _thread_ident

* Re-add run_loop thread_ident assignment
2017-06-25 16:39:05 -04:00
Eugenio Panadero
4ca5ed25bc add option to set content_type in camera.generic to support 'svg cameras' (#8188)
* add custom content_type to support 'generic svg cameras'

* add unittest to check content_type for svg generic camera

* Tweak tests
2017-06-25 12:25:14 -07:00
Paulus Schoutsen
7bf6ceafec Split mock_service (#8198) 2017-06-25 10:53:15 -07:00
Paulus Schoutsen
1cfed4f015 Fix plants calling async methods from sync context (#8200) 2017-06-25 10:07:28 -07:00
Paulus Schoutsen
a082ffca1d Fix MySensors climate (#8193) 2017-06-24 18:11:34 -07:00
Oliver
1b563b0640 Pushed to version 0.5.1 of the library (#8190) 2017-06-24 12:14:57 -07:00
Adam Mills
1fe189e9cb Switch to new zwave entity ids by default (#8192) 2017-06-24 15:01:57 -04:00
Marc Plano-Lesay
edeb92ea42 Add offset option to sensor.gtfs (#7980)
* Add offset option to sensor.gtfs

* Fix long lines in sensor.gtfs

* Expose GTFS offset as an attribute
2017-06-24 17:45:14 +02:00
Alex Mekkering
c1095665e9 added optional node_id to MQTT discovery (#8096) 2017-06-24 00:46:41 -07:00
Kane610
2a1f8af10a Axis service vapix call (#7794)
* Initial commit for an Axis service to do Vapix calls to device

* Added check to see if metadatastream initiated properly

* Make sure to configure the correct IP address when setting up registered devices on system start

* Manage reconnection when device is discovered with a different IP

* Cleaned up setting new IP

* Better naming of event for new IP

* New version of dependency axis

* Fix flake8 failing

* Break out service default strings to constants

* Use the dispatcher and not the core event bus for internal communication
2017-06-24 00:14:57 -07:00
Bas Schipper
6234f2d73f Added buienradar precipitation forecast average & total sensors (#8171)
* Added precipitation forecast average & total sensors

* Fixed some code style issues

* Fixed some code style issues

* Minor fix default timeframe

* Update buienradar.py

* Update buienradar.py
2017-06-24 00:12:52 -07:00
Paulus Schoutsen
b488663f2c Update Dockerfile 2017-06-23 23:13:38 -07:00
Sean Dague
a55d8776ff Throw exception if _convert_for_display called on non Number (#8178)
In trying to come up for some reason behind issue #6365 (which only
happens on some platforms) the best guess is that some components are
managing to get a string value all the way up to the Polymer UI for
temperature, which then an increment of +0.5 is treating as a string
concat operation instead of addition. So 20 + 0.5 becomes 200.5 hits
the max thermostat value.

This will throw an exception if the climate temp value isn't a
number. That's going to turn a soft fail into a hard fail on
potentially a number of platforms. Mysensors is one of the platforms
that was reported as having the issue. So put some explicit float
casts where that might be coming from as well.
2017-06-23 23:03:37 -07:00
Ryan Nowakowski
5ceb4c404d Fix radiotherm model CT50 (#8181)
Model CT50 has an "Auto" mode.  When mode is set to auto we need to ask
what the current state is: cool or heat.  Then we can query the
appropriate target temperature.

Without this fix, the target temperature shows up blank in the UI and
setting the mode fails.
2017-06-23 22:53:10 -07:00
lrmate
0061cece0c Update buienradar.py (#8173)
Swapped unit of measurement 'winddirection' vs 'windazimuth'
2017-06-23 22:51:45 -07:00
Morten Lied Johansen
0099168ff8 Add device tracker for Linksys Smart Wifi devices (#8144)
* Add device tracker for Linksys Smart Wifi devices

* Fixing code style
2017-06-23 22:36:04 -07:00
Paulus Schoutsen
87c89752ab Revert "Add libboost-python1.62-dev (fixes #7851)" (#8182)
* Revert "Uninstall enum34 in python3.6 docker image (#8103)"

This reverts commit 45f6f4443a.

* Revert "Add libboost-python1.62-dev (fixes #7851) (#7868)"

This reverts commit f1290d3135.
2017-06-23 22:33:33 -07:00
Jean Regisser
45f6f4443a Uninstall enum34 in python3.6 docker image (#8103)
* Uninstall enum34 in python3.6 docker image

This is a short term fix for #7733

What's happening is the following dependencies are pulling enum34:
- pygatt
- libsoundtouch
- yeelight
However, enum34 is not meant to be installed in Python versions 3.4+
and causing the `AttributeError: module 'enum' has no attribute 'IntFlag'``

I've submitted patches to these projects so we don't have to do this
manual uninstall in the future.

* Update Dockerfile
2017-06-23 22:29:39 -07:00
Fabian Affolter
f1290d3135 Add libboost-python1.62-dev (fixes #7851) (#7868) 2017-06-23 22:16:19 -07:00
Omar Usman
746aae51ec Add ClickSend notify service. (#8135)
* Add ClickSend notify service.

* PR #8135 changes.

- Some code spacing fixes.
- Add timeout to requests.
- Change doc url.
- Use const.py as much as possible.
- Check credentials to determine if setup fails or not.
- Add docstrings.
- Use string formatting.

* PR #8135 changes.

- Remove unused variables.
- Continuation line under-indented for visual indent.

* PR #8135 changes.

- Format code based on PEP8.

* PR #8135 changes.

- Remove unused base64 dependency.

* PR #8135 changes.

- Fix: D205: 1 blank line required between summary line and description (found 0)
- Fix: standard import "import json" comes before "import requests"

* PR #8135 changes.

- Add files to .coveragerc

* Remove obvious comments and set constant
2017-06-23 22:51:41 +02:00
Wolfgang Malgadey
da9430ed12 Tado climate device (#8041)
* added default parameter

* zone overlay can be set with or without a temperature and with or without a duration. Duration is not supported by hass

* Fixes issue #7059 with missing sensorDataPoints

* Fixes issue #6943 added ac_mode

* ac_mode cases
* added fan modes
* changed handling of device state OFF

* fixed an error initializing a dictionary (#6943)

* changed pytado version

* activated pytado debugging

* Changed pyTado version

* mytado.com changed authentication challenge

* Fixed linelength and whitespace issues

* requirements to pytado changed
2017-06-23 18:45:44 +02:00
Tim Wilde
bef22076ea Use version 1.3 of radiotherm (#8164)
Add an optional extended description…
2017-06-23 11:08:23 +02:00
Bas Schipper
fe93b51017 Fixed rfxtrx binary_sensor off command (#8160)
* Fixed applying rfxtrx binary off command

* Fixed some deprecation issues
2017-06-22 23:00:44 +02:00
Eugenio Panadero
07293e8d1e add telegram_bot service: delete_message (#8153)
* add telegram_bot service: delete_message

* better validating for `last` message_id option
2017-06-22 15:03:11 +02:00
Open Home Automation
ca71d34076 Added invert flag for position for actuators that uses 100% for fully closed position (#8147) 2017-06-22 13:42:13 +02:00
Anton Lundin
548417761e ubus: Refresh session on Access denied (#8111)
When a openwrt router reboots, all the session ids gets invalidated.
In that case we need to log in again and get a new session id.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-06-22 13:34:57 +02:00
Andrey
7b8ad1d365 Switch rachiopy to pypi (#8040)
* Switch rachiopy t pypi

* Update rachio.py

* Update requirements_all.txt
2017-06-22 13:34:00 +02:00
Fabian Affolter
61cb6ec3dc Upgrade libsoundtouch to 0.6.2 (#8149) 2017-06-22 13:27:42 +02:00
Fabian Affolter
349746f5f2 Upgrade python-telegram-bot to 6.1.0 (#8151) 2017-06-22 13:27:02 +02:00
Oliver
2e3b279873 Add support of Zone2 and Zone3 (#8025)
* Add support of Zone2 and Zone3

* Changes from balloobs feedback
2017-06-21 22:54:10 -07:00
Yannick POLLART
f26861976d Rfxtrx binary sensor (#6794)
* Added rfxtrx binary sensors to a new branch

* binary_sensor/rfxtrx: added support for automatic_add

* Fixed pylint warnings

* off_delay is set wit clearer time specifiers (cv.time_period)

* fire_event config attribute is now supported by rfxtrx binary sensors.

* Cosmetic ordering

* Fix lint errors for PR requirements.

* Fixed indents, line length and comment problems.

* Yet another line too long fix...

* Using existing attributes and config constants.

* Cosmetic fix (ATTR_DATABITS -> ATTR_DATA_BITS)

* Removed unused attribute

* FIX masked device id logging message

* FIX line too long

* FIX trailing white space

* FIX: rfxtrx binary_sensor manages its own devices only.

* Added a basic config helper for pt2262 devices

* Make pylint happy

* Fixed most houndci-bot-detected issues

* Fix TOX complaint about blank line after function docstring

* Fix data bit value calculation

* Fixed line too long

* Removed unnecessary code.

* remove trailing whitespace

* Added hass property to device object.
2017-06-21 22:48:45 -07:00
Anthony Hughes
6bfeac7f80 Harmony auto discovery via netdisco (#7741)
* Use netdisco to automatically discover harmony hubs.

* Allow some settings in configuration.yml to override even on discovered hubs.

* Global is not required as no assignment on variable

* Use `set` instead of list for perf

* Store cache of discovered devices against `hass.data` rather than in global

* Handle case if the device cache is empty

* Fix indentation issue
2017-06-21 22:43:35 -07:00
Miha Lunar
a95fe588ca LimitlessLED: Configurable fade-out behavior (#7369)
* Configurable fade-out behavior

Adds a per-group "fade" option with values of "out" (default) or "none".
By default, the lights are faded out when turned off, but this can cause usability issues when manually switching wall switches, since the bulbs turn back on at minimum brightness.

* Changed fade value from enum to boolean

* No need to fall back to default since voluptuous takes care of that.
2017-06-21 22:22:24 -07:00
Eugenio Panadero
e5d11dd1a5 Add new BH1750 light level sensor (#8050)
* new sensor platform
* requirements_all and .coveragerc update
2017-06-22 07:09:08 +02:00
Eugenio Panadero
435e5c8a91 Add I2c HTU21D temperature and humidity sensor for Raspberry Pi (#8049)
* Add new HTU21D temperature and humidity sensor

* new sensor platform
* requirements_all and .coveragerc update

* fix lint

* review changes: move sensor code to external module

* remove debug log msg

* add i2csense to COMMENT_REQUIREMENTS, require i2csense 0.0.3

* Add new HTU21D temperature and humidity sensor

* new sensor platform
* requirements_all and .coveragerc update

* fix lint

* review changes: move sensor code to external module

* remove debug log msg

* add i2csense to COMMENT_REQUIREMENTS, require i2csense 0.0.3

* change style for hass

* fix requirements
2017-06-22 07:05:58 +02:00
Jose Juan Montes
8d0553d9e6 Adds CPU temp monitoring, and allow startup when endpoint is not yet available. (#8093)
* Adds CPU temp monitoring, and allow startup when endpoint is not yet available.

* Added support for available() to glances sensor.
2017-06-21 22:45:15 +02:00
Charles Blonde
9a239d1afb Upgrade libsoundtouch to prevent Python3.6 errors with enum. #7733 #8103 (#8143) 2017-06-21 22:20:30 +02:00
Paulus Schoutsen
9252854f99 Merge pull request #8141 from home-assistant/release-0-47-1
0.47.1
2017-06-21 09:24:12 -07:00
Paulus Schoutsen
8d76e2679d Allow iteration in python_script (#8134)
* Allow iteration in python_script

* Add tests
2017-06-21 09:09:08 -07:00
Alan Fischer
4b1dcad7ae Fixed iTach command parsing with empty data (#8104)
* Fixed iTach command parsing with empty data

* Switched to using format
2017-06-21 09:09:08 -07:00
Phil Hawthorne
b45c386fd6 Update InfluxDB to handle datetime objects and multiple decimal points (#8080)
* Update InfluxDB to handle datetime objects

Updates the InfluxDB regex to ignore datetime objects being coverted
into float values.

Adds tests to the component to ensure datetime objects are corectly
handled.

* Fix Hound errors

Fixes errors from Hound bot

* Update InfluxDB to handle multiple decimal points

Changes the way InfluxDB handles values such as 1.2.3.4 to be 1.234 so
it stores in InfluxDB as a valid float value

* Fix lint issues

Reduce the size of a line for the linter

* Update InfluxDB to pass on unknown variable

If we get an error trying to convert a variable to a float, let's ignore
it completely

* Make InfluxDB Regex constants

Makes the Regex's used by InfluxDB constants so they don't need to be
compiled each time

* cleanup

* fix lint

* Update regex

* fix tests

* Fix JSON body missing new line character

* fix exceptions
2017-06-21 09:09:08 -07:00
Charles Blonde
cb5fa79835 Fix Dyson async_add_job (#8113) 2017-06-21 09:09:08 -07:00
Tsvi Mostovicz
b74217bec2 Fix lights issue #8098 (#8101)
* Fix lights issue #8098

* Don't check self._color to decide whether to calll get_color()

self._color is None on init, so get_color() will never be called.
2017-06-21 09:09:08 -07:00
Paulus Schoutsen
fcf60e740d Version bump to 0.47.1 2017-06-21 09:08:20 -07:00
Eugenio Panadero
bb05600010 Add I2c BME280 temperature, humidity and pressure sensor for Raspberry Pi (#7989)
* Add new BME280 temperature, humidity and pressure sensor

* Add BME280 sensor to optional requirements and .coveragerc

* move validation to sensor handler, async fix in setup

* fix Invalid attribute name

* review changes: move sensor code to external module

* async fix

* add i2csense to COMMENT_REQUIREMENTS, require i2csense 0.0.3, round prec to 1 dec

* change style for hass

* fix lint

* fix lint part 2
2017-06-21 17:24:39 +02:00
Thibault Cohen
d3bb6d3988 Decora light: Fix brightness level in UI (#8139) 2017-06-21 16:37:27 +02:00
Thibault Cohen
f3945147a4 Add current balance to hydroquebec sensor (#8138) 2017-06-21 16:36:20 +02:00
Paulus Schoutsen
6398e92836 Allow iteration in python_script (#8134)
* Allow iteration in python_script

* Add tests
2017-06-21 13:32:50 +02:00
Steven Conaway
4d2b79156d Change Error Message when Turning off ISY994 Light (#8131) 2017-06-21 09:38:12 +02:00
Fabian Affolter
b6d335f993 Do not call update() in constructor (#8120) 2017-06-21 09:35:44 +02:00
lunar-consultancy
4b82c34b8f Added RFXTRX UV badge (#8129) 2017-06-21 08:55:51 +02:00
Paulus Schoutsen
66fc852363 Update frontend 2017-06-20 21:10:53 -07:00
Paulus Schoutsen
87274879a8 Upgrade RestrictedPython dependency (#8132) 2017-06-20 19:30:01 -07:00
Fabian Affolter
e4dbf8033c Upgrade aiohttp to 2.2.0 (#8121) 2017-06-21 00:35:49 +02:00
Fabian Affolter
43db94d62d Upgrade sqlalchemy to 1.1.11 (#8124) 2017-06-21 00:32:49 +02:00
Fabian Affolter
6d5fca2db1 Upgrade paho-mqtt to 1.3.0 (#8125) 2017-06-21 00:32:04 +02:00
Fabian Affolter
d5e55448ef Upgrade mutagen to 1.38 (#8126) 2017-06-21 00:29:35 +02:00
Alan Fischer
4ad998378f Fixed iTach command parsing with empty data (#8104)
* Fixed iTach command parsing with empty data

* Switched to using format
2017-06-20 15:26:18 +02:00
Fabian Affolter
d46607c0d0 Add option to specify the location of the API (fixes #8115) (#8118) 2017-06-20 14:09:54 +02:00
Luar Roji
04920fa0bf Only mark active DHCP clients as present (#8110)
We only want to know which of the DHCP clients are indeed active.

For example: I've a table of static DHCP leases with most of the IPs of my network, so this module is always detecting them as present. With my patch only the active ones will be detected as present.

I already mentioned here: https://github.com/home-assistant/home-assistant/pull/7366#issuecomment-302950139
2017-06-20 12:16:56 +02:00
Fabian Affolter
1928da1fae Remove config details (see docs) (#8119) 2017-06-20 12:09:42 +02:00
Phil Hawthorne
06b051c53d Update InfluxDB to handle datetime objects and multiple decimal points (#8080)
* Update InfluxDB to handle datetime objects

Updates the InfluxDB regex to ignore datetime objects being coverted
into float values.

Adds tests to the component to ensure datetime objects are corectly
handled.

* Fix Hound errors

Fixes errors from Hound bot

* Update InfluxDB to handle multiple decimal points

Changes the way InfluxDB handles values such as 1.2.3.4 to be 1.234 so
it stores in InfluxDB as a valid float value

* Fix lint issues

Reduce the size of a line for the linter

* Update InfluxDB to pass on unknown variable

If we get an error trying to convert a variable to a float, let's ignore
it completely

* Make InfluxDB Regex constants

Makes the Regex's used by InfluxDB constants so they don't need to be
compiled each time

* cleanup

* fix lint

* Update regex

* fix tests

* Fix JSON body missing new line character

* fix exceptions
2017-06-20 07:53:13 +02:00
Charles Blonde
473d765bb9 Fix Dyson async_add_job (#8113) 2017-06-19 23:50:27 +02:00
sn0oz
8e34c27b63 Added SMTP SSL/TLS support (#7960)
* Added SMTP SSL/TLS support

* added new encryption option

* validation of encryption option

* Fix lint issues

* Rename var
2017-06-19 14:19:31 +02:00
Eugenio Panadero
77aa2e940d increase timeout for setWebhook to 10s (#8102)
Add an optional extended description…
2017-06-19 12:03:58 +02:00
Tsvi Mostovicz
3bbaf37193 Fix lights issue #8098 (#8101)
* Fix lights issue #8098

* Don't check self._color to decide whether to calll get_color()

self._color is None on init, so get_color() will never be called.
2017-06-19 09:54:13 +02:00
Andrey
b2d6ff9783 More updates to zwave services.yaml file (#8083) 2017-06-18 22:38:14 -07:00
Will W
4fdde4f0e2 add knx cover support (#7997)
* add knx cover

also corrected bugs in device config

1. overwriting of addresses in KNXMultiAddressDevice
2. setting and getting int values
3. added percentage scaling

* Update __init__.py
2017-06-18 22:30:39 -07:00
Jeff Wilson
756768e745 Add support for Insteon FanLinc fan (#6959)
* Add support for Insteon FanLinc fan

* Upgrade insteonlocal dependency to 0.49

* Lint/flake fixes

* Remove configurator

* Make Hound fixes

* Revert "Make Hound fixes" and "Remove configurator"

This reverts commit 04d1f7fdb1.
This reverts commit 7b8278d7cf.
2017-06-18 21:43:10 -07:00
Diogo Gomes
83b791489b Upnp properties (#8067)
* make port mapping optional

* dependencies + improvements

* Added bytes and packets sensors from IGD

* flake8 check

* new sensor with upnp counters

* checks

* whitespaces in blank line

* requirements update

* added sensor.upnp to .coveragerc

* downgrade miniupnpc

Latest version of miniupnpc is 2.0, but pypi only has 1.9

Fortunately it is enough

* revert to non async

miniupnpc will do network calls, so this component can’t be moved to
coroutine

* hof hof

forgot to remove import ot asyncio
2017-06-18 21:32:39 -07:00
Eugenio Panadero
35132f9836 media player Kodi: handle TransportError exceptions when calling JSONRPC API methods (#8047)
* handle TransportError exceptions when calling JSONRPC API

* use double quotes for log messages; show TransportErrors as in async_ws_connect

* fix spaces around keyword / parameter

* fix logging message

* review changes
2017-06-18 23:00:02 +02:00
Paulus Schoutsen
0e08785373 Update frontend 2017-06-18 11:37:15 -07:00
Per Osbäck
bf0dbdfd6a update pywebpush to 1.0.5 (#8084) 2017-06-18 10:51:37 -07:00
Michaël Arnauts
04407b8623 Cleanup .coveragerc (#8088) 2017-06-18 10:50:35 -07:00
Michael Auchter
fb0ee34f10 mpd: implement support for seek, shuffle, and clear playlist (#8090)
* mpd: add shuffle and clear_playlist support

* mpd: implement seek
2017-06-18 18:31:45 +02:00
Myles Eftos
ef63cfe8e4 Stopping the logfile spam by piping STDERR to /dev/null (#8081) 2017-06-18 11:44:41 +02:00
Paulus Schoutsen
e40f72e773 Merge branch 'master' into dev 2017-06-17 12:13:59 -07:00
Paulus Schoutsen
cec8ccb1a4 Version bump to 0.48.0.dev0 2017-06-17 12:13:46 -07:00
Paulus Schoutsen
9b1ed4e79b Merge pull request #8055 from home-assistant/release-0-47
0.47
2017-06-17 12:07:58 -07:00
happyleavesaoc
8fffaebe50 bump ups (#8075) 2017-06-17 11:12:50 -07:00
happyleavesaoc
84aab1c973 bump usps version (#8074) 2017-06-17 11:12:50 -07:00
Caleb
a2fbc0d2ef Update pyunifi component to use APIError passed from pyunifi 2.13. Better accommodate login failures with wrapper in pyunifi 2.13. (#7899)
* Pyunifi update

* Update pyunifi_test

* Import API Error

* Adjust test_unifi.py to import APIError

* Remove urllib import

* Remove urllib import from test

* Try fix mock

* Remove automations.yaml

* Lint
2017-06-17 11:09:44 -07:00
Caleb
6a017efc0e Update pyunifi component to use APIError passed from pyunifi 2.13. Better accommodate login failures with wrapper in pyunifi 2.13. (#7899)
* Pyunifi update

* Update pyunifi_test

* Import API Error

* Adjust test_unifi.py to import APIError

* Remove urllib import

* Remove urllib import from test

* Try fix mock

* Remove automations.yaml

* Lint
2017-06-17 11:09:27 -07:00
Paulus Schoutsen
363a429c41 Fix EntityComponent handle entities without a name (#8065)
* Fix EntityComponent handle entities without a name

* Implement solution by Anders
2017-06-17 10:59:18 -07:00
Lev Aronsky
9fc22ee47a Added 'all_plants' group and support for plant groups state. (#8063)
* Added 'all_plants' group and support for plant groups state.

* Reversed the group states.
2017-06-17 10:59:18 -07:00
Pascal Vizeli
a250f583eb Fix attribute entity (#8066)
* Bugfix entity attribute setter

* Fix tests

* Fix tests part 2

* Change filter only None

* Fix tests part 3

* Update entity.py

* Fix tests
2017-06-17 10:59:18 -07:00
Andrey
bf495edbb5 Add to zwave services descriptions (#8072) 2017-06-17 10:59:18 -07:00
Paulus Schoutsen
3ea7dee83d Always enable monkey patch (#8054) 2017-06-17 10:59:18 -07:00
pezinek
d796e8db5c No update in MQTT Binary Sensor #7478 (#8057) 2017-06-17 10:59:18 -07:00
Pascal Vizeli
d24b45054a Update numpy 1.13.0 (#8059) 2017-06-17 10:59:18 -07:00
Paulus Schoutsen
18935440ed Fix EntityComponent handle entities without a name (#8065)
* Fix EntityComponent handle entities without a name

* Implement solution by Anders
2017-06-17 10:50:59 -07:00
Lev Aronsky
2ba6b3a2ab Added 'all_plants' group and support for plant groups state. (#8063)
* Added 'all_plants' group and support for plant groups state.

* Reversed the group states.
2017-06-17 10:22:23 -07:00
Pascal Vizeli
2438c6b7c2 Fix attribute entity (#8066)
* Bugfix entity attribute setter

* Fix tests

* Fix tests part 2

* Change filter only None

* Fix tests part 3

* Update entity.py

* Fix tests
2017-06-17 10:03:49 -07:00
Andrey
32a84f1466 Add to zwave services descriptions (#8072) 2017-06-17 10:02:37 -07:00
happyleavesaoc
0002a895ca bump usps version (#8074) 2017-06-17 18:42:56 +02:00
happyleavesaoc
d0b43b187a bump ups (#8075) 2017-06-17 18:42:12 +02:00
John Mihalic
33d381731f Bump pyEmby version to account for API changes (#8070) 2017-06-17 18:41:35 +02:00
Eugenio Panadero
18f81d7824 Add option to set language of openweathermap sensor, and handle updating errors (#8046)
* Add option to set language of openweathermap sensor messages

* handle error updating openweathermap sensor
2017-06-17 12:37:34 +02:00
Fabian Affolter
844c8149d7 Add initial support for Shiftr.io (#7974)
* Add initial support for Shiftr.io

* Fix lint issue

* Use paho-mqtt instead of internal MQTT object

* remove async flavor while paho is not async
2017-06-17 12:34:12 +02:00
pezinek
7617864ba5 Failed to parse response from WU API: 'record' (and 'recordyear') #7747 (#8058) 2017-06-17 12:32:22 +02:00
jshore1296
58c234466c Allow config of latitude and longitude (#8068)
This will allow for dynamically updating weather states, for instance if
you wanted to use the latitude and longitude of a phone or other device
to get the weather for your current location.
2017-06-17 10:41:11 +02:00
Phil Hawthorne
9071946e87 Remove % sign from Vera Battery Levels (#8069)
Vera devices are reporting battery levels as a sting by appending a
percentage sign (%) on the end.

To make the Vera component act like other Home Assistant components,
let's remove the percentage sign from the battery report levels so that
we only display the battery level.

This may be a "breaking change" if people are relying on the Vera
battery levels to be a string instead of an int. However, this will make
the battery level reports compatible with everything else.
2017-06-17 10:38:15 +02:00
Paulus Schoutsen
b24aa24f6a Always enable monkey patch (#8054) 2017-06-16 17:17:18 -07:00
Andrey
1fde234c78 Fix some warnings found by quantifiedcode (#8027)
* Cleanup of warnings by quantifiedcode

* Fix lint

* Fix test

* Delete insteon_hub component

* Also update .coveragerc
2017-06-16 22:44:14 +03:00
Adam Mills
d67f3b8060 Use standard entity_ids for zwave entities (#7786)
* Use standard entity_ids for zwave entities

* Include temporary opt-in for new entity ids

* Update link to blog post

* Update tests

* Add old entity_id as state attribute

* Expose ZWave value details

* Update tests

* Also show new_entity_id

* Just can't win with this one
2017-06-16 13:25:12 -04:00
Adam Mills
afb9cba806 Use standard entity_ids for zwave entities (#7786)
* Use standard entity_ids for zwave entities

* Include temporary opt-in for new entity ids

* Update link to blog post

* Update tests

* Add old entity_id as state attribute

* Expose ZWave value details

* Update tests

* Also show new_entity_id

* Just can't win with this one
2017-06-16 13:07:17 -04:00
pezinek
1c2f4866e2 No update in MQTT Binary Sensor #7478 (#8057) 2017-06-16 14:55:59 +02:00
Pascal Vizeli
e90ae2fb75 Update numpy 1.13.0 (#8059) 2017-06-16 11:47:48 +02:00
Paulus Schoutsen
4339e9aab1 version bump to 0.47 2017-06-15 22:51:13 -07:00
Paulus Schoutsen
9b640f6a81 Add comment to default config 2017-06-15 22:31:22 -07:00
Alex Harvey
437ddb8dea Updater improvements to send option component information (#7720)
* Setup to send component data is option is enabled

* testcases, as well as moved to a single boolean, passed to the function

* fixed pep8 failures

* Clarify config option.
2017-06-15 22:29:18 -07:00
Erik Eriksson
a119bd0056 Provide entity_id to avoid sensor mixup (fixes #7636). Use async_dispatcher. Provide icon. (#7946)
* Avoid sensor mixup. Fixes #7636. Also provide icon. Plus some smaller
fixes.

* fix async p1

* Create volvooncall.py
2017-06-15 22:28:30 -07:00
matt2005
0eaad46d93 Added ONVIF camera component (#7979)
* Added ONVIF camera component

* added requirements

* corrected long lines

* fixed indenting

* fixed indenting

* removed bad whitespace

* updated coveragerc

* Added ONVIF camera component

* added requirements

* corrected long lines

* fixed indenting

* fixed indenting

* removed bad whitespace

* updated requirements

* updated requirements

* Added ONVIF camera component

* added requirements

* corrected long lines

* fixed indenting

* fixed pylink error indenting

* Added ONVIF camera component

* added requirements

* corrected long lines

* fixed indenting

* fixed indenting

* removed bad whitespace

* updated requirements

* fixed indenting

* removed bad whitespace

* updated requirements

* fixed pylink error indenting

* rebased and fixed requirements

* Removed Debug logging

* Added info logging to show URL being used.

* corrected spacing

* Tidied up and renamed input to host

* fixed typo

* corrected line lengths

* added default to ffmpeg_arguments

* removed unecessary ffmpeg arguements

* changed to use .format instead of +

* fixed indenting

* cleanup & make it more readable
2017-06-15 22:28:17 -07:00
Jean-Michel Ruiz
8af6bacfd0 media_player.firetv - Adding support for https. (#8022)
* Adding support for https.

This change allows to access a firetv-server instance that runs over https (via a reverse proxy for exemple).
Default stays http, but if `ssl: true` is set in the configuration the connection goes over https.

Successfully tested.

* respecting the 79 characters line limit
2017-06-15 22:23:10 -07:00
Giuseppe
09ca440c20 Fixed the Wind sensor following new release of netatmo-api-python (#8030)
* Fixed the Wind sensor following new release of netatmo-api-python

The NetAtmo PR was at:
https://github.com/jabesq/netatmo-api-python/pull/5

Essentially, this commit adds a protection when adding an incorrect
monitored conditions to avoid to fail the entire NetAtmo component,
plus for consistency reasons all conditions are now in lower case.

* Fixes following the CI tests
2017-06-15 22:14:46 -07:00
Paulus Schoutsen
74cc675a38 Restrict Python Script (#8053) 2017-06-15 22:13:10 -07:00
boojew
c478f2c7d0 Added host variable to Splunk.py and updated tox tests (#8052)
* Added host variable to Splunk.py and updated tox tests

* Update splunk.py

* Update splunk.py
2017-06-15 20:41:19 -07:00
Martin Tremblay
a3a702b269 Adding ssocr to docker to support Seven Segments Display (#8028)
* Adding ssocr to docker to support Seven Segments Display

* Adding cleanup
2017-06-15 20:31:30 -07:00
Paulus Schoutsen
92a6f21cc2 Update frontend 2017-06-15 20:29:11 -07:00
Pascal Vizeli
814834512a Group service / dynamic handling (#7971)
* Add Service to group

* Finish service

* Add service functions

* fix lint

* Address paulus comments

* fix lint & cleanup

* fix lint

* fix lint

* fix lint p3

* add test for check group

* add more tests

* fix lint

* Update service.yaml

* Fix order for tests

* Fix comment

* Fix test

* Fix tests

* Fix name in tests

* Fix view

* Fix default value

* Fix lint

* Fix key error

* add name

* migrate component entity

* fix tests

* fix import

* migrate device tracker

* fix lint

* fix bug

* fix logic

* fix lint

* fix tests

* fix generator

* fix group

* fix other tests.

* Not need to load group on first stage anymore.

* fix service

* add more group depency

* fix tests

* Revert "fix tests"

This reverts commit 35a922b3a8.

* Real fix

* fix test p2

* fix test p3

* fix test p4

* fix test p5

* fix test p6

* fix lint

* fix test p7

* Rename attribute

* fix group test

* fix bug

* fix flagy tests

* fix service.yaml

* fix lint
2017-06-16 00:52:28 +02:00
Alan Fischer
46f3088a70 Vera fix for dimmable vs rgb lights (#8007)
* Differentiate between dimmable & rgb lights

* Updated requirements

* Cache _has_color for supported_features

* simplify & cleanup code

* Create vera.py
2017-06-16 00:28:24 +02:00
Fabian Affolter
deed760008 Upgrade zeroconf to 0.19.1 (#8043) 2017-06-15 21:25:19 +02:00
Fabian Affolter
d1da53615f Upgrade pysnmp to 4.3.8 (#8044) 2017-06-15 21:24:31 +02:00
Fabian Affolter
69c919183a Do not call update() in constructor (#8048) 2017-06-15 21:23:55 +02:00
Anders Melchiorsen
8eb29787a5 LIFX: add multiple modes to pulse effect (#8016)
* blink: the existing 50/50 flashing between base color and effect color
* breathe: a lifx_effect_breathe replacement
* ping: mostly base color with a short flash at the end of the cycle
* strobe: dark base color and short cycles by default
* solid: temporary color change, base color never visible

Adding a service call for each mode is a bit extravagant so instead
lifx_effect_breathe has been folded in as an option and that service
call is deprecated.
2017-06-15 07:59:11 +02:00
Adam Mills
ae3973144c Discover Z-Wave values by index (#7853)
* Discover Z-Wave values by index

* Add URLs for enums (Some Assembly Required)

* URLs on one line

* Move lint suppression to single line
2017-06-14 08:41:20 -04:00
Andrey
02f7eb9675 Allow device_tracker platforms to specify picture and icon upon discovery (#8018)
* Allow device tracker platforms to specify picture

* Allow device tracker to specify icon during discovery

* Clean up and add tests

* Fix lint

* Fix test
2017-06-14 14:39:18 +02:00
Charles Blonde
8c0967a190 Add Dyson Pure Cool Link support (#7795)
* Add Dyson Pure Cool Link support

* Code review

* Improve auto/night mode

* Move night_mode to Dyson fan component

* Code review

* fix asynchrone/sync

* Create dyson.py
2017-06-14 13:56:03 +02:00
Tom Matheussen
bf2fe60cb5 Take in account Spotify account permissions (#8012)
* only show Spotify actions when Premium account is used

* Fix indentation, stupid autoformat
2017-06-14 00:45:00 +02:00
Phil Hawthorne
1ddcab5e26 Make percentage string values as floats/ints in InfluxDB (#7879)
* Make percentage string values as floats in InfluxDB

Currently Z-wave and other compontents report an attributes battery
level as an integer, for example

```yaml
{
"is_awake": false,
"battery_level": 61,
}
```

However, some other components like Vera add the battery level as a
string

```yaml
{
"Vera Device Id": 25,
"device_armed": "False",
"battery_level": "63%",
"device_tripped": "False",
}
```

By removing any % signs in the field, this will send the value to
InfluxDB as an int, which can then be used to plot the data in graphs
correctly, like other percentage fields.

* Add tests and remove all trailing non digits

Adds tests and now removes all trailing non-numeric characters for
better use

* Update variable name for InfluxDB digit checks

Updates the variable used for the regex to remove trailing non digits

* Fix linting errors for InfluxDB component

Fixes a small linting error on the InfluxDB component
2017-06-14 00:42:55 +02:00
Thiago Oliveira
09fec29537 entity_id for service fan.turn_off is optional (#7982)
* entity id is optional

* use a simple if/else to set the data for the fan.turn_off service
2017-06-13 17:28:05 +02:00
Fabian Affolter
9189cbdc8b Remove globally disabled pylint issues (#8005) 2017-06-13 11:10:32 +02:00
Marco Sirabella
7fae8cd0f1 Configure conversation for custom actions with keywords (#7734)
* - Simple keyword to action config

* - Added more fuzzy stuff

* - Logging & a bit of commenting

* - pep8?

* - pep8 and quick formatting fixes

* - Changed configuration a bit

* - Backwards compatibility tests

* - Fallback or

* - Added custom configuration for conversation

* - Moved imports inside function

* - pep8

* - Pass tests better

* - Removed unused imports

* - Moved warning ignore to above import for fuzzy

* - Moved return for consistent return types

* - Fallback if no choices to listen for

* - Fixed linting errors

* - Better logging and fixed linting errors(?)

* - Fixed continuation

* - Added one blank line after class docstring

* Create conversation.py

* Create test_conversation.py

* Create test_conversation.py

* Update test_conversation.py
2017-06-12 23:34:20 -07:00
Fabian Affolter
843f8ce9ee Allow put as method (#8004) 2017-06-12 22:27:25 -07:00
Nolan Gilley
2bf781185f update pyripple (#8015) 2017-06-13 07:22:46 +02:00
Sabesto
1e1d4c2013 Add Flexit AC climate platform (#7871)
* Add Flexit AC climate platform

* Protocol extracted to third party lib
2017-06-12 22:06:47 -07:00
Fabian Affolter
bde711a9ff Make it more flexible (fixes #7954) (#8001)
* Make it more flexible (fixes #7954)

* Fix var name
2017-06-12 09:13:03 +02:00
cribbstechnologies
dc45ed38e7 fixing potential null issue with optional param being parsed as a script (#7928)
* fixing potential null issue with optional param being parsed as a script

* Create template.py
2017-06-11 22:58:20 -07:00
Sören Oldag
03f916ed10 Fixed bug in spotify component. (#7976) 2017-06-11 22:24:01 -07:00
happyleavesaoc
6e33c12008 Update mailgun (#7984)
* add mailgun component

* add to coveragerc
2017-06-11 22:19:10 -07:00
Adam Mills
401309c3b2 Additional demo fan with only speed support (#7985)
* Additional demo fan with only speed support

* Update demo fan tests
2017-06-11 22:12:56 -07:00
sander76
1c06b51968 Fixing Client connection error (#7991) 2017-06-11 21:42:35 -07:00
Fabian Affolter
e7de1fb9ae Add Gitter.im sensor (#7998) 2017-06-11 21:40:06 -07:00
tedstriker
de0f6b781e dismiss service for persistent notifications (#7996)
* dismiss service for persistent notifications

Unnecessary notifications can now be removed automatically. Added a
dismiss service to remove persistent notifications via script and/or
automation.

* removed unnecessary loop

loop removed
2017-06-11 22:54:10 +02:00
Anders Melchiorsen
314bce1073 LIFX: add support for setting infrared level (#8000)
* LIFX: update aiolifx

This adds support for infrared and multizone.

* LIFX: add support for infrared
2017-06-11 22:38:07 +02:00
Anders Melchiorsen
9e16be3173 LIFX: clean up internal color conversions (#7964)
* Add color_util.color_hsv_to_RGB

* Use helper functions for LIFX conversions

The LIFX API uses 16 bits for saturation/brightness while HA uses 8 bits.
Using helper functions makes the conversion a bit nicer and less prone
to off-by-one issues.

The colorsys library uses 0.0-1.0 but we can avoid that by using the HA
color_util converters instead.
2017-06-11 21:19:58 +02:00
Fabian Affolter
1b1619fbf1 Upgrade py-cpuinfo to 3.3.0 (#7992) 2017-06-11 12:03:02 +02:00
Oliver
1f226cffe9 Bugfixing with version 0.4.4 of denonavr (#7995) 2017-06-11 12:02:32 +02:00
Eugenio Panadero
b9ee5fb867 make last_name field optional (#7988) 2017-06-10 22:19:13 +02:00
Thiago Oliveira
ba80d5e52a test that all lights turn off when no entity id is given (#7981) 2017-06-10 10:13:52 +02:00
Erik Eriksson
f2feabcf0b Update eliqonline.py (#7977)
Print error
2017-06-10 10:12:30 +02:00
Daniel Perna
a19e7ba3f1 HomeMatic optimizations and code cleanup (#7986)
* Cleanup and optimizations

* Cleanup

* Typo -.-

* Linting
2017-06-10 10:08:36 +02:00
mwsluis
49d642741d Nadtcp component (#7955)
* initial commit

* class name and requirements_all.txt

* removed mentions of D7050

* changed default name

* catch oserror in update, travis errors.

* use nad_receiver pip version

* update coveragerc
2017-06-09 14:53:07 -04:00
Paulus Schoutsen
db0efc647d New component: Python Script (#7950)
* Add initial version

* Fix requirements

* Prefer logging over printing

* Set executor thread name on >Py36 only

* Add tests

* Lint

* Add restrictedpython to test dependencies

* Create python_script.py

From doc:
```
However, an empty dict ({}) is treated as is. If you want to specify a list that can contain anything, specify it as dict:
>>> schema = Schema({}, extra=ALLOW_EXTRA)  # don't do this
>>> try:
...   schema({'extra': 1})
...   raise AssertionError('MultipleInvalid not raised')
... except MultipleInvalid as e:
...   exc = e
>>> str(exc) == "not a valid value"
True
>>> schema({})
{}
>>> schema = Schema(dict)  # do this instead
>>> schema({})
{}
>>> schema({'extra': 1})
{'extra': 1}

```
2017-06-09 12:38:40 +02:00
Paulus Schoutsen
640c692e1f Fix platforms being able to block startup (#7970) 2017-06-09 12:11:58 +02:00
Paulus Schoutsen
4aef0b68bc Merge branch 'master' into dev 2017-06-08 22:21:25 -07:00
Paulus Schoutsen
c2b7c93375 Merge pull request #7968 from home-assistant/release-0-46-1
0.46.1
2017-06-08 22:20:32 -07:00
Paulus Schoutsen
8cc759ea4b Prevent Roku doing I/O in event loop (#7969) 2017-06-08 22:18:48 -07:00
Paulus Schoutsen
a223efb840 Prevent Roku doing I/O in event loop (#7969) 2017-06-08 22:18:33 -07:00
Jacob Mansfield
c32807803e Create metoffice.py (#7965)
Fix met office sensor
2017-06-08 21:44:33 -07:00
Jacob Mansfield
24a172163a Create metoffice.py (#7965)
Fix met office sensor
2017-06-08 21:44:24 -07:00
Barry Williams
372169a03a Fixed metadata issue (#7932) 2017-06-08 21:41:42 -07:00
Barry Williams
e4d100d54d Fixed metadata issue (#7932) 2017-06-08 21:41:24 -07:00
cribbstechnologies
bfd9623d8b Mqtt cover modifications (#7841)
* adding set position ability
removing command_topic being required

* flaking

* flaking test

* updating docs

* requested updates

* Revert "updating docs"

This reverts commit 9cfc5ed7a8.

* forgot to update constructor calls in tests
2017-06-08 21:35:38 -07:00
mje-nz
3464454662 Fix typos in Wunderground component (Percipitation -> Precipitation) (#7901) 2017-06-08 21:35:26 -07:00
Johan Bloemberg
533bb5565b Dsmr5 revert (#7900)
* Revert "Update to dsmr_parser supporting v5 arguments."

This reverts commit 3567de4b90.

* Revert "Using dev branch until released upstream."

This reverts commit 53e8de112c.

* Revert "Give good example."

This reverts commit 4f90fc4be6.

* Revert "Allow configuring DSMR5 protocol."

This reverts commit 9fa0e14187.
2017-06-08 21:35:26 -07:00
Adam Mills
a8709a6988 Support for renaming ZWave values (#7780)
* Support for renaming ZWave values

* Improve test
2017-06-08 21:35:26 -07:00
Paulus Schoutsen
4b767b088e Version bump to 0.46.1 2017-06-08 21:34:39 -07:00
Albert Lee
c52b18d7c8 lock.sesame: Update pysesame, add state attributes (#7953)
* Update pysesame requirement to 0.1.0 to support caching

* Set `available` property based on API enabled status

* Add state attributes for device ID and battery level
2017-06-09 00:21:56 +02:00
Fabian Affolter
aaaf9637eb Add configuration check and use default var names (#7963) 2017-06-09 00:21:06 +02:00
Riccardo Canta
055db05946 Osram lightify, removed double set to the lightify bridge in case of brightness changes (#7662)
* osram lightify removed duplicated set in case of brightness changes

* lightify component: anticipate brightness evaluation to handle unconsidered scenario described in the PR request comments (light turned on with color/temperature)

* Correction for travis ci error:
undefined name 'transition'
2017-06-08 20:17:28 +02:00
Fabian Affolter
0863d50210 Fix typos (#7957)
Add an optional extended description…
2017-06-08 15:53:12 +02:00
Alan Fischer
1e352d37d0 Vera colored light support (#7942)
* Added support for color to vera lights

* Updated requirements
2017-06-08 12:28:03 +02:00
Boris K
620197b276 Fix the negative values bug in history_stats (#7934) 2017-06-08 12:27:43 +02:00
Michael Heinemann
727a22f925 test connection without needing admin rights (#7947)
SHOW DIAGNOSTICS always needs admin privileges on influxdb. For
the purposes of home-assistant this is too much.
Use 'SHOW SERIES' to have a relatively lightweight query which
only needs READ privileges.
2017-06-08 12:26:37 +02:00
Fabian Affolter
9bea7d7d8b Upgrade coinmarketcap to 3.0.1 (#7951) 2017-06-08 12:15:46 +02:00
Teagan Glenn
97f62cfb78 [WIP] Fix opencv (#7864)
* Updates to opencv image processor

* Remove opencv hub

* Requirements

* Remove extra line

* Fix linting errors

* Indentation

* Requirements

* Linting

* Check for import on platform setup

* Remove opencv requirement

* Linting

* fix style

* fix lint
2017-06-08 11:26:24 +02:00
Oliver
482db94372 Add option to display all input sources / Add support for favourite channels / Treat Marantz SR5008 as Denon AVR-X device (#7949)
* add option to display all sources / pushed to version 0.4.3 of library

* Add show_all_sources option for auto discovery too

* change code style for hass

* fix lint
2017-06-08 09:46:26 +02:00
vrs01
8a4e993183 Update ping.py (#7944) 2017-06-08 07:30:51 +02:00
joopert
790610525b update to 006 (#7945) 2017-06-08 07:30:07 +02:00
Daniel Perna
7e668ef9e3 Merge pull request #7948 from danielperna84/HomeMatic
HomeMatic: Updated dependency
2017-06-08 00:09:53 +02:00
Daniel Perna
4dbf7be267 Updated dependency 2017-06-07 23:55:42 +02:00
Juggels
36eb0ceff3 [media_player.sonos] Send media_stop on turn_off (#7940) 2017-06-07 13:15:29 +01:00
Fabian Affolter
d38acfbd39 Add Yahoo! weather platform (#7939) 2017-06-07 10:49:54 +02:00
Nolan Gilley
b87e31617a add ripple sensor (#7935) 2017-06-07 10:24:07 +02:00
Jacob Minnis
bb6fe822f9 Added 'change' field to statistics sensor (#7820)
* Added 'change' field to statistics sensor

* Updated statistics sensor test

* Updated statistics sensor test complaint
2017-06-07 09:38:00 +02:00
Stephan Auerhahn
5504a511e3 Add service_url config option to volvooncall (#7919)
* Add service_url config option to volvooncall

* Import default value from volvooncall lib
2017-06-07 08:52:36 +02:00
Fabian Affolter
5c96936eb4 Do not call update() in constructor (#7931) 2017-06-06 19:15:03 +02:00
Fabian Affolter
cbbb15fa48 Fix changes introduced with #7917 (#7930) 2017-06-06 19:14:41 +02:00
Fabian Affolter
760138ac52 Do not call update() in constructor (#7917) 2017-06-05 21:28:13 +02:00
Per Osbäck
b1f538b622 update to pywebpush 1.0.4 which allows install on system with openssl-1.1.0 (cryptography dep) (#7915) 2017-06-05 17:46:51 +02:00
John Mihalic
ac8592587f Bump pyEight version to fix 0hr session errors (#7916) 2017-06-05 17:44:13 +02:00
Jesse Hills
aee25a020d Add juicenet platform (#7668)
* Add juicenet platform

* Update missing variable
Add missing blank lines

* Remove unnecessary override

* Update juicenet.py

* Remove whitespace
Add missing docstring

* Remove unused services
Use the hass built in unique_id

* Fix lint issues

* Update python-juicenet library version

* Update python-juicenet library version

* Remove unnecessary code

* Remove unused import

* Remove super call
2017-06-05 08:39:31 -07:00
Fabian Affolter
13df925795 Do not call update() in constructor (#7912)
* Do not call update() in constructor

* Do not call update() in constructor

* Remove unused import
2017-06-05 17:35:26 +02:00
PhracturedBlue
2b850f417e Minor cleanup - Define 'CONF_ICON_TEMPLATE' constant centrally (#7910)
* Add 'icon_template' to switch templates (similar to sensor template)

* Add test for template switch 'icon_template'

* Define 'CONF_ICON_TEMPLATE' constant centrally

* Missed a redundant definition
2017-06-05 17:33:57 +02:00
Fabian Affolter
f303f6a191 Move consts to 'const.py' (#7909) 2017-06-05 16:59:59 +02:00
Fabian Affolter
f8cfa15152 Sync crypto-currency platforms (#7906) 2017-06-05 13:36:39 +02:00
Fabian Affolter
12f731b32c Fix docstring (#7907) 2017-06-05 13:16:53 +02:00
PhracturedBlue
11dcbd4449 Add 'icon_template' to switch templates (similar to sensor template) (#7862)
* Add 'icon_template' to switch templates (similar to sensor template)

* Add test for template switch 'icon_template'
2017-06-05 11:27:48 +02:00
Paulus Schoutsen
fa6a089fb3 Lint 2017-06-05 00:10:57 -07:00
florincosta
87da2ff1d7 Add raspihats switch (#7665) 2017-06-04 23:56:21 -07:00
Paulus Schoutsen
b576df53e9 Update .coveragerc 2017-06-04 23:54:15 -07:00
Martin Berg
b90964faad Add support for Vanderbilt SPC alarm panels and attached sensors (#7663)
* Add support for Vanderbilt SPC alarm panels.

 * Arm/disarm + read state

 * Autodiscover and add motion sensors

* Fix code formatting.

* Use asyncio.async for Python < 3.4.4.

* Fix for moved aiohttp exceptions.

* Add docstrings.

* Fix tests and add docstrings.
2017-06-04 23:53:25 -07:00
mjj4791
549133a062 Added buienradar sensor and weather (#7592)
* Added buienradar sensor and weather

* used external library for parsing

* used external library for parsing

* updated buienradar lib to 0.4

* Make sure you import 3rd party libraries inside methods.

* Make sure you import 3rd party libraries inside methods.

* clean up code; optimized

* imports, sensor name and attributes

* updated requirements to match imports

* use asyncio for http get
2017-06-04 23:48:11 -07:00
Matthew Schick
c29553517f Add service to set nest away/home modes (#7619)
* Add service to set nest away/home modes

* New service `nest.set_mode`
* Update the NestDevice object to export the local structures

* Validation and structure cleanup
2017-06-04 23:45:24 -07:00
Trevor
2e27c0d5ec Add Radarr sensor (#7318)
* Add radarr.py

* Update radarr.py

* Update radarr.py

* Add test_radarr.py

* Update test_radarr.py

* Update test_radarr.py

* Update radarr.py

* Update .coveragerc

* Fix hound.
2017-06-04 23:44:24 -07:00
cribbstechnologies
774f584ba8 Mqtt cover modifications (#7841)
* adding set position ability
removing command_topic being required

* flaking

* flaking test

* updating docs

* requested updates

* Revert "updating docs"

This reverts commit 9cfc5ed7a8.

* forgot to update constructor calls in tests
2017-06-04 22:55:06 -07:00
Nolan Gilley
81b1446aad blockchain.info sensor (#7856)
* blockchain sensor

* Update blockchain.py

* Update blockchain.py

* add validation of btc addresses
2017-06-04 22:48:38 -07:00
Nolan Gilley
6bfd52ada8 Etherscan.io sensor (#7855)
* etherscan sensor

* Update etherscan.py
2017-06-04 22:48:04 -07:00
Per Osbäck
0646d01152 Add support for the expirationTime parameter. (#7895)
Enabled by default in Chrome 60.
Only accepts the param, doesn't act on the actual expiration date. Chrome will always pass NULL for now.

https://github.com/w3c/push-api/pull/248
https://www.chromestatus.com/feature/4929396687241216
https://bugs.chromium.org/p/chromium/issues/detail?id=718837
2017-06-04 22:46:18 -07:00
mje-nz
da5f5335eb Fix typos in Wunderground component (Percipitation -> Precipitation) (#7901) 2017-06-04 22:37:16 -07:00
Johan Bloemberg
c9d55cff23 Dsmr5 revert (#7900)
* Revert "Update to dsmr_parser supporting v5 arguments."

This reverts commit 3567de4b90.

* Revert "Using dev branch until released upstream."

This reverts commit 53e8de112c.

* Revert "Give good example."

This reverts commit 4f90fc4be6.

* Revert "Allow configuring DSMR5 protocol."

This reverts commit 9fa0e14187.
2017-06-04 22:36:19 -07:00
Albert Lee
aeb1d3d3fe lock.sesame: New lock platform for Sesame smart locks (#7873)
* Manage Sesame devices through CANDY HOUSE's cloud API
* Add dependency on new pysesame library
2017-06-04 22:06:18 -07:00
Barry Williams
a1c119adb6 Added a Taps Aff binary sensor (#7880)
* Added a Taps Aff binary sensor

* PR Review updates

* Added a Taps Aff binary sensor

* PR Review updates

* Improved error handling

* Cosmetic changes (ordering, docstings, etc.)
2017-06-04 13:35:19 +02:00
Paulus Schoutsen
e9f273e7e0 Merge pull request #7866 from home-assistant/release-0-46
0.46
2017-06-03 19:16:35 -07:00
Paulus Schoutsen
7ebf36bb70 Fix MQTT camera test (#7878) 2017-06-03 18:57:05 -07:00
Paulus Schoutsen
84fe4f75df Fix MQTT camera test (#7878) 2017-06-03 18:51:29 -07:00
Fabian Affolter
c07bf551d9 Upgrade python-telegram-bot to 6.0.3 (#7885) 2017-06-03 22:36:41 +02:00
Fabian Affolter
a745bf83ef Upgrade sendgrid to 4.2.0 (#7886) 2017-06-03 22:34:17 +02:00
Fabian Affolter
1432ae649a Upgrade pyasn1-modules to 0.0.9 (#7887) 2017-06-03 22:33:43 +02:00
Fabian Affolter
cf1a27bd7c Use constants (#7888) 2017-06-03 22:33:12 +02:00
Andrey
3d8b7a4122 Switch pymyq to pypi (#7884) 2017-06-03 17:12:36 +02:00
joopert
e50588afe1 Change nad_receiver to pypi (#7852)
* Change to pypi

* add requirements
2017-06-03 17:01:51 +03:00
Anders Melchiorsen
4dc4a98caa [light.lifx] Update aiolifx (#7882)
This makes LIFX Gen3 lights work with the current firmware.
2017-06-03 13:21:31 +01:00
Anders Melchiorsen
423e809e45 [light.lifx] Update aiolifx (#7882)
This makes LIFX Gen3 lights work with the current firmware.
2017-06-03 13:20:55 +01:00
Paulus Schoutsen
a79f1d4d40 Fix telegram_bot (#7877) 2017-06-03 10:52:00 +01:00
Paulus Schoutsen
8461cf2717 Fix telegram_bot (#7877) 2017-06-03 10:50:37 +01:00
Adam Mills
9c9f5068b7 Support for renaming ZWave values (#7780)
* Support for renaming ZWave values

* Improve test
2017-06-02 23:03:00 -07:00
twendt
6d41024e76 Enocean Binary Sensor: Handle click of both rockers (#7770) 2017-06-02 22:12:41 -07:00
Kevin
7d24efc690 Added effects to Yeelight bulbs (#7152)
* Added effects to Yeelight bulbs

* Fix Typo and Use randint instead of randrange

* Added Effects

* updated requirements_all.txt

* fix empty line

* minor fixes

* fix passing effects as parameter
2017-06-02 21:35:32 -07:00
Paulus Schoutsen
7d4adbbef5 Fix html5 unsub (#7874)
* Fix #7758 subscription expiration/removal

Removes a subscription after receiving an HTTP 410 response when trying to send a new message.

* Fix tests failing due to additional call

* Fix code style

* Lint
2017-06-02 20:56:16 -07:00
Erik Eriksson
e11ec88482 Update squeezebox.py (#7617)
Do not fail in case no players are connected, in which case squeezeserver will return a result without player_loop.
2017-06-02 00:26:54 -07:00
Paulus Schoutsen
e39bdf8763 Version bump to 0.47.0dev0 2017-06-02 00:24:40 -07:00
Paulus Schoutsen
a33bcdf270 Version bump to 0.46 2017-06-02 00:24:19 -07:00
Paulus Schoutsen
f056cbc641 Update frontend 2017-06-02 00:20:53 -07:00
Paulus Schoutsen
4163bcebbc Update netdisco (#7865) 2017-06-02 00:13:17 -07:00
Johan Bloemberg
d472d81538 Align switch group handling with light. (#7577) 2017-06-02 00:05:34 -07:00
David-Leon Pohl
2b70b1881a Quickfix Bug #7384 (#7582)
* Quickfix Bug #7384

* Fix devices not available runtime bug
2017-06-02 00:05:07 -07:00
Juggels
12607aeaea Check if media commands are actually applicable (#7595)
* Check if media commands are actually applicable

- Explicitly allow ‘stop’ and ‘play’ on radio streams
- Disallow media commands when the playlist is empty
- Check if command is supported when calling `turn_on` and `turn_off`

* Suppress UPnP error 701 on media commands

* Clean up soco_filter_upnperror

Clean up soco_filter_upnperror and fix small bug in support_previous_track determination
2017-06-02 00:03:10 -07:00
Erik Eriksson
1855f1ae85 fix for https://github.com/home-assistant/home-assistant/issues/7019 (#7618) 2017-06-02 00:02:26 -07:00
Thibault Cohen
613da308f2 Query in InfluxDB sensor is now templatable (#7634) 2017-06-02 00:01:14 -07:00
Teagan Glenn
cefacf9ce4 Spotify aliases (#7702)
* Alias support for spotify devices

* Fix log

* Formatting/Fixes

* Remove default arg

* Add default keyword

* None check
2017-06-01 23:53:23 -07:00
Alex Harvey
78887c5d5c Start of migration framework, to allow moving of files in the config … (#7740)
* Start of migration framework, to allow moving of files in the config directory to be hidden, ios.conf used as the first one to undergo this change.

* Update const.py

* Update test_config.py

* improvement to syntax
2017-06-01 23:50:04 -07:00
Craig J. Ward
3a92bd78ea fix permissions issue for Insteon Local #6558 (#7860)
* fix unlinked commit

* Update insteon_local.py
2017-06-01 23:36:47 -07:00
Paulus Schoutsen
d0021a6171 Make monkey patch work in Python 3.6 (#7848)
* Make monkey patch work in Python 3.6

* Update dockerfiles back to 3.6

* Lint

* Do not set env variable for dockerfile

* Lint
2017-06-01 23:23:39 -07:00
Anders Melchiorsen
e2cfdbff06 Disallow ambiguous color descriptors in the light.turn_on schema (#7765)
* Disallow ambiguous color descriptors in the light.turn_on schema

* Update tests
2017-06-01 23:05:05 -07:00
abmantis
9480f41210 dont use default for switch name, so that the object id is used (#7845) 2017-06-01 22:58:57 -07:00
Boris K
1b5f6aa1b9 Optimize history_stats efficiency and database usage (#7858) 2017-06-01 22:52:55 -07:00
Eugenio Panadero
2065426b16 log time delay of domain setup in info level (#7808)
* log time delay of domain setup in info level

 * when setup problems appear, it's difficult to debug which are the components that took a lot to set up. This minimal change goes further than the 'slow setup warning' and measures the setup time interval for each domain.

* use timer as in helpers/entity
2017-06-01 22:44:44 -07:00
Adam Mills
beb8c05d91 Use expected behvaior for above/below (#7857) 2017-06-01 22:43:24 -07:00
Adam Mills
cf42303afb Rename time trigger 'after' to 'at' (#7846) 2017-06-01 22:40:27 -07:00
Daniel Perna
4bcbeef480 Bumped pyhomematic version (#7861) 2017-06-01 22:33:53 -07:00
Adam Mills
e0712ba329 Expose the node name on the zwave node entity (#7787) 2017-06-01 22:33:16 -07:00
Fabian Affolter
66d6f5174d Allow 'base_url' (fixes #7784) (#7796) 2017-05-31 09:08:53 -07:00
Marcelo Moreira de Mello
9762e1613d Introduced support to Netgear Arlo Cameras (#7826)
*  Introduced support to Netgear Arlo Cameras

* Using async_setup_platform() and applied other changes

* Removed unecessary variables

* Using asyncio for sensor/arlo

* Update arlo.py

* Removed entity_namespace
2017-05-31 09:25:25 +02:00
Phil Hawthorne
bb92ef5497 Downgrade Docker to Python 3.5 to solve Segmentation Faults (#7799)
Downgrades the Dockerfiles used by Home Assistant to Python 3.5, after
Python 3.6 base image was causing segmentation faults.

See home-assistant/home-assistant#7752
2017-05-30 23:56:20 -07:00
Paulus Schoutsen
9f5bfe28d1 Add initial benchmark framework (#7827)
* Add initial benchmark framework

* Use timer from timeit
2017-05-30 21:34:40 -07:00
Marcelo Moreira de Mello
8ee32a8fbd Added persistent error message if cover.myq fails to load (#7700)
* Show persistent error if cover.myq fails

* Fixed typo on getLogger()

* Added ValueError on except condition

* Make pylint happy

* Removed DEFAULT_ENTITY_NAMESPACE since it is not being used
2017-05-30 23:17:32 +02:00
Fabian Affolter
052cd3fc53 Upgrade PyMVGLive to 1.1.4 (#7832) 2017-05-30 18:26:26 +02:00
Fabian Affolter
0ccaf97924 Update docstrings and log messages (#7709) 2017-05-30 11:52:26 +02:00
happyleavesaoc
96b20b3a97 update snapcast media player (#7079)
* update snapcast

* fix docstrings

* bump dep version

* address snapcast review comments

* add snapcast group volume support

* fix snapcast requirements

* update snapcast client entity id

* snapshot/restore functions

* refactor snapshot/restore services

* clean up

* update snapcast req

* bump version

* fix async updates
2017-05-30 11:34:39 +02:00
Daniel Høyer Iversen
91806bfa2a Flux led fix (#7829)
* Update flux_led.py

* style fix
2017-05-30 10:46:18 +02:00
Fabian Affolter
1c4e097bed Upgrade pysnmp to 4.3.7 (#7828) 2017-05-30 09:08:57 +02:00
Pascal Vizeli
2df6aabbf3 Cleanup telegram / Add url to webhook (#7824)
* Cleanup telegram / Add url to webhook

* fix lint

* Fix lint
2017-05-30 06:55:06 +02:00
John Mihalic
81b2111751 Bump aiohttp to 2.1.0 (#7825) 2017-05-30 06:54:16 +02:00
Eugenio Panadero
f7e0d13fe6 Telegram send image: fix mimetype detection (#7802)
* Add `name` var to BytesIO content to get recognized

Sometimes the python-telegram-bot doesn't recognize the mimetype of the file and looks after a name variable to deduce it. Fixes #7413

* bytesio stream recycle less explicit
2017-05-29 22:59:44 +02:00
Johan Bloemberg
5e5c0daa87 Allow configuring DSMR5 protocol. (#7535)
* Allow configuring DSMR5 protocol.

* Give good example.

* Using dev branch until released upstream.

* Update to dsmr_parser supporting v5 arguments.
2017-05-29 16:19:50 +02:00
Fabian Affolter
a7277db4d7 Upgrade mypy to 0.511 (#7809)
Add an optional extended description…
2017-05-29 15:39:24 +02:00
Fabian Affolter
ba44b7edb3 Upgrade sqlalchemy to 1.1.10 (#7807) 2017-05-29 15:38:56 +02:00
Lev Aronsky
8fcc750998 Added handling of an AssertionError from pxssh failed login (#7750)
* Added handling of an AssertionError from pxssh failed login

* Destory and re-create pxssh instance, to fix behavior upon router restart.
2017-05-29 11:22:20 +02:00
Teagan Glenn
eff619a58f Rest notify data (#7757)
* Rest notify data

* Cleanup

* Fix spaces
2017-05-29 11:20:23 +02:00
Andy Castille
fc1bb58247 Rachio (Sprinklers) (#7600)
* Rachio platform started

* Rachio tests

* detect bad api token

* Documentation, Code cleanup

* Docstrings end with a period, log uses %

* Fix arguments, default run time is now 10 minutes

* Fix typo, remove todo (GH issue exists)

* Revert polymer submodule commit

* Use a RachioPy version with SSL cert validation

* Update requirements
2017-05-29 11:15:27 +02:00
Fabian Affolter
c12b8f763c Upgrade pysnmp to 4.3.6 (#7806) 2017-05-29 10:28:31 +02:00
Dan Cinnamon
ef51d8518a Bump pyenvisalink to version 2.1 (#7803) 2017-05-29 10:27:36 +02:00
Fabian Affolter
8b7894fb86 Upgrade slacker to 0.9.50 (#7797) 2017-05-29 10:26:56 +02:00
Fabian Affolter
010f098df3 Upgrade Sphinx to 1.6.2 (#7805) 2017-05-29 10:26:33 +02:00
Oliver
1f3bb51821 Add Marantz SSDP discovery / Detect error string in AppCommand.xml body (#7779) 2017-05-29 10:26:10 +02:00
CTLS
10367eb250 Fix home/stay in concord232 (#7789) 2017-05-28 12:06:18 +02:00
sander76
7fb5488058 Powerview to async (#7682)
* first commit

* first commit

* first commit

* first commit

* changing requirements

* updated requirements_all.txt

* various changes as suggested in the comments.

* using global values for dict keys.
2017-05-26 22:19:19 +02:00
Paulus Schoutsen
e68bd0457c Fix more deprecation warnings (#7778)
* Remove setting up an hbmqtt broker

* Don't pass loop to web.Application in tests

* Use .query instead of deprecated .GET for aiohttp requests

* Fix closing file resource

* Do not use asyncio mark

* Notify.html5 - PyJWT: Use options to disable verify

* Yamaha: Test was still using deprecated ip

* Remove pytest-asyncio
2017-05-26 13:12:17 -07:00
Eugenio Panadero
910020bc5f Fix Telegram Bot send file to multiple targets, snapshots of HA cameras, variable templating, digest auth (#7771)
* fix double template rendering when messages come from notify.telegram

* fix 'chat' information not present in callback queries

* better inline keyboards with yaml

To make a row of InlineKeyboardButtons you pass:
- a list of tuples like: `[(text_b1, data_callback_b1), (text_b2, data_callback_b2), ...]
- a string like: `/cmd1, /cmd2, /cmd3`
- or a string like: `text_b1:/cmd1, text_b2:/cmd2`

Example:
```yaml
data:
   message: 'TV is off'
   disable_notification: true
   inline_keyboard:
     - TV ON:/service_call switch.turn_on switch.tv, Other:/othercmd
     - /help, /init
```

* fix send file to multiple targets

* fix message templating, multiple file targets, HA cameras

- Allow templating for caption, url, file, longitude and latitude fields
- Fix send a file to multiple targets
- Load data with some retrying for HA cameras, which return 500 one or two times sometimes (generic cams, always!).
- Doc in services for new inline keyboards yaml syntax: `Text button:/command`

* HttpDigest authentication as proposed in #7396

* review changes

- Don't use `file` as variable name.
- For loop
- Simplify filter allowed `chat_id`s.

* Don't use `file` as variable name!

* make params outside the while loop

* fix chat_id validation when editing sent messages
2017-05-26 21:05:12 +02:00
Paulus Schoutsen
f43db3c615 Replace executor with async_add_job (#7658)
* Remove executor

* Lint

* Lint

* Fix tests
2017-05-26 08:28:07 -07:00
Adam Mills
9e9705d6b2 Support for GE Zwave fan controller (#7767)
* Support for GE Zwave fan controller

* Tests for zwave fan

* Add additional fan workarounds
2017-05-25 22:55:00 -07:00
Paulus Schoutsen
6899c7b6f7 assertEquals is deprecated (#7777) 2017-05-25 22:21:22 -07:00
Paulus Schoutsen
d0c9d6b69a Remove usage of event_loop fixture (#7776) 2017-05-25 21:40:36 -07:00
Paulus Schoutsen
81aaeaaf11 Get rid of mock http component app (#7775)
* Remove mock_http_component from config tests

* Remove mock_http_component_app from emulated hue test
2017-05-25 21:13:53 -07:00
Adam Mills
65c3201fa6 Rename of the zwave hass.data constants (#7768)
* Rename of the zwave hass.data constants

* Remove zwave since it is already implied
2017-05-25 21:11:02 -07:00
Anton Sarukhanov
3a843e1817 Add icons to device tracker. (#7759) 2017-05-24 19:12:26 -07:00
Paulus Schoutsen
0c7f8e910e Merge branch 'master' into dev 2017-05-24 19:05:01 -07:00
Hugo Herter
0abde3aa57 Change setup script to use pip install instead of setup.py develop (#7756)
Using `python setup.py develop` did not manage to install the required dependencies.
This updates `script/setup` to use `pip install -e .` instead in order to resolve the required dependencies.
2017-05-24 15:31:51 -07:00
amigian74
775d45ae5a Exclude filter for event types (#7627)
* add exclude filter for event types to recorder component

* corrected long line (279)

* change source code structure
add test for exclude event types

* code cleanup

* change source code structure

* Update __init__.py

* Update test_init.py
2017-05-24 15:23:52 -07:00
Paulus Schoutsen
e7d783ca2a Update links.html 2017-05-24 14:47:22 -07:00
cribbstechnologies
ef4ef2d383 Template light (#7657)
* starting light template component

* linting/flaking

* starting unit tests from copypasta

* working on unit testing

* forgot to commit the test

* wrapped up unit testing

* adding remote back

* updates post running tox

* Revert "adding remote back"

This reverts commit 852c87ff96.

* adding submodule back from origin

* updating submodule

* removing a line to commit

* re-adding line

* trying to update line endings

* trying to fix line endings

* trying a different approach

* making requested changes, need to fix tests

* flaking

* union rather than intersect; makes a big difference

* more tests passing, not sure why this one's failing

* got it working

* most of the requested changes

* hopefully done now

* sets; the more you know
2017-05-24 14:32:22 -04:00
everix1992
3638b21bcb Added new commands and functionality to the harmony remote component. (#7113)
* Added new commands and functionality to the harmony remote component.

-This includes the ability to optionally specify a number of times to repeat a specific command, such as pressing the volume button multiple times.
-Also added a new command that allows you to send multiple commands to the harmony at once, such as sending a set of channel numbers.
-Updated the unit tests for these changes.

* Fix flake8 coding violations

* Remove send_commands command and make send_command handle a single or list of commands

* Remove send_commands tests

* Update itach and kira remotes for new send_command structure. Fix pyharmony version in requirements_all.txt

* Fix incorrect variable name

* Fix a couple minor issues with remote tests
2017-05-23 17:00:52 -07:00
Stu Gott
54c45f80c1 Fix time_date sensor to update at predictable intervals (#7644)
* Fix time_date sensor to update at predictable intervals

* Delete automations.yaml
2017-05-23 16:00:26 -07:00
Juggels
e3307fb1c2 Redesign monitored variables for hp_ilo sensor (#7534)
* Redesign monitored variables

Allow generating specific sensors without the need for template sensors

* Import 3rd party library inside update method

* Remove jsonpath_rw dependency

* Do not interfere with value_template or ilo_data output

Do not interfere with value_template or ilo_data output, this is now the responsibility of the user and should be handled in `configuration.yaml`

Fix UnusedImportStatement

Fix newline after function docstring

* Always output results to state
2017-05-23 14:56:00 -07:00
William Scanlon
b5f20c9b64 Always return rgb color of bulbs (#7743) 2017-05-23 14:49:20 -07:00
Anton Sarukhanov
7055fddfb4 Don't block startup more than 60 seconds while waiting for components. (#7739) 2017-05-23 14:29:27 -07:00
Anders Melchiorsen
fce09f624b LIFX: disable color features for white-only bulbs (#7742)
The product type is already established in order to decide the Kelvin range
so just reuse that information to disable color features for white-only lights.

Also change the breathe/pulse effects to be more useful for white-only
bulbs. For consistency, color bulbs set to a desaturated (i.e. white-ish)
color get the same default treatment as white-only bulbs.
2017-05-23 22:35:19 +02:00
nordeep
be53cc7068 Don't initialize mqtt components which have already been discovered (#7625)
* Don't initialize mqtt components which have already been discovered

* Fix string length

* Fix blank lines, fix constant name

* Remove globals. Remove JSON dump

* Add tests. Update grammar

* PEP8 style issue

* Add hyphen to object_id regex

* PEP8 style fix
2017-05-23 11:08:12 -07:00
Anton Sarukhanov
f3dabe21ab Prevent the random template filter from caching its output. Fixes #5678 (#7716) 2017-05-23 10:32:06 -07:00
Brenton Zillins
228fb8c072 Ensure https base_url in telegram bot (#7726) 2017-05-23 10:16:54 -07:00
Lev Aronsky
c556b619b7 Asuswrt continuous ssh (#7728)
* Make ssh and telnet connections continuous in asuswrt

* Refactored SSH and Telnet connections into respective classes.

* Fixed several copy-paste typos and errors.

* More typos fixed.

* Small changes to arguments, to pass automated tests.

* Removed unsupported named arguments.

* Fixed a couple of mistakes in Telnet, and other lint errors.

* Added Telnet tests, and added lint exceptions.

* Removed comments from tests, as they irritated the hound.
2017-05-23 09:55:01 -07:00
Paulus Schoutsen
2682996939 Constrain requests to a version (#7725)
Add an optional extended description…
2017-05-23 15:45:22 +02:00
Alex Harvey
6872daab89 update apcacccess used in apcupsd to 0.0.10, which fixes random file drop from apcaccess (#7722) 2017-05-22 17:00:41 -07:00
Paulus Schoutsen
6d183e8bb3 Merge pull request #7686 from home-assistant/release-0-45-1
0.45.1
2017-05-22 11:36:21 -07:00
Paulus Schoutsen
cdc8628e5a Allow fetching hass.io panel without auth (#7714) 2017-05-22 11:06:04 -07:00
tobygray
dc4b0695b5 device_tracker.ubus: Handle empty results (#7673)
If OpenWRT isn't running the DHCP server then some OpenWRT hardware,
such as TP-Link TL-WDR3600 v1, can't determine the host
corresponding to an associated wifi client. This change handles that
by returning None when the request has no data in the result.
2017-05-22 11:06:04 -07:00
cgtobi
3fb691ead6 Fix playback control of web streams (#7683)
Web streams can't be paused and resumed later. That's why volumio stops them instead of pausing them.
2017-05-22 11:06:04 -07:00
Eugenio Panadero
a9926e355f Fix telegram chats (#7689)
* bugfix for Telegram chat_ids

- Negative `chat_id`s for groups.
- Include `chat_id` in event data.
- Handle KeyError when receiving other types of messages, as `new_chat_member` ones, and send them as text.

* unused import

* fix double quote style, fix boolean expr, change warning msg

* mistake

* some more fixes

- fix if condition for msg bad fields.
- return True for a correct but not allowed or not recognized message: if not, the message arrives continuously.
- Allow to receive messages from unauthorized users if they come from authorized groups.

* support for `edited_message`s

- They come as normal messages, except for the 'edited_message' field instead of 'message'.
2017-05-22 11:06:04 -07:00
Paulus Schoutsen
17cbe0c6ce Allow fetching hass.io panel without auth (#7714) 2017-05-22 11:00:02 -07:00
Fabian Affolter
783abc7996 Make 'sender' as requirement for the config (fixes #7698) (#7706) 2017-05-22 15:17:15 +02:00
Fabian Affolter
47355eed41 Upgrade python-telegram-bot to 6.0.1 (#7704) 2017-05-22 13:56:36 +02:00
John Mihalic
d5642a5faf Bump pyEight version (#7701) 2017-05-22 07:54:01 +02:00
tobygray
ca3f07cdef device_tracker.ubus: Handle empty results (#7673)
If OpenWRT isn't running the DHCP server then some OpenWRT hardware,
such as TP-Link TL-WDR3600 v1, can't determine the host
corresponding to an associated wifi client. This change handles that
by returning None when the request has no data in the result.
2017-05-21 17:26:05 -07:00
LvivEchoes
99ea1e3f4f Continue tracking device over dhcp lease table if wireless adapter not installed (#7690) 2017-05-21 17:18:55 -07:00
Anders Melchiorsen
bb8de5845a Sort entities in default groups by name (#7681)
* Sort entities in default groups by name

* Cleanups from review
2017-05-21 17:05:48 -07:00
cgtobi
b3cb057aac Fix playback control of web streams (#7683)
Web streams can't be paused and resumed later. That's why volumio stops them instead of pausing them.
2017-05-21 17:05:04 -07:00
Eugenio Panadero
922303fd4b Fix telegram chats (#7689)
* bugfix for Telegram chat_ids

- Negative `chat_id`s for groups.
- Include `chat_id` in event data.
- Handle KeyError when receiving other types of messages, as `new_chat_member` ones, and send them as text.

* unused import

* fix double quote style, fix boolean expr, change warning msg

* mistake

* some more fixes

- fix if condition for msg bad fields.
- return True for a correct but not allowed or not recognized message: if not, the message arrives continuously.
- Allow to receive messages from unauthorized users if they come from authorized groups.

* support for `edited_message`s

- They come as normal messages, except for the 'edited_message' field instead of 'message'.
2017-05-21 17:02:22 -07:00
Adam Mills
8c1181f8e3 Remove defunct INSTALL_OPENZWAVE from Dockerfile (#7697) 2017-05-21 17:01:42 -07:00
John Arild Berentsen
4a0d6e73f4 ZWave: Add reset service to meters (#7676)
* Add reset service for command_class meters.

* Add reset service for command_class meters.

* cast index to const.py
2017-05-21 20:15:24 +02:00
Paulus Schoutsen
171086229a Guard against new and removed state change events (#7687) 2017-05-21 07:41:33 -07:00
Andrey
927024714b Zwave: Apply refresh_node workaround on 1st instance only (#7579)
* Apply refresh_node workaround on 1st instance only

* Add another test
2017-05-21 17:33:42 +03:00
tobygray
24b7fd3694 zoneminder: fix incorrect use of logging.exception. (#7675)
Prior to this change the zoneminder component was attempting to
use logging.exception outside of exception handling code. This
would lead to the traceback module throwing an exception when
trying to work out the traceback for the exception.

This fixes the issue by changing the exception call into a
plain error logging call.
2017-05-21 11:11:33 +02:00
Paulus Schoutsen
d6f43ba839 Version bump to 0.45.1 2017-05-20 22:34:59 -07:00
Paulus Schoutsen
3492545ec1 Update state automation to work with new and deleted state changes 2017-05-20 22:34:53 -07:00
Fabian Affolter
ceff9981be Merge branch 'master' into dev 2017-05-21 00:47:42 +02:00
Fabian Affolter
70ea16bdc0 Merge pull request #7648 from home-assistant/release-0-45
0.45
2017-05-21 00:34:44 +02:00
Marcelo Moreira de Mello
943958b140 Added support to Amcrest camera to feed using RTSP via ffmpeg (#7646)
* Implemented ffmpeg option on Amcrest camera and upgraded to version 1.2.0

* Added ffmpeg arguments and binary options to Amcrest camera

* Added ffmpeg as dependencies

* Makes lint happy and fixed requirements_all.txt

* Inherent the ffmpeg.binary configuration from ffmpeg component

* Update amcrest.py
2017-05-20 23:55:15 +02:00
John Arild Berentsen
23c5fc0aad Bugfix #7586 (#7661) 2017-05-20 23:53:48 +02:00
Fabian Affolter
45b4ef46cc Align with OpenALPR platform for naming conf variables (#7650) 2017-05-20 23:51:16 +02:00
Andrey
44edf3e105 Switch pymodbus to pypi (#7677) 2017-05-20 21:19:22 +02:00
Anders Melchiorsen
81f0826550 Ignore attribute changes in automation trigger from/to (#7651)
* Ignore attribute changes in automation trigger from/to

* Quote names in deprecation warnings

This makes it somewhat easier to read if the suggestion happens to be
named "to".

* Add test with same state, new attribute value
2017-05-20 15:18:59 -04:00
Barry Williams
adde9e6231 Upgrade Openhome library (#7671)
* Added support for openhome devices using transport service

* Style cleanup
2017-05-20 17:43:35 +02:00
Paulus Schoutsen
de85d38aa5 Update frontend 2017-05-20 08:08:06 -07:00
Paulus Schoutsen
f637a07016 Update frontend 2017-05-20 08:07:32 -07:00
thecynic
9e153119ef Point pylutron to pypi (#7664) 2017-05-20 14:27:35 +03:00
Fabian Affolter
b5c54864ac Change line endings to LN (#7660) 2017-05-19 07:39:13 -07:00
Paulus Schoutsen
d369d70ca5 Fix tests (#7659)
* Remove global hass

* Http.auth test no longer spin up server

* Remove server usage from http.ban test

* Remove setupModule from test device_sun_light_trigger

* Update common.py
2017-05-19 07:37:39 -07:00
John Arild Berentsen
5aa72562a7 Bugfix #7586 (#7661) 2017-05-19 13:40:26 +02:00
Robbie Trencheny
c4da921cb5 Add network_key as a config option (#7637)
* Add network_key as a config option

* Update __init__.py
2017-05-18 23:49:37 -07:00
Robbie Trencheny
7daa92249a Add network_key as a config option (#7637)
* Add network_key as a config option

* Update __init__.py
2017-05-18 23:49:15 -07:00
John Arild Berentsen
4a3d9a956d Final tweaks for Zwave panel (#7652)
* # This is a combination of 3 commits.
# The first commit's message is:
Add seperate zwave panel

# The 2nd commit message will be skipped:

#	unused import

# The 3rd commit message will be skipped:

#	Use get for config

* Add seperate zwave panel

* Modify set_config_parameter to accept setting string values

* descriptions

* Tweaks

* Tweaks

* Tweaks

* Tweaks

* lint

* Fallback if no config parameteres are available

* Update services.yaml

* review changes
2017-05-18 17:41:31 -07:00
Paulus Schoutsen
6662b7f52d Update frontend 2017-05-18 17:41:26 -07:00
Paulus Schoutsen
e91fe94585 Update frontend 2017-05-18 17:41:03 -07:00
John Arild Berentsen
88ffe39945 Final tweaks for Zwave panel (#7652)
* # This is a combination of 3 commits.
# The first commit's message is:
Add seperate zwave panel

# The 2nd commit message will be skipped:

#	unused import

# The 3rd commit message will be skipped:

#	Use get for config

* Add seperate zwave panel

* Modify set_config_parameter to accept setting string values

* descriptions

* Tweaks

* Tweaks

* Tweaks

* Tweaks

* lint

* Fallback if no config parameteres are available

* Update services.yaml

* review changes
2017-05-18 17:39:31 -07:00
happyleavesaoc
e479324db9 update usps (#7655)
* update usps

* fix doc
2017-05-18 17:30:43 -07:00
happyleavesaoc
f65cc68705 bump ups version (#7654) 2017-05-18 23:38:50 +02:00
happyleavesaoc
238921b681 bump fedex version (#7653) 2017-05-18 23:37:39 +02:00
Marcelo Moreira de Mello
0fd415d7fb Added support to Amcrest camera to feed using RTSP via ffmpeg (#7646)
* Implemented ffmpeg option on Amcrest camera and upgraded to version 1.2.0

* Added ffmpeg arguments and binary options to Amcrest camera

* Added ffmpeg as dependencies

* Makes lint happy and fixed requirements_all.txt

* Inherent the ffmpeg.binary configuration from ffmpeg component

* Update amcrest.py
2017-05-18 10:06:24 +02:00
Fabian Affolter
0eb6540fe7 Align with OpenALPR platform for naming conf variables (#7650) 2017-05-18 09:57:38 +02:00
Paulus Schoutsen
fc0c8540d3 Version bump to 0.46.0.dev0 2017-05-17 23:03:47 -07:00
Paulus Schoutsen
eb473600f6 Version bump to 0.45 2017-05-17 23:03:27 -07:00
Paulus Schoutsen
de999d8439 Merge remote-tracking branch 'origin/master' into dev 2017-05-17 23:03:00 -07:00
Paulus Schoutsen
6d97546f40 Update frontend 2017-05-17 22:29:46 -07:00
Paulus Schoutsen
e773133bcf Fix automation failing to setup if no automations specified (#7647) 2017-05-17 21:57:50 -07:00
Anders Melchiorsen
3d4b2436db Coerce color_temp to int even when passed in as kelvin (#7640) 2017-05-17 19:20:59 -07:00
Paulus Schoutsen
a068efcd47 Abort tests when instances leaked (#7623) 2017-05-18 00:19:40 +02:00
Fabian Affolter
f86edd4f24 Seven segments OCR image processing (#7632)
* Add initial seven segments OCR image processing

* Fix typo
2017-05-18 00:07:02 +02:00
Daniel Perna
a24aebd5ae Updated dependency (#7638) 2017-05-17 23:57:34 +02:00
Riccardo Canta
f3b9e1e988 Osram lightify Removed wrong assignment (#7615)
self._brightness is assigned with the returned value of the
set_luminance() function, which is always equal to None.
2017-05-17 23:26:58 +02:00
corneyl
76b747edd6 Updated limitlessled requirement to v1.0.8 (#7629) 2017-05-17 09:05:34 -07:00
Eugenio Panadero
f7d25396a4 Kodi specific service to call Kodi API methods (#7603)
* Kodi specific services to call Kodi API methods

 - new service: `kodi_execute_addon` to run a Kodi Addon with optional parameters. Results of the Kodi API call, if any, are redirected in a Home Assistant event: `kodi_execute_addon_result`.
 - new service: `kodi_run_method` to run a Kodi JSONRPC API method with optional parameters. Results of the Kodi API call are redirected in a Home Assistant event: `kodi_run_method_result`.
 - Add descriptions in services.yaml.
 - Add `timeout` parameter to yaml config (needed to make slow queries to the JSONRPC API, default timeout is set to 5s).
 - Trigger events with the results of the Kodi API calls, with:
 ```
 event_data = {
   'result': api_call_results,
   'result_ok': boolean,
   'input': api_call_parameters,
   'entity_id': 'media_player.kodi'}
```

* no need to clean OrderedDicts; no need for the `kodi_execute_addon` service

* no need for the `kodi_execute_addon` service

* unused import

* naming changes
2017-05-17 08:42:47 -04:00
Fabian Affolter
0e9728d94a Update docstrings (#7630) 2017-05-17 10:10:35 +02:00
Fabian Affolter
3b69de8a1a Upgrade Sphinx to 1.6.1 (#7624) 2017-05-17 09:14:28 +02:00
Fabian Affolter
f0b2a6d0e6 Update docstrings and comments (#7626) 2017-05-17 09:14:11 +02:00
Conrad Juhl Andersen
d2ed3a131f Add support for disabling tradfri groups (#7593)
* Add support for disabling tradfri groups

* Fixed styleguide problems

* Fix style problems

* Use default for groups when setting up in UI
2017-05-16 23:26:57 -07:00
Anders Melchiorsen
ed5f94fd8a Add kelvin/brightness_pct alternatives to light.turn_on (#7596)
* Refactor color profiles to a class

* Refactor into preprocess_turn_on_alternatives

* LIFX: use light.preprocess_turn_on_alternatives

This avoids the color_name duplication and gains support for profile.

* Add kelvin parameter to light.turn_on

* Add brightness_pct parameter to light.turn_on

* LIFX: accept brightness_pct in effects

* Add test of kelvin/brightness_pct conversions
2017-05-16 23:00:46 -07:00
Greg Dowling
9dcc0b5ef5 Bump pyvera - fixes issue with % in brightness levels. (#7622) 2017-05-16 20:01:29 -07:00
Fabian Affolter
1fafa34eb1 Fix typo and update style to match the other platforms (#7621) 2017-05-16 21:57:00 +02:00
Ole-Kenneth
71ed17b836 Add Content-type: image/jpeg for camera proxy (#7581)
* Add Content-type: image/jpeg for camera proxy

* Set content_type in constructur
2017-05-16 09:11:44 -07:00
Philipp Schmitt
a7f933966b Update Docker base image to python 3.6 (#7613) 2017-05-16 09:09:21 -07:00
Paulus Schoutsen
641ba014f2 Update frontend 2017-05-15 23:17:33 -07:00
Paulus Schoutsen
d5ca6a5aed Force automation ids to always be a string (#7612) 2017-05-15 23:15:06 -07:00
Marc Egli
d6081f3dc5 Make miflora monitored_conditions parameter optional (#7598)
* Make miflora monitored_conditions parameter optional.

* Use default keyword instead.

* Use list instead of tuple

* Simplify even more
2017-05-15 23:13:41 -07:00
Fabian Affolter
f25347d98d File sensor (#7569)
* Add File sensor

* Use None and return

* Remove I/O

* Use less memory

* No traceback if file is empty
2017-05-15 14:25:46 +02:00
John Mihalic
a1dc35fc75 Fix handling of single user (#7587) 2017-05-15 00:46:43 -07:00
Marc Egli
4da91d6a8b Add sonos alarm clock update service (#7521)
* Add sonos alarm clock update service

* Add tests and break lines

* Fix style errors

* Make test work with python<3.6

* Fix last two pylint errors

* fix new line to long errors
2017-05-15 00:42:45 -07:00
jhemzal
5c4a21efac Add posibility to specify snmp protocol version (#7564)
* snmp sensor protocol version configuration option

* fixed lint findings.
2017-05-15 00:34:51 -07:00
Adam Mills
e2e58e6acc Automation State Change For timer attribute fix (#7584) 2017-05-15 00:34:30 -07:00
Eugenio Panadero
d0304198de SMTP notify enhancements: full HTML emails and custom product_name in email headers (#7533)
* SMTP notify enhancements: HTML emails and customization options

- Send full HTML emails, with or without inline attached images.
- Custom `timeout`.
- Custom `product_name` identifier for the `FROM` and `X-MAILER` email headers.
- New HTML email test

* `sender_name` instead of product_name

 - Change `sender_name` instead of `product_name`.
 - No changes in `X-Mailer` header.
 - `From` header as always unless you define the new `sender_name` parameter.
2017-05-15 00:23:57 -07:00
Paulus Schoutsen
36d7fe72eb Fix websocket api reaching queue (#7590)
* Fix websocket api reaching queue

* Fix outside task message sending

* Fix Py34 tests
2017-05-15 00:10:06 -07:00
Marc Egli
6d245c43fc Pass additional arguments to tox in test_docker (#7591) 2017-05-14 23:21:39 -07:00
Matt N
e1a4d51fa2 camera.zoneminder: Handle old versions of zoneminder (#7589) 2017-05-13 23:09:44 -07:00
Paulus Schoutsen
352cca1037 Remove more test requirements (#7574)
* No longer require pyunify during tests

* No longer require cast during tests

* No longer required dependency for tests

* No longer require pymochad for tests

* Astral is a core dependency

* Avoid having to install datadog dependency during tests

* CMUS test doesn't test anything

* Frontier Silicon doesn't test anything

* No longer require mutagen

* Update requirements_test_all.txt

* Remove stale comment
2017-05-13 21:25:54 -07:00
Paulus Schoutsen
206d02d531 Websocket_api: avoid parallel drain (#7576)
* Websocket_api: avoid parallel drain

* Remove send_message method
2017-05-13 16:34:45 -07:00
William Scanlon
cfbbade6d1 Additional Wink lock features (#7445)
* Additional Wink lock features
2017-05-13 14:09:00 -04:00
Adam Mills
cfea4b17e3 Add tests for zwave network events (#7573) 2017-05-12 23:06:32 -07:00
Stu Gott
9c4bc2a47f Add Kira component to sensor and remote platforms (#7479)
* Add Kira component to sensor and remote platforms

* Test cases for Kira component and platforms
2017-05-12 21:12:47 -07:00
Eugenio Panadero
4cdf0b4969 Fix Kodi specific services registry and add descriptions (#7551)
* Fix Kodi specific services, add descriptions, add more handled exceptions

 - Fixes issue #7528
 - Add descriptions for Kodi specific services in services.yaml.
 - Error handling in Kodi API errors.
 - Make compatible the existent specific service `media_player.kodi_set_shuffle` with the general `media_player.shuffle_set` service (both use the same method but with different named parameter, I think the Kodi specific service should be eliminated, since it is not)

* fix line too long

* removed new services (for another PR); removed `kodi_set_shuffle` service

* requested changes

 - Removed `kodi_set_shuffle` service.
 - Optional `media_name` and `artist_name` parameters. `media_name` defaults to 'ALL'.
 - Guard clause to check if the services are already registered.
2017-05-12 20:48:57 -07:00
bestlibre
ad15844cf4 Fix systematic warning in influxdb sensor (#7541) 2017-05-12 20:47:12 -07:00
Kevin Fronczak
25cb7c652b Blink version bump (#7571)
Bumped blink version to support automatic reauthorization when tokens expire. Changed the battery sensor call to a string version so that the battery reports back "Low" or "OK" rather than a cryptic integer
2017-05-12 20:30:07 -07:00
Adam Mills
189023821b Tests for zwave setup features (#7570)
* Tests for zwave setup features

* Add test for frontend panel register
2017-05-12 20:27:44 -07:00
Adam Mills
c118be6639 Tests for zwave discovery logic (#7566)
* Tests for zwave discovery logic

* Simplify patching

* Test ignored node
2017-05-12 20:18:20 -07:00
Mitesh Patel
11a3dc268f Support lutron serena shades (#7565)
* Adds support for the Lutron Caseta Serena shades hardware

* fixes typos
2017-05-12 20:17:11 -07:00
Paulus Schoutsen
f0ce6c8210 Update netdisco (#7563) 2017-05-12 20:14:17 -07:00
Juggels
ed0ec613c3 Comment RasPi specific requirements (#7562) 2017-05-12 20:06:28 -07:00
Johan Bloemberg
4a3048b370 Initialize sun with correct values. (#7559)
* Initialize sun with unknown values.

Initial values should be `unknown` instead of `0`. Otherwise on HA restart the value of `0` is pushed to metrics databases (graphite/influx/recorder).

* Update sun position before emitting initial update

* Simplify based on armills comment.

* Use provided time for calculation.
2017-05-12 16:04:30 -07:00
Per Osbäck
fdb7371256 update pywebpush to 1.0.0 (#7561) 2017-05-12 09:25:34 -07:00
florincosta
a96a98a260 Add raspihats binary sensor (#7508)
* Added raspihats binary_sensor platform

* Updated .coveragerc to ommit raspihats platforms.

* Using vol.Coerce(int) for validation and casting of I2CHat config address
2017-05-12 09:20:48 -07:00
Anders Melchiorsen
1ab7103aea LIFX: add lifx_set_state service call (#7552)
* Move service helpers to LifxManager

* Add lifx_set_color

This is a synonym for light.turn_on except it does not actually turn on the
light unless asked to.

Thus, turn_on can be implemented just by asking.

* Rename set_color to set_state

* Support power=False with lifx_set_state
2017-05-12 09:19:51 -07:00
Kane610
416b8e0efe Axis component (#7381)
* Added Axis hub, binary sensors and camera

* Added Axis logo to static images

* Added Axis logo to configurator
Added Axis mdns discovery

* Fixed flake8 and pylint comments

* Missed a change from list to function call
V5 of axis py

* Added dependencies to requirements_all.txt

* Clean up

* Added files to coveragerc

* Guide lines says to import function when needed, this makes Tox pass

* Removed storing hass in config until at the end where I send it to axisdevice

* Don't call update in the constructor

* Don't keep hass private

* Unnecessary lint ignore, following Baloobs suggestion of using NotImplementedError

* Axis package not in pypi yet

* Do not catch bare excepts. Device schema validations raise vol.Invalid.

* setup_device still adds hass object to the config, so the need to remove it prior to writing config file still remains

* Don't expect axis.conf contains correct values

* Improved configuration validation

* Trigger time better explains functionality than scan interval

* Forgot to remove this earlier

* Guideline says double qoutes for sentences

* Return false from discovery if config file contains bad data

* Keys in AXIS_DEVICES are serialnumber

* Ordered imports in alphabetical order

* Moved requirement to pypi

* Moved update callback that handles trigger time to axis binary sensor

* Renamed configurator instance to request_id since that is what it really is

* Removed unnecessary configurator steps

* Changed link in configurator to platform documentation

* Add not-context-manager (#7523)

* Add not-context-manager

* Add missing comma

* Threadsafe configurator (#7536)

* Make Configurator thread safe, get_instance timing issues breaking configurator working on multiple devices

* No blank lines allowed after function docstring

* Fix comment Tox

* Added Axis hub, binary sensors and camera

* Added Axis logo to static images

* Added Axis logo to configurator
Added Axis mdns discovery

* Fixed flake8 and pylint comments

* Missed a change from list to function call
V5 of axis py

* Added dependencies to requirements_all.txt

* Clean up

* Added files to coveragerc

* Guide lines says to import function when needed, this makes Tox pass

* Removed storing hass in config until at the end where I send it to axisdevice

* Don't call update in the constructor

* Don't keep hass private

* Unnecessary lint ignore, following Baloobs suggestion of using NotImplementedError

* Axis package not in pypi yet

* Do not catch bare excepts. Device schema validations raise vol.Invalid.

* setup_device still adds hass object to the config, so the need to remove it prior to writing config file still remains

* Don't expect axis.conf contains correct values

* Improved configuration validation

* Trigger time better explains functionality than scan interval

* Forgot to remove this earlier

* Guideline says double qoutes for sentences

* Return false from discovery if config file contains bad data

* Keys in AXIS_DEVICES are serialnumber

* Ordered imports in alphabetical order

* Moved requirement to pypi

* Moved update callback that handles trigger time to axis binary sensor

* Renamed configurator instance to request_id since that is what it really is

* Removed unnecessary configurator steps

* Changed link in configurator to platform documentation

* No blank lines allowed after function docstring

* No blank lines allowed after function docstring

* Changed discovery to use axis instead of axis_mdns

* Travis CI requested rerun of script/gen_requirements_all.py
2017-05-12 08:51:54 -07:00
Andrey
5b3ef0f76f Treat swing and fan level as optional in Sensibo Climate. (#7560) 2017-05-12 18:28:58 +03:00
Tsvi Mostovicz
452c3a1b25 Support adding different server locations for Microsoft face component (#7532)
* Support adding different server locations

* Rename variables and move CONF_ const into component as requested in review

* Fix unittests

* Forgot to add tests for microsoft_face_identify
2017-05-12 10:53:25 +02:00
Paulus Schoutsen
8da10f670b Only install tox in dev mode (#7557) 2017-05-12 00:01:06 -07:00
Adam Mills
b805d8a844 Hide proximity updates in logbook (#7549) 2017-05-11 19:37:32 -07:00
Paulus Schoutsen
76675a54f8 Do not install all dependencies in dev mode (#7548)
* ps - do not install all dependencies

* Comment out blinkt because it depends on GPIO

* Add pip upgrade check back

* Disable import error blinkt

* Update comment

* Fix comment
2017-05-11 19:20:23 -07:00
Trevor
0e246059f9 Add SSL support to NZBGet sensor (#7553) 2017-05-11 23:05:06 +02:00
Fabian Affolter
0e41342a40 Upgrade dweepy to 0.3.0 (#7550) 2017-05-11 22:48:03 +02:00
Adam Mills
04f1054d07 Automatic version bump (#7555) 2017-05-11 22:47:47 +02:00
Fabian Affolter
966bda079e Upgrade sendgrid to 4.1.0 (#7538) 2017-05-11 09:06:22 -07:00
jumpkick
ef4587f994 Fix for #7459 (#7544)
* Generate a new updateDate with every call

This should fix #7459
Tests need to be updated in another commit.

* Replace STATIC_TIME with datetime object check

Removing the "DATE" argument from the Alexa component's configuration (because it is now dynamically generated) requires this commit's changes to the test cases to check that the updateDate data is a datetime type rather than a specific hardcoded value ('2016-10-10T19:51:42.0Z').

* Fix brackets
2017-05-11 09:04:17 -07:00
Kane610
2c8f6a0ad0 Threadsafe configurator (#7536)
* Make Configurator thread safe, get_instance timing issues breaking configurator working on multiple devices

* No blank lines allowed after function docstring

* Fix comment Tox
2017-05-11 10:24:36 +03:00
Fabian Affolter
8cdadd2aa0 Add not-context-manager (#7523)
* Add not-context-manager

* Add missing comma
2017-05-11 09:14:52 +02:00
Fabian Affolter
3bdf77ad62 Add myStrom binary sensor (#7530) 2017-05-10 16:58:03 +02:00
Adam Mills
8c90fd19ff Try to request current_location Automatic scope (#7447) 2017-05-10 05:44:52 -07:00
Fabian Affolter
71b4afb780 Update docstrings and log messages (#7526) 2017-05-10 12:06:57 +02:00
corneyl
6e6a000217 Upgrade limitlessled to 1.0.7 (#7525) 2017-05-10 10:45:33 +02:00
Bas Schipper
85e71fc785 Support for the PiFace Digital I/O module (#7494)
* Added rpi_pfio component supporting the PiFace I/O module

* Fixed some code style issues

* Removed global listener

* Update rpi_pfio.py
2017-05-09 22:36:33 -07:00
Fabian Affolter
216199556a Don't interact with hass directly (#7099) 2017-05-09 21:56:17 -07:00
Nuno Sousa
89d950c73a Add password parameter to uvc component (#7499) 2017-05-09 21:54:38 -07:00
Eugenio Panadero
b30c352e37 Telegram Bot enhancements with callback queries and new notification services (#7454)
* telegram_bot and notify.telegram enhancements:
- Receive callback queries and produce `telegram_callback` events.
- Custom reply_markup (keyboard or inline_keyboard) for every type of message (message, photo, location & document).
- `disable_notification`, `disable_web_page_preview`, `reply_to_message_id` and `parse_mode` optional keyword args.
- Line break between title and message fields: `'{}\n{}'.format(title, message)`
- Move Telegram notification services to `telegram_bot` component and forward service calls from the telegram notify service to the telegram component, so now the `notify.telegram` platform depends of `telegram_bot`, and there is no need for `api_key` in the notifier configuration. The notifier calls the new notification services of the bot component:
	- telegram_bot/send_message
	- telegram_bot/send_photo
	- telegram_bot/send_document
	- telegram_bot/send_location
	- telegram_bot/edit_message
	- telegram_bot/edit_caption
	- telegram_bot/edit_replymarkup
	- telegram_bot/answer_callback_query
- Added descriptions of the new notification services with a services.yaml file.
- CONFIG_SCHEMA instead of PLATFORM_SCHEMA for the `telegram_bot` component, so only one platform is allowed.
- Async component setup.

* telegram_bot and notify.telegram enhancements: change in requirements_all.txt.
2017-05-09 21:42:17 -07:00
Gergely Imreh
1312ee0f7d sensor.envirophat: do not set up platform if hardware is not attached (#7438)
* sensor.envirophat: do not set up platform if hardware is not attached

Fixes comment from:
https://github.com/home-assistant/home-assistant/pull/7427#discussion_r114703904

* Fix update logic.
2017-05-09 21:29:38 -07:00
Andrey
f4915ddb0b Switch basicmodem and python-roku to pypi (#7514) 2017-05-09 20:23:19 -07:00
Marc Egli
43296069c3 Update docker dev environment to python3.6 (#7520)
* Update docker dev environment to python3.6

* comment out disable switches again
2017-05-09 20:16:46 -07:00
John Arild Berentsen
1eaec8f406 Zwave panel api (#7456)
* # This is a combination of 3 commits.
# The first commit's message is:
Add seperate zwave panel

# The 2nd commit message will be skipped:

#	unused import

# The 3rd commit message will be skipped:

#	Use get for config

* Add seperate zwave panel

* more info

* Add usercodeview

* Improve api

* Improve api

* Separate api into own file.

* disable missing import

* review changes

* Tests 1

* Verify that we fetch data from groups

* Tests groups

* config 1

* usercode 1

* Api mods

* Tweak API

* docstrings

* 100% api testing
2017-05-09 18:56:41 -07:00
Paulus Schoutsen
5d820ec188 Add support for automation config panel (#7509)
* Add support for automation config

* Build fromtend

* Lint
2017-05-09 18:44:00 -07:00
Marc Egli
d86dfb6336 Fix sonos sleep timer (#7503) 2017-05-09 18:35:51 +02:00
Josh Anderson
b34c58386c Correct retrieval of spotify shuffle state (#7505)
Returned on the current playback response itself, not the device
2017-05-09 17:35:30 +02:00
abmantis
5cb3382425 new source only forces "play" if the current state is "playing" (#7506) 2017-05-09 17:34:17 +02:00
Adam Mills
40d27cde0e Refactor sun component for correctness (#7295)
* Refactor sun component for correctness

* Convert datetimes to dates for astral

* Fix tests for updated code

* Fix times now that calcs are fixed

* Move sun functions to helpers

* Fix flake on new file

* Additional tweaks from review

* Update requirements
2017-05-09 00:03:34 -07:00
Oliver
419d97fc06 Fixed potential AttributeError when checking for deleted sources (#7502) 2017-05-09 07:24:18 +02:00
Andrey
1cd51bc6a8 Switch onkyo to pypi (#7497) 2017-05-09 08:13:29 +03:00
Fabian Affolter
c12c742297 Upgrade beautifulsoup4 to 4.6.0 (#7491) 2017-05-08 19:39:40 +02:00
Johan Bloemberg
ce879b7eb8 Prevent printing of packets. (#7492)
A small bug in the python-rflink library caused packets to be printed. This update prevents this from happening.
2017-05-08 17:04:17 +02:00
Fabian Affolter
d7e3962cc0 Upgrade async_timeout to 1.2.1 (#7490) 2017-05-08 17:02:37 +02:00
Anders Melchiorsen
86b34b40a1 LIFX: avoid out-of-bounds hue aborting the colorloop effect (#7495)
The hue is now a float but the hsbk conversion still believed it to be
an integer that could not be larger than 359. The float can in fact be,
for example, 359.9 and this would cause an out-of-bounds error in the
set_color call.

For completeness, the initial hue is also changed to a float.
2017-05-08 16:51:27 +02:00
Paulus Schoutsen
12293d6600 0.44.2 (#7488)
* Version bump to 0.44.2

* Update frontend
2017-05-07 22:07:52 -07:00
Mitesh Patel
66cbdc3043 Uses pypi for deps (#7485) 2017-05-07 17:32:13 -07:00
Paulus Schoutsen
e1d1385358 Fix travis 2017-05-07 16:55:22 -07:00
Paulus Schoutsen
bafc04ca42 Update tox.ini 2017-05-07 16:53:28 -07:00
Paulus Schoutsen
5717c87097 Update tox.ini 2017-05-07 16:51:46 -07:00
Paulus Schoutsen
ab9c394e93 Version bump to 0.44.1 2017-05-07 15:09:53 -07:00
Paulus Schoutsen
5d13f36a4b Merge pull request #7482 from home-assistant/release-0-44-1
0.44.1
2017-05-07 15:08:37 -07:00
Caleb
4165629f97 Update to pyunifi 2.12 (#7468)
* Update to pyunifi 2.12

* Update requirements_all.txt
2017-05-07 14:03:39 -07:00
Marc Egli
f87b9b7b85 Fix plant MIN_TEMPERATURE, MAX_TEMPERATURE validation (#7476)
* Fix plant MIN_TEMPERATURE, MAX_TEMPERATURE validation

small_float only allows values from 0 to 1 so we should use float instead

* Do not use vol.All for a single validation
2017-05-07 14:03:14 -07:00
Martin Hjelmare
2ab45441a8 Upgrade pymysensors to 0.10.0 (#7469) 2017-05-07 14:02:53 -07:00
pezinek
fcdfebefd9 Forecasts for weather underground (#7062) 2017-05-07 13:56:19 -07:00
Brian Cribbs
9b920b3b40 fixing nits 2017-05-07 13:56:05 -07:00
Brian Cribbs
0c94df9fcf fixing documentation 2017-05-07 13:56:05 -07:00
Brian Cribbs
1ba4435693 repairing functionality for non-zero based ranges 2017-05-07 13:56:05 -07:00
Paulus Schoutsen
00ec50da4b Update frontend 2017-05-07 13:50:07 -07:00
Marc Egli
c1056ea4d4 Fix plant MIN_TEMPERATURE, MAX_TEMPERATURE validation (#7476)
* Fix plant MIN_TEMPERATURE, MAX_TEMPERATURE validation

small_float only allows values from 0 to 1 so we should use float instead

* Do not use vol.All for a single validation
2017-05-07 15:15:18 +02:00
Paulus Schoutsen
9440ff881f Remove listening to homeassistant_start with event automation (#7474) 2017-05-06 23:52:39 -07:00
Robbie Trencheny
c525ee9daa Make this an error instead of an info 2017-05-06 23:11:11 -07:00
Paulus Schoutsen
79ca47640e Update requirements_test_all.txt 2017-05-06 23:02:12 -07:00
Caleb
41212b90c4 Update to pyunifi 2.12 (#7468)
* Update to pyunifi 2.12

* Update requirements_all.txt
2017-05-06 22:39:21 -07:00
Paulus Schoutsen
aa6339818e Test only dependencies (#7472)
* Generate requirements file for tests

* Update tox

* Update validate

* Lint

* Tweak order in travis.yml to run longest job first
2017-05-06 22:37:31 -07:00
Paulus Schoutsen
305309a59e Upgrade Dockerfile to Python 3.6 (#7471) 2017-05-06 20:16:40 -07:00
Paulus Schoutsen
ea095de98e Demo: Update old group member thermostat.ecobee -> climate 2017-05-06 19:40:59 -07:00
Paulus Schoutsen
e8a33758c1 Capitalize group names in demo 2017-05-06 19:38:48 -07:00
Martin Hjelmare
47034f83f4 Upgrade pymysensors to 0.10.0 (#7469) 2017-05-06 19:10:17 -07:00
Andrey
2c1df75c07 Switch russound, pymysensors, and pocketcasts to pypi (#7449)
* Switch russound to pypi

* Switch pymysensors to pypi

* Switch pocketcasts to pypi
2017-05-07 02:22:38 +02:00
Paulus Schoutsen
43ff95ad3b Merge pull request #7444 from home-assistant/release-0-44
0.44
2017-05-06 10:38:45 -07:00
Josh Wright
e2559fd6cf Fix object type for default KNX port
#7429 describes a TypeError that is raised if the port is omitted in the config for the KNX component (integer is required (got type str)). This commit changes the default port from a string to an integer. I expect this will resolve that issue...
2017-05-06 10:27:36 -07:00
Gergely Imreh
abe6f9343f sensor.envirophat: add missing requirement (#7451)
Adding requirements that is not explicitly pulled in by the library
that manages the Enviro pHAT.
2017-05-06 10:27:17 -07:00
pezinek
7a70496b11 Forecasts for weather underground (#7062) 2017-05-06 10:11:31 -07:00
Adam Mills
7dd7f509ca Add tests for deprecation helpers (#7452) 2017-05-06 10:10:48 -07:00
Robbie Trencheny
6cc85adb81 Merge pull request #7460 from home-assistant/fix/default-knx-port
Fix object type for default KNX port
2017-05-05 18:03:46 -07:00
Josh Wright
2971a24c56 Fix object type for default KNX port
#7429 describes a TypeError that is raised if the port is omitted in the config for the KNX component (integer is required (got type str)). This commit changes the default port from a string to an integer. I expect this will resolve that issue...
2017-05-05 19:19:24 -04:00
Nuno Sousa
20ded1ba3e Add datadog component (#7158)
* Add datadog component

* Improve test_invalid_config datadog test

* Use assert_setup_component for test setup
2017-05-06 00:34:40 +02:00
Josh Wright
2e4ae3e73d PyPI Openzwave (#7415)
* Remove default zwave config path

PYOZW now has much more comprehensive default handling for the config
path (in src-lib/libopenzwave/libopenzwave.pyx:getConfig()). It looks in
the same place we were looking, plus _many_ more. It will certainly do a
much better job of finding the config files than we will (and will be
updated as the library is changed, so we don't end up chasing it). The
getConfig() method has been there for a while, but was subsntially
improved recently.

This change simply leaves the config_path as None if it is not
specified, which will trigger the default handling in PYOZW.

* Install python-openzwave from PyPI

As of version 0.4, python-openzwave supports installation from PyPI,
which means we can use our 'normal' dependency management tooling to
install it. Yay.

This uses the default 'embed' build (which goes and downloads
statically sources to avoid having to compile anything locally). Check
out the python-openzwave readme for more details.

* Add python-openzwave deps to .travis.yml

Python OpenZwave require the libudev headers to build. This adds the
libudev-dev package to Travis runs via the 'apt' addon for Travis.

Thanks to @MartinHjelmare for this fix.

* Update docker build for PyPI openzwave

Now that PYOZW can be install from PyPI, the docker image build process
can be simplified to remove the explicit compilation of PYOZW.
2017-05-05 14:57:14 -07:00
Gergely Imreh
4b5be750b2 sensor.envirophat: add missing requirement (#7451)
Adding requirements that is not explicitly pulled in by the library
that manages the Enviro pHAT.
2017-05-05 11:37:54 -07:00
florincosta
92411cdc18 Add new raspihats component (#7392)
* Add new raspihats component

* added raspihats to COMMENT_REQUIREMENTS in gen_requirements_all.py

* disabled pylint import errors

* using hass.data for storing i2c-hats manager
2017-05-05 00:02:47 -07:00
Daniel Høyer Iversen
94f7c397d7 Add hass to rfxtrx object (#6844) 2017-05-04 23:51:35 -07:00
Daniel Høyer Iversen
526abdd329 Add hass to rfxtrx object (#6844) 2017-05-04 23:50:53 -07:00
Paulus Schoutsen
61196b1c83 Version bump to 0.45.0.dev0 2017-05-04 21:41:32 -07:00
Paulus Schoutsen
03e3fb77c4 Version bump to 0.44 2017-05-04 21:41:11 -07:00
Anders Melchiorsen
bfd6110091 LIFX: handle unavailable lights gracefully
Recent aiolifx allow sending messages to unregistered devices (as a
no-op). This is handy because bulbs can disappear anytime we yield and
constantly testing for availability is both error-prone and annoying.

So keep the aiolifx device around until a new one registers on the same
mac_addr.
2017-05-04 21:40:35 -07:00
Anders Melchiorsen
71f9507df7 LIFX: fix color restore after running effects
State restoration takes up to a second because bulbs can be slow to react.
During this time an effect could keep running, overwriting the state that we
were trying to restore.

Now the effect forgets the light immediately and it thus avoids further
changes while the restored state settles.
2017-05-04 21:40:35 -07:00
Anders Melchiorsen
1c5eb88368 LIFX: avoid warnings about already running updates
Forcing a refresh will log a warning if the periodic async_update happens
to be running already.

So let's do the refresh locally and remove the force_refresh.
2017-05-04 21:40:35 -07:00
Anders Melchiorsen
4be89521d4 LIFX: Update aiolifx requirement
This update silences some warnings (frawau/aiolifx#7).
2017-05-04 21:40:35 -07:00
Anders Melchiorsen
1e4b56c4d4 LIFX: Move random hue initial color to the LIFXEffect base class
It's a reasonable default for several light effects.
2017-05-04 21:40:35 -07:00
Anders Melchiorsen
655b82c1e2 LIFX: Use 3500K as neutral white
This does not really matter because the colorloop uses saturated colors
(without much white). Anyway, just copy the 3500K that the LIFX app uses.
2017-05-04 21:40:35 -07:00
Anders Melchiorsen
81b567b68f LIFX: refresh state after stopping an effect
This clears the internal cache in case polling picked up the state as set by
an effect.

For example, aborting an effect by selecting a new brightness could keep a
color set by the effect.
2017-05-04 21:40:34 -07:00
Paulus Schoutsen
009a9d59ed Update frontend 2017-05-04 21:38:50 -07:00
Paulus Schoutsen
629bf3eefd Update frontend 2017-05-04 21:38:28 -07:00
Paulus Schoutsen
3b237795ba Merge branch 'release-0-44' into dev 2017-05-04 21:23:40 -07:00
Paulus Schoutsen
80e55fb286 Merge remote-tracking branch 'origin/master' into release-0-44 2017-05-04 21:23:18 -07:00
Robbie Trencheny
12910de9ae Merge pull request #7289 from jminardi/jminardi/tplink-logout
Log out of TP-Link router after devices are recorded.
2017-05-04 18:47:25 -07:00
Robbie Trencheny
2f686124c8 Merge pull request #7446 from amelchio/lifx-misc
LIFX: small error corrections
2017-05-04 18:45:14 -07:00
Robbie Trencheny
b59ca034ae Merge pull request #7393 from cribbstechnologies/dev
MQTT Cover: Fixed status reporting for range with non-zero base
2017-05-04 18:32:24 -07:00
Anders Melchiorsen
78a3f259d6 LIFX: handle unavailable lights gracefully
Recent aiolifx allow sending messages to unregistered devices (as a
no-op). This is handy because bulbs can disappear anytime we yield and
constantly testing for availability is both error-prone and annoying.

So keep the aiolifx device around until a new one registers on the same
mac_addr.
2017-05-04 22:51:00 +02:00
William Scanlon
1d0acb5a2c Get new token to keep pubnub updates working (#7437) 2017-05-04 13:17:35 -07:00
Daniel Perna
ea36c91919 Fix for broken virtual keys (#7439) 2017-05-04 13:15:36 -07:00
Greg Dowling
1d9f1487c3 Bump pyvera version - handle malformed json replies in poll thread. (#7440) 2017-05-04 13:14:36 -07:00
Nolan Gilley
d251621f2b Update join (#7443)
* update python-join-api to 0.0.2

* bump python-join-api to 0.0.2
2017-05-04 13:14:14 -07:00
William Scanlon
8d50045971 Suppress logs when octorpint goes offline (#7441)
* Suppress logs when octorpint goes offline

* Fixed line length
2017-05-04 13:13:09 -07:00
Philipp Schmitt
cc0299d046 Replace pymailgun with pymailgunner (#7436)
* mailgun: Replace pymailgun with pymailgunner

* Fix imports
2017-05-04 20:34:00 +03:00
Pascal Vizeli
7e539a3cb2 Add support for face recognition with dlib (#7421)
* Add support for face recognition with dlib

* fix lint

* fix lint p2

* update library

* dlib can not build

* fix lint

* Fix int p1

* Update dlib_face_detect.py

* Update dlib_face_detect.py

* Update dlib_face_detect.py
2017-05-04 16:03:50 +02:00
deisi
e3bb45c906 Added osramlightify groups. (#7376)
* Added osramlighrify groups.

Allows you to make use of the build in osram lightify groups. Group states get
handeled similar as in the case of phillips hue. A lightify group shows up as
light in the homeassistant webinterface. If one light of the
group is on, the complete group is considered to be on.

To use this feature, first define some groups within your lighrify bridge, then
set add `allow_lightify_groups=true` to you osramlightify config.

It might look like:
````yaml
- platform: osramlightify
  host: IP-ADDRES
  allow_lightify_groups: true
```

* Fixed Pylint errors.

* Included requests.

* Included more requests.

* Fixed setup bridge and removed _light attribute.

* Update osramlightify.py
2017-05-03 23:11:27 -07:00
Gergely Imreh
df13352989 Add new sensor: Enviro pHAT (#7427)
* Add new sensor: Enviro pHAT

Add support for the Enviro pHAT for Raspberry Pi, see hardware
info at https://shop.pimoroni.com/products/enviro-phat

* Move update to add_devices call
2017-05-03 22:59:50 -07:00
Nolan Gilley
05a3c463bf update for pypi (#7430) 2017-05-04 07:48:43 +02:00
Fabian Affolter
c44ebbefc4 Upgrade temperusb to 1.5.3 (#7428) 2017-05-04 07:46:43 +02:00
Paulus Schoutsen
fab533de87 ps - fix websocket yielding pt2 (#7434) 2017-05-03 21:12:08 -07:00
Paulus Schoutsen
ad5a9bf5ac wsock.send_json is a coroutine (#7433) 2017-05-03 20:27:03 -07:00
Paulus Schoutsen
c5a91393e4 Guard against no content type (#7432) 2017-05-03 20:12:51 -07:00
Anders Melchiorsen
494a776959 LIFX: avoid warnings about already running updates
Forcing a refresh will log a warning if the periodic async_update happens
to be running already.

So let's do the refresh locally and remove the force_refresh.
2017-05-04 00:21:24 +02:00
Anders Melchiorsen
193270c4fb LIFX: Update aiolifx requirement
This update silences some warnings (frawau/aiolifx#7).
2017-05-04 00:21:24 +02:00
Anders Melchiorsen
ec490070ca LIFX: Move random hue initial color to the LIFXEffect base class
It's a reasonable default for several light effects.
2017-05-04 00:21:24 +02:00
Anders Melchiorsen
8233f086cd LIFX: Use 3500K as neutral white
This does not really matter because the colorloop uses saturated colors
(without much white). Anyway, just copy the 3500K that the LIFX app uses.
2017-05-04 00:21:24 +02:00
Anders Melchiorsen
99e34539b9 LIFX: fix color restore after running effects
State restoration takes up to a second because bulbs can be slow to react.
During this time an effect could keep running, overwriting the state that we
were trying to restore.

Now the effect forgets the light immediately and it thus avoids further
changes while the restored state settles.
2017-05-04 00:21:24 +02:00
Anders Melchiorsen
71d909483c LIFX: refresh state after stopping an effect
This clears the internal cache in case polling picked up the state as set by
an effect.

For example, aborting an effect by selecting a new brightness could keep a
color set by the effect.
2017-05-04 00:21:24 +02:00
Anders Melchiorsen
dbd6f7e4ed Reverse limitlessled color_temp range (#7359)
Reverse limitlessled color_temp range
2017-05-03 23:32:49 +02:00
Andrey
403a721e91 Comment out opencv-python that is not installable on arm (#7426)
* Comment out opencv-python that is not installable on arm

* Disable import-error
2017-05-03 21:08:21 +03:00
Paulus Schoutsen
af5439860f Update opencv.py 2017-05-03 08:29:17 -07:00
Paulus Schoutsen
0f94c8a2e7 ps - fix opencv (#7419)
* ps - fix opencv

* fix lint
2017-05-03 12:15:04 +02:00
Fabian Affolter
203f48cadc Update docstrings (#7420) 2017-05-03 10:11:39 +02:00
Luar Roji
1a74c41056 Fixed extra R in variable name. (#7418) 2017-05-03 08:32:19 +02:00
Teagan Glenn
b321e0ef80 Opencv (#7261)
* OpenCV

* Fix

* Type-o

* Remove unused opencv camera component discovery.
2017-05-02 21:55:51 -07:00
Gergely Imreh
70ad06d71c light.piglow update (#7408)
* light.piglow: brightness control logic update

Do not reset brightness when brightness is not explicitly supplied.
Based on conversation at:
https://github.com/home-assistant/home-assistant/pull/7377#discussion_r114102005

* light.piglow: add assumed state
2017-05-02 21:21:37 -07:00
Adam Mills
c35d09d5f0 Convert automatic device tracker to push updates (#7404)
* Convert automatic device tracker to push updates

* Update test

* Add to coveragerc

* Fire hass events when automatic update received

* Change brace indentation
2017-05-02 21:21:17 -07:00
Henrik Nicolaisen
f389266f5f remove charset if set in content type header (#7411)
* remove charset if set in content type header like this “Content-Type: image/jpeg;charset=UTF-8”

* fixed lint error
2017-05-02 21:19:16 -07:00
wokar
f9627a5646 applx suggested fix from issue #6573 (#7390) 2017-05-02 21:04:00 -07:00
zeltom
517bd39015 Pilight binary sensor components (#6774)
* Add files via upload

Pilight binary sensor components.

* Pep8 fixed

* Remove unused imports

* Remove STATE_UNKNOWN import

* Grouping import

* New import grouping

* Update pilight.py

* Update pilight.py

* Update pilight.py

* Prevent multiple timer call

* Update .coveragerc

* Fix alphabet ordre

* Fix & clean code (change payload comparaison, delete state function)

* Fix payload comparison and remove state methode

* Fix unused import, whitespaces

* Fix ident error
2017-05-02 20:48:49 -07:00
Andrey
11dc7246af Add Sensibo climate platform (#7379)
* Add Sensibo climate platform

* Force update after running a service

* Add sensibo to .coveragerc

* Use 10s timeout

* Fix schema. Remove print.

* Better handle unit conversions.
2017-05-02 17:23:36 -07:00
Gergely Imreh
8654993b18 light.sensehat: brightness control logic update (#7409)
Do not reset brightness when brightness is not explicitly supplied.
Based on conversation at:
https://github.com/home-assistant/home-assistant/pull/7377#discussion_r114102005
2017-05-02 17:02:13 -07:00
Anders Melchiorsen
1aa3ab52b7 LIFX: Add transition option to colorloop effect (#7410)
This allows for more of a disco mode where lights change so fast that you
actually notice it.

Also change the valid period to the maximum 20 msgs/sec that LIFX bulbs
can handle.
2017-05-03 00:41:43 +02:00
Anders Melchiorsen
d68f59ca6c Update LIFX default color for breathe/pulse effects (#7407)
First, move the default away from turn_on so we do not have to test for
the current service.

Next, change the default color away from random. The new default is that
saturated colors will flash white and desatured colors will flash to their
fully satured color. Always with full brightness.

After many experiments, this was the method that best produced results that
are both visually pleasing and always noticeable as a flash.
2017-05-03 00:05:11 +02:00
Fabian Affolter
4d52b0ecd5 Update docstrings (#7405)
* Update docstrings

* Fix lint issues

* Update docstrings
2017-05-02 22:47:20 +02:00
Brian Cribbs
1b2c83145c fixing nits 2017-05-02 15:41:45 -04:00
Gergely Imreh
12c8266942 light.blinkt: update brightness control logic (#7389)
Always use the current brightness, as per discussion at
https://github.com/home-assistant/home-assistant/pull/7377#discussion_r114102005
2017-05-02 18:35:23 +02:00
Fabian Affolter
a4f1f6e724 Update docstrings (#7374)
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstring

* Update docstrings

* Update docstrings

* Fix lint issues

* Update docstrings

* Revert changes in dict
2017-05-02 09:18:47 -07:00
amigian74
0e08925259 correct MQTT subscription filter (#7269)
* correct MQTT subscription filter

* wildcard handling (#) fixed

* wildcard handling (#) fixed

* added tests for topic subscription like +/something/#

* function names changed (line too long)

* using raw strings for regular expression
import order changed
2017-05-02 09:18:34 -07:00
Andrey
570c5549a9 Clean up requirements (#7391) 2017-05-02 09:15:02 -07:00
Scott Bradshaw
f4f06af0c5 OpenGarage support (#7338)
* OpenGarage.io support

Cleaned up component and ran lint checking

* Fixing lint errors

* Added supported_features and device_class

* Added timeout to HTTP Requests and other changes based on feedback.

* Removed watcher. It provided little value and could cause issues if status was stuck in a state.

* Changes based on feedback. Added error checking for invalid device_key.

* Lint
2017-05-02 08:46:56 -07:00
John Mihalic
752a4b958e Add Eight sleep component (#7275)
* Eight Sleep Implementation

* Update coverage

* Update hass requirements

* Remove unnecessary debug statements

* Bump version to fix date error

* Address comments

* Update requirements
2017-05-02 08:38:27 -07:00
Paulus Schoutsen
350a6fd5fa Lint 2017-05-02 07:47:02 -07:00
Paulus Schoutsen
f17c1090e1 Remove path whitelisting for hassio (#7399)
* Remove path whitelisting for hassio

* Update frontend

* Lint
2017-05-02 00:27:50 -07:00
Paulus Schoutsen
8ea6c7319a Migrate updater to aiohttp (#7387)
* Migrate updater to aiohttp

* Fix tests

* Update updater.py

* Docs
2017-05-01 23:29:01 -07:00
Paulus Schoutsen
da2521a299 Fix YAML dump (#7388)
* Fix YAML dump

* Add test
2017-05-01 20:09:49 -07:00
Brian Cribbs
098e28534b fixing documentation 2017-05-01 13:34:34 -04:00
Brian Cribbs
dc716cd971 repairing functionality for non-zero based ranges 2017-05-01 13:22:54 -04:00
Jack Minardi
7a24e210ae Try again to pass string to error msg 2017-05-01 09:31:23 -04:00
Daniel Perna
fafd0d4e4c Fix impulse events, added error event for Homegear (#7349)
* Fix impulse event, added error event

* Requested changes
2017-05-01 06:37:00 +02:00
Robbie Trencheny
8ba7e61ed6 Merge pull request #7385 from robbiet480/dont-validate-ios-identify
Disable iOS device identify schema validation for now
2017-04-30 20:11:21 -07:00
Alok Saboo
86cfc2a0ed Updated docstrings (#7383)
* Updated docstrings

* Updated docstrings

* Updated docstrings

* Update docstrings

* Update more docstrings
2017-04-30 20:10:08 -07:00
Marcelo Moreira de Mello
6aac53399d Upgrade Ring to 0.1.4 (#7386) 2017-04-30 20:08:14 -07:00
Jack Minardi
bc0559813c Dont add two strings inside logger call 2017-04-30 22:26:16 -04:00
Jack Minardi
dd7690f265 Use % formatting 2017-04-30 21:31:55 -04:00
Jack Minardi
b6827ce57a Use throwaray variable name 2017-04-30 21:02:03 -04:00
Robbie Trencheny
ae93cf702a Merge pull request #7347 from cribbstechnologies/dev
Adding tilt functionality for MQTT cover
2017-04-30 15:56:45 -07:00
Robbie Trencheny
ecf511ff35 Remove unused dependency 2017-04-30 15:55:34 -07:00
Robbie Trencheny
87ef26be22 Disable identify schema validation for now 2017-04-30 15:23:49 -07:00
Brian Cribbs
0fe0f1918a more requested changes 2017-04-30 16:33:29 -04:00
abmantis
c085f06df5 Add support for shuffle toggling on Spotify component. (#7339)
* add support for shuffle toggling on Spotify component.

	this also required adding support for shuffle on the
	media_player component.

* lint

* Use ATTR_MEDIA_SHUFFLING for service handler param

* Line too long fix

* fix tests

* add shuffle set to demo mediaplayer

* rename shuffle attribute
2017-04-30 12:41:21 -07:00
ChristianKuehnel
5d7403bd81 Plant (replacement for MiGardener) (#7131)
* new implementation without mqtt

* fixed lint findings

* fixed more lint findings

* fixed final flak8 error

* added unit tests for platform "plant"

* - changed status to "OK" / "problem"
- added attribute "problem" with details on the problems
- removed unused constant
- setting icon to "?" until we have meaningful data

* reformatted code to meet line length requirements
2017-04-30 12:32:32 -07:00
Wojciech Bederski
c14b829f27 improve handling of flux_led lights in RGBW mode (#7221)
allows simultaneous control of both RGB and White
channels.
2017-04-30 12:03:03 -07:00
Gergely Imreh
f20a81d0c5 light.blinkt: add support for Blinkt! lights on Raspberry Pi (#7377) 2017-04-30 11:48:54 -07:00
Paulus Schoutsen
9afbbbf3fe Remove ordered_dict validator (#7375)
* Remove ordered_dict validator

* Lint

* Update test_config_validation.py
2017-04-30 10:55:03 -07:00
Fabian Affolter
1f4f2d7086 Upgrade voluptuous to 0.10.5 (#7107)
* Upgrade voluptuous to 0.10.5

* Fix tests
2017-04-30 00:42:19 -07:00
Dan Ports
7ff1ded0b5 binary_sensor.workday: fix handling of states vs provinces (#7162)
* binary_sensor.workday: fix handling of states vs provinces

* Add test cases for workday sensor with states

* remove redundant assignment

* Repair unit test to improve coverage

Patch from Wolf-Bastian Pöttner

* Fix handling of invalid states/provinces

* fix indentation to satisfy pylint
2017-04-30 00:31:46 -07:00
Henrik Nicolaisen
8df5de2bb8 optimize remote calls and apps on webostv media_player (#7191)
* - changed updater to only do updated if they succed and handle calls when tv is off better by only doing 1 remote call
- show all sources instead of only connected, to fix source selection when unit is powered off
- fixed sources so they can launch apps and select sources

* fixed lint errors

* show all sources and apps if no custom options are defined in the conf

* fixed indentation for lint

* set _current_source when state is off and fixed timeout exception
2017-04-30 00:30:37 -07:00
Brent Hughes
955e3e0542 Zoneminder: Fixed undefined index error (#7340)
* Zoneminder: Fixed undefined index error

* Add Pascal's correct fix.
2017-04-30 00:18:00 -07:00
Anders Melchiorsen
9f68fd9184 Flux switch: avoid updates when off (#7363)
* Flux switch: avoid updates when off

Calling turn_on when the switch is already on would orphan the existing
time tracker, losing our ability to cancel it when turn_off is called.

* Cleanups

The self.is_on property can now be found from self.unsub_tracker, so
get rid of the self._state attribute.

Add an entry guard to turn_on, making further conditionals unnecessary.
2017-04-30 00:05:29 -07:00
Paulus Schoutsen
85b7433bc4 Update sensehat.py 2017-04-29 22:42:12 -07:00
Fabian Affolter
3ee4d1060f Update docstrings (#7361)
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update tomato.py

* Update isy994.py

* Lint + fix tests

* Lint
2017-04-29 22:04:49 -07:00
Paulus Schoutsen
e22e70a01a Update sensehat.py 2017-04-29 21:40:10 -07:00
Paulus Schoutsen
cf664e42cc Add assumed state to sensehat light. 2017-04-29 21:39:27 -07:00
Gergely Imreh
b815ccc3b8 light.sensehat: plugin to control the 8x8 LED matrix on a Sense hat (#7365)
* light.sensehat: adding plugin to control the 8x8 LED matrix on a Sense Hat

* add new .coveragerc entry

* light.sensehat: formatting and removing unused import

* light.sensehat: add to requirements list

* light.sensehat: update docstrings to the linter's specs

* light.sensehat: add a bit more docstring
2017-04-29 21:34:31 -07:00
onsmam
7b1e948e8d Create knx.py (#7356)
* Create knx.py

light device for the knx component

* Fix doc strings
2017-04-29 21:20:46 -07:00
Jason Carter
607394a0a0 Netdisco now returns a dictionary while it used to be a tuple, fixed (#7350) 2017-04-29 20:54:45 -07:00
LvivEchoes
e4ebae55d5 Feature/add mikrotik device tracker (#7366)
* Add Mikroik device tracker platform

* Update coveragerc with mikrotik.py

* Update coveragerc with mikrotik.py

* Fix lint errors
2017-04-29 20:39:11 -07:00
Paulus Schoutsen
ce3d8be72b Remove binary sensor platforms implementing state property (#7371)
* Remove binary sensor platforms implementing state property

* Fix workday inheritance
2017-04-29 20:36:50 -07:00
Brian Cribbs
a1be80d5d4 added optimistic configuration for tilt state 2017-04-29 19:27:19 -04:00
Brian Cribbs
dc3706523a I was thinking *far* too hard about this 2017-04-29 19:19:24 -04:00
Paulus Schoutsen
55731b759f Fix lint 2017-04-29 15:47:21 -07:00
Paulus Schoutsen
064b2cdb9f Remove state property from alarmdecoder binary sensor (#7370) 2017-04-29 15:12:18 -07:00
Anders Melchiorsen
64a7be66b1 Remove global limit on white light temperature (#7206)
* Remove global limit on white light temperature

Here are the supported temperatures of some popular bulbs:

 Philips Hue: 2000K-6500K (the current 500-154 mired range)
 LIFX Color 1000: 2500K-9000K
 IKEA TRÅDFRI: 2200K, 2700K, 4000K

Obviously, Home Assistant cannot enforce a global limit and work properly
with all of these bulbs. So just remove the limit and leave it up to each
platform to work it out.

This commit updates the existing users and adds a clamp to Hue (where the
limit appears to have originated). It does not attempt to update other
platforms that might need extra handling of the larger range that is now
possible.

* Add min_mireds/max_mireds state attributes to lights

* Support min_mireds/max_mireds with LIFX lights
2017-04-29 15:04:20 -07:00
Fabian Affolter
ae9f44c708 Upgrade speedtest-cli to 1.0.6 (#7354) 2017-04-30 00:00:04 +02:00
Fabian Affolter
74362df19c Upgrade xmltodict to 0.11.0 (#7355) 2017-04-29 23:59:38 +02:00
Greg Dowling
d8afea64af Add debug logging to pyvera events. (#7364) 2017-04-29 17:19:22 +01:00
Daniel Høyer Iversen
b853fb2178 Upgrade Flux led lb to 0.19 (#7352) 2017-04-29 07:46:34 +02:00
Brian Cribbs
5b22e57643 some changes requested on PR 2017-04-28 21:41:50 -04:00
Brian Cribbs
88782fa90a added coroutine annotation to async method 2017-04-28 16:32:06 -04:00
Brian Cribbs
4c06cca3e1 left trailing whitespace 2017-04-28 13:58:01 -04:00
Brian Cribbs
d3042a8199 forgot to remove constructor arg 2017-04-28 13:57:13 -04:00
Brian Cribbs
e61c1ffbc2 fixing hound violations 2017-04-28 13:25:15 -04:00
Brian Cribbs
6cfc1b6af8 removing unnecessary payload value for tilt 2017-04-28 13:15:05 -04:00
Brian Cribbs
c120c47bc1 style changes 2017-04-28 12:14:17 -04:00
Brian Cribbs
44dbf2678b adding tests to cover new functionality 2017-04-28 11:32:42 -04:00
Brian Cribbs
bbe8b2019b style/lint updates 2017-04-28 10:45:32 -04:00
Fabian Affolter
f9c9b3c1b8 Multiple changes (typo, ordering, docstrings, timeouts) (#7343)
* Multiple changes (typo, ordering, docstrings, timeouts)

* Remove debug output

* Catch exception

* Separate URL
2017-04-28 13:25:39 +02:00
Robbie Trencheny
9dd28ac18f Properly return self._unit_of_measurement in the unit_of_measurement function (#7341)
Add an optional extended description…
2017-04-28 12:26:17 +02:00
Thibault Cohen
8114c45b3d Add auxheat to ecobee climate (#6562)
* Add auxheat to ecobee

* Add is_aux_heat_on property in ecobee climate
2017-04-28 11:52:48 +02:00
Anders Melchiorsen
89164d0244 Allow multiple recipients for SMTP notify (#7319)
The existing (singular) configuration keyword is kept for compatibility.
2017-04-28 11:29:30 +02:00
Brian Cribbs
79e134b076 removing accidentally added file 2017-04-27 23:43:54 -04:00
Brian Cribbs
630516f309 slider and tilt open/close seem to work 2017-04-27 23:42:50 -04:00
Paulus Schoutsen
6902e522b9 Merge pull request #7335 from home-assistant/release-0-43-2
0.43.2
2017-04-27 12:42:25 -07:00
Fabian Affolter
0298522fd5 Use four-digits year (#7336) 2017-04-27 09:30:34 -07:00
Paulus Schoutsen
6750e33525 Right fix for Python Open Z-Wave in Docker (#7337) 2017-04-27 09:28:40 -07:00
Paulus Schoutsen
9a67111a0f Right fix for Python Open Z-Wave in Docker (#7337) 2017-04-27 09:28:08 -07:00
Paulus Schoutsen
e6a690558b Fix breaking SSL in test HTML5 (#7310) 2017-04-27 09:27:31 -07:00
Adam Mills
a3bc559fa3 Version bump for automatic (#7329) 2017-04-27 09:05:58 -07:00
Adam Mills
3a1072a158 Version bump of aioautomatic (#7300)
* Version bump of aioautomatic

* Update requirements_all.txt
2017-04-27 09:05:58 -07:00
Paulus Schoutsen
0841bf8529 Update frontend (#7324)
* Initial version of hassio panel

* Update frontend
2017-04-27 09:03:54 -07:00
Fabian Affolter
2b82c222b0 Upgrade python-telegram-bot to 5.3.1 (#7311) 2017-04-27 09:03:46 -07:00
Paulus Schoutsen
d966129fd8 Upgrade pytradfri to 1.1 (#7290) 2017-04-27 09:03:25 -07:00
Paulus Schoutsen
84752b3b13 Hassio api v3 (#7323)
* HassIO rest API v3

* fix content type

* fix lint

* Update comment

* fix content type

* change proxy handling

* fix handling

* fix register

* fix addons

* fix routing

* Update hassio to just proxy

* Fix tests

* Lint
2017-04-27 09:02:43 -07:00
Pascal Vizeli
3735c2e761 Fix HassIO bug with supervisor update & log (#7282) 2017-04-27 09:02:43 -07:00
Pascal Vizeli
9fc89ba744 WIP: HassIO allow to access to container logs. (#7271)
* HassIO allow to access to container logs.

* Add unittest & make a fixture for env

* Add unittest to check if no env exists

* Fix lint
2017-04-27 09:02:43 -07:00
Paulus Schoutsen
f7603a421f Version bump to 0.43.2 2017-04-27 09:02:08 -07:00
Adam Mills
6631e9e939 Version bump for automatic (#7329) 2017-04-27 08:01:30 -04:00
Paulus Schoutsen
3e4e84e3a7 Re-enable Open Z-Wave in Dockerfile (#7325)
Turbo fixed it in #7316
2017-04-27 01:02:14 -07:00
John Arild Berentsen
ce63bb0842 Fix broken docker build (#7316)
* Fix broken docker build

python3 branch

* Update python_openzwave
2017-04-27 01:00:07 -07:00
Anders Melchiorsen
d1121478ab Reduce color_xy_brightness_to_hsv to color_xy_to_hs (#7320)
This makes more sense because the input and output brightness is the same.

We currently convert through RGB which does contain a brightness so we supply
an arbitrary value as input and discard the output.
2017-04-27 00:59:49 -07:00
Paulus Schoutsen
9527390736 Update frontend (#7324)
* Initial version of hassio panel

* Update frontend
2017-04-27 00:57:40 -07:00
Paulus Schoutsen
a732271793 HassIO API fix 2017-04-26 23:24:02 -07:00
Paulus Schoutsen
b532267596 HassIO API fix 2017-04-26 23:23:18 -07:00
Paulus Schoutsen
b14c07a60c Hassio api v3 (#7323)
* HassIO rest API v3

* fix content type

* fix lint

* Update comment

* fix content type

* change proxy handling

* fix handling

* fix register

* fix addons

* fix routing

* Update hassio to just proxy

* Fix tests

* Lint
2017-04-26 22:36:48 -07:00
Jan Losinski
3374169c74 Allow InfluxDB to blacklist domains (#7264)
* Allow InfluxDB to blacklist domains

This adds an option to InfluxDB to blacklist whole domains. This is
useful for domains like automation or script, where no statistic data
is needed.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Add unittest for InfluxDB domain blacklist

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Use common include/exclude config for InfluxDB.

Its now the same syntax as it is for recorder.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Add unittests for InfluxDB include whitelist.

There where no tests for that feature before.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
2017-04-26 21:14:52 +02:00
Anders Melchiorsen
ffb8872f95 LIFX: use white light when setting a specific temperature (#7256)
* Default to white when setting LIFX temperature

Changing the temperature of a saturated color is possible but not very
interesting. So assume that a change of the temperature implies setting
the color to white, unless a different color is actually specified.

This makes the frontend temperature picker much more useful because it can
now be used to get away from a colored light.

* Default to a neutral white temperature when setting LIFX colors

This means that setting a particular color will always give the same output,
no matter what the temperature was previously at.

* Find brightness after colors

Now the color_temp logic will not see a changed color when setting
temperature+brightness and thus we will actually get a white light in
this situation.

The XY conversion can then not use brightness as input. This is not
an issue because XY only affects hue and saturation, not brightness. So
we can just use an arbitrary value as brightness input.

* Add a simple comment to a complex conditional
2017-04-26 17:21:14 +02:00
Paulus Schoutsen
d2fb4675e1 Disable Open Z-Wave in Docker (#7315) 2017-04-26 07:37:05 -07:00
Fabian Affolter
569ea0cc01 Upgrade python-telegram-bot to 5.3.1 (#7311) 2017-04-26 10:50:08 +02:00
Adam Mills
00f034cef2 Version bump of aioautomatic (#7300)
* Version bump of aioautomatic

* Update requirements_all.txt
2017-04-25 20:21:16 -07:00
Henrik Nicolaisen
615691efc3 Issue 7218 update pylgtv to 0.1.7 (#7302)
* update pylgtv module to 0.1.7

* update pylgtv to 0.1.7 requirements
2017-04-25 20:20:54 -07:00
Daniel Perna
760d2f1f0a Upgrade pyhomematic, extend device support (#7303) 2017-04-25 20:20:10 -07:00
Paulus Schoutsen
8bb952e416 Fix breaking SSL in test HTML5 (#7310) 2017-04-25 20:18:23 -07:00
Fabian Affolter
f29e0bf53e Don't stack up error messages, fix link, and ordering (#7291) 2017-04-25 12:40:13 +02:00
Alan Fischer
28aab33cd1 Added scene controller support to the vera component, along with proper polling when a vera device needs it (#7234)
Add an optional extended description…
2017-04-25 09:17:25 +02:00
Russell Cloran
d79f89e168 Add support for Zigbee Home Automation (#6263)
* Add support for Zigbee Home Automation

* Fewer magic numbers

* Make optional device config work

* Remove non-zha device_tracker stuff

* Always return boolean from is_on

* Only pass through JSON serializable discovery_info

* Update to bellows 0.2.4

* Fewer magic numbers in binary sensor

* Populate const structures from a function

* Update bellows to 0.2.6

* Fewer magic numbers in light

* Take all possible clusters when overriding

* Update bellows to 0.2.7
2017-04-24 22:24:57 -07:00
micw
699cc7213d Feature/rss feed template (#7032)
* rss_feed_template initial checking

* lint

* Remove use of deprecated cgi-escape()

* Switching back to chardet==2.3 (resolve failing tests with 3.0)

* Code and test improvments

* Option 'requires_api_password', default is True
2017-04-24 22:16:47 -07:00
Ron Klinkien
f65d8e1254 Adding group control to tradfri light component (#7248)
* Added initial support for tradfri group control

* Tried to keep original variable structure

* pylint and pep8 fixes

* Fixed lint error about docstring

* Removed unneeded stuff, renamed _light. Needs to be released pytradfri version.

* Better naming of variables inside add_devices call.
2017-04-24 21:57:38 -07:00
Paulus Schoutsen
fb297981af Upgrade pytradfri to 1.1 (#7290) 2017-04-24 21:57:27 -07:00
Jack Minardi
8bf1c21738 Add space 2017-04-25 00:48:23 -04:00
Jack Minardi
943861a8a3 Remove unused var 2017-04-25 00:45:59 -04:00
Jack Minardi
450fd7f2b5 Log out of router admin interface after devices are recorded. 2017-04-25 00:34:26 -04:00
Jack Minardi
2d5da3e958 Catch KeyError; Add response.text to error message 2017-04-25 00:32:31 -04:00
Paulus Schoutsen
66a63b983e Merge branch 'master' into dev 2017-04-24 21:10:03 -07:00
Paulus Schoutsen
758aed07e8 Merge pull request #7288 from home-assistant/release-0-43-1
0.43.1
2017-04-24 21:02:39 -07:00
Paulus Schoutsen
166bcc0687 Recorder: Check for ENTITY_ID key that contains None value (#7287) 2017-04-24 20:51:14 -07:00
Paulus Schoutsen
335362ffc4 Recorder: Check for ENTITY_ID key that contains None value (#7287) 2017-04-24 20:51:03 -07:00
Klaas Hoekema
41a803a7be Work around bad content-type in Hook api response (#7267) 2017-04-24 20:36:16 -07:00
Martin Hjelmare
1b55dbeb44 Fix telegram webhooks (#7236)
* Always register the view if a webhook exists.
* Return True if platform is set up succesfully, False otherwise.
* Remove the webhook when home assistant stops. Webhooks and long
  polling are mutually excklusive. If a webhook is left after home
  assistant is stopped, a polling telegram bot is unable to be set up,
  on next start of home assistant.
2017-04-24 20:36:08 -07:00
Greg Dowling
6c594e20f6 Workround for wemo subscription bug. (#7245) 2017-04-24 20:35:59 -07:00
Fabian Affolter
c8404cb299 Upgrade paho-mqtt to 1.2.3 (#7214) 2017-04-24 20:35:51 -07:00
John Arild Berentsen
79c6467797 Zwave cover workaround for graber shades. (#7204)
* wierd pylint complaint

* Workaround for Graber csz1 shades

* logging

* Try direct

* Try direct

* Use workaround

* Review changes and tests

* test

* reset test

* Use Bright and Dim also as open and close is
2017-04-24 20:35:27 -07:00
Paulus Schoutsen
e01c36c906 Version bump to 0.43.1 2017-04-24 20:34:56 -07:00
Keaton Taylor
17bdb9558a Fixes utf-8 encoding no longer required by python-openzwave0.3.3 (#7266)
* Fixes utf-8 encoding no longer required by libopenzwave0.3.3

Removes byte encoding for values operation mode, fan mode and swing
mode.

* Fix zwave climate tests for utf-8 change
2017-04-24 17:59:51 -07:00
Patrick Easters
9738bffc3f Updating ping binary sensor with Windows support (#7253)
Fixed ping command syntax and updated regex match
2017-04-24 23:32:12 +02:00
Pascal Vizeli
f58d200ecb Fix HassIO bug with supervisor update & log (#7282) 2017-04-24 23:22:40 +02:00
Jan Losinski
215987d5a7 Add script to import state events to InfluxDB (#7254)
* Add script to import state events to InfluxDB

This adds a script to import recorded events from a recorder database
to a InfluxDB instance. This can be useful for initial importing after
setup of a InfluxDB.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Fix step argument handling in Influx import

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Correct typo in InfluxDB Importer

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>

* Update influxdb_import.py
2017-04-24 23:01:09 +02:00
Nils Uliczka
16227704d7 Fix telegram_polling no first_name or last_name (#7281)
* Default to 'N/A' if sender has no first_name or last_name

* Fixed as requested
2017-04-24 22:08:06 +02:00
Fabrizio Furnari
aad375b713 Add https certificate expiry sensor (#7272)
* fixing rebase issues

* cert_expiry: added .coveragerc entry

* cert_expiry: renamed to SCAN_INTERVAL, removed Throttle

* cert_expiry: better socket exception management

* cert_expiry: splitted line too long

* Update cert_expiry.py

* Fix hass style
2017-04-24 22:01:00 +02:00
LvivEchoes
104d372dfa Add support for Ukrainian Language in Google TTS (#7278) 2017-04-24 21:43:56 +02:00
Stuart Mumford
7960206e2e Refactor matrix notify service (#7122)
* Refactor matrix notify service.

This refactor aims to close #6118 by making the save / restore of the
authentication tokens much more resilient to failure.

It also refactors the module so that all the functionality is part of the class
and that a login failure causes the service to fail on setup rather than at
message send time.

* Make the linter overlords happy

* Improve logger levels and messages

* small style change

* Fix indentation issue
2017-04-24 21:43:02 +02:00
Anders Melchiorsen
4f5ec3e360 Update aiolifx (#7279)
This contains a fix for TypeError bug seen only with LIFX Z.
2017-04-24 21:09:14 +02:00
Pascal Vizeli
ead457f312 WIP: HassIO allow to access to container logs. (#7271)
* HassIO allow to access to container logs.

* Add unittest & make a fixture for env

* Add unittest to check if no env exists

* Fix lint
2017-04-24 15:16:28 +02:00
Daniel Høyer Iversen
575f57a24e Rfxtrx upgrade lib 0.18 (#7273) 2017-04-24 13:42:26 +02:00
Klaas Hoekema
64da8cd47d Work around bad content-type in Hook api response (#7267) 2017-04-23 23:58:17 -07:00
Martin Hjelmare
0e662c4007 Fix telegram webhooks (#7236)
* Always register the view if a webhook exists.
* Return True if platform is set up succesfully, False otherwise.
* Remove the webhook when home assistant stops. Webhooks and long
  polling are mutually excklusive. If a webhook is left after home
  assistant is stopped, a polling telegram bot is unable to be set up,
  on next start of home assistant.
2017-04-23 23:20:04 -07:00
Greg Dowling
6a8a656fef Workround for wemo subscription bug. (#7245) 2017-04-23 23:18:43 -07:00
Fabian Affolter
cfc023e128 Don't use len(SEQUENCE) as condition value (#7249)
* Don't use len(SEQUENCE) as condition value

* Update volvooncall.py
2017-04-23 20:41:09 -07:00
Fabian Affolter
15b2473224 Iterating the dictionary directly (#7251) 2017-04-23 20:16:52 -07:00
clayton craft
48eeb55198 Add notice regarding submission of analytics (#7263) 2017-04-23 19:59:26 -07:00
Oliver
4cd024d91e Pushed to version 0.4.0 of denonavr which also includes experimental support for Marantz receivers (#7250) 2017-04-23 21:00:00 +02:00
Fabian Affolter
fa4a912a86 Use consts and string formatting (#7243) 2017-04-23 13:54:39 +02:00
Fabian Affolter
209da6f338 Upgrade aiohttp_cors to 0.5.3 (#7213) 2017-04-23 09:25:58 +02:00
Fabian Affolter
ec5e9fcd0d Upgrade paho-mqtt to 1.2.3 (#7214) 2017-04-23 09:25:34 +02:00
Fabian Affolter
e9eb7edda6 Upgrade speedtest-cli to 1.0.5 (#7215) 2017-04-23 09:25:11 +02:00
Fabian Affolter
b60b06a062 Upgrade mutagen to 1.37.0 (#7216) 2017-04-23 09:24:53 +02:00
Fabian Affolter
efe8b46576 Upgrade pygatt to 3.1.1 (#7220)
* Upgrade pygatt to 3.1.1

* Fix mess
2017-04-23 09:24:26 +02:00
Anders Melchiorsen
91b8eea6ad LIFX: avoid "Unable to remove unknown listener" warning (#7235)
Forget the cancelled update handler so it is not cancelled a second time
later on (if when <= BULB_LATENCY) and thus invoking the warning.
2017-04-23 09:24:08 +02:00
Adam Mills
b6a4a0d9af Refactor lyft sensor update (#7233) 2017-04-23 09:23:00 +02:00
Matthew Garrett
7b3cc9fe1f Bump a couple of dependencies (#7231)
* avion light: Bump python-avion dependency version

The dependencies in python-avion weren't sufficiently strict. This is now
fixed, but means we need to depend on a new version.

* decora light: Bump python-decora dependency

There's a new version of python-decora with a reliability fix, so depend on
that.
2017-04-23 09:20:58 +02:00
Dan Ports
2c39038507 lyft sensor: re-enable Prime Time rate attribute (#6982)
Turns out this does work correctly even without a user login
(assuming that sandbox mode is disabled)
2017-04-22 21:16:06 +02:00
Fabian Affolter
5bfe5b3f70 Remove superfluous comments and update ordering (#7227)
* Remove superfluous comments and update ordering

* Fix pylint issues
2017-04-22 21:13:04 +02:00
Alok Saboo
d229787fa6 Fixed typo and clarified details for Lifx effects (#7226)
* Fixed typo

* Update services.yaml

* Clarified service details for Lifx effects
2017-04-22 20:43:17 +02:00
John Arild Berentsen
1836c7a358 Zwave cover workaround for graber shades. (#7204)
* wierd pylint complaint

* Workaround for Graber csz1 shades

* logging

* Try direct

* Try direct

* Use workaround

* Review changes and tests

* test

* reset test

* Use Bright and Dim also as open and close is
2017-04-22 16:23:39 +02:00
Joakim af Sandeberg
1b83ce8759 Pushbullet notification sensor (#7182)
* Added the pushbullet sensor component

* Updated requirements_all.txt and .coveragerc with the new sensor

* Updated acording to houndci-bots comments

* Some more changes

* Final change by the hound (?)

* Fixes from balloobs review and from houndci-bot

This changes the sensors information to only contain one attribute
as information, and the rest as device_state_attributes.

* Added leading space to comments

* Added docstrings, removed API_KEY from log, changed imports

* The hound is at it again

* Fix remaining issues

* Fix pylint issue
2017-04-22 14:01:30 +02:00
Fabian Affolter
8c72a57344 Bump version to 0.44.0.dev0 (#7217) 2017-04-22 11:52:24 +02:00
Paulus Schoutsen
8be2ac70ec Merge pull request #7197 from home-assistant/release-0-43
0.43
2017-04-22 00:33:01 -07:00
Paulus Schoutsen
477ebd99b4 Version bump to 0.43 2017-04-22 00:32:27 -07:00
Martin Hjelmare
093c7f0e44 Fix tradfri lights (#7212)
* Remove leftover use of slugify

* The IKEA manufacturer key is now exactly as found in device info.

* Fix bitwise addition of supported features
2017-04-22 00:31:44 -07:00
Martin Hjelmare
3f47bf6b77 Fix tradfri lights (#7212)
* Remove leftover use of slugify

* The IKEA manufacturer key is now exactly as found in device info.

* Fix bitwise addition of supported features
2017-04-22 00:31:23 -07:00
Paulus Schoutsen
80e9e9bfda tradfri: Improve color temp support detection (#7211) 2017-04-21 23:33:25 -07:00
Paulus Schoutsen
40f480c24e tradfri: Improve color temp support detection (#7211) 2017-04-21 23:32:51 -07:00
Henrik Nicolaisen
dafbdbd2d0 Issue 6749 updated pylgtv to 0.1.6 to fix thread leak in asyncio loop (#7199)
* updated pylgtv module to fix problems with timeouts

* - update pylgtv to 0.1.6
- handle new TimeoutError exception from pylgtv

* used full name for exception handling of concurrent.futures._base.TimeoutError

* the exception handling should now follow the rules

* float typecasting should not be necessary

* use asyncio for TimeoutError it’s an alias for concurrent.futures.TimeoutError
2017-04-21 20:24:33 -07:00
Henrik Nicolaisen
8e716780b7 Issue 6749 updated pylgtv to 0.1.6 to fix thread leak in asyncio loop (#7199)
* updated pylgtv module to fix problems with timeouts

* - update pylgtv to 0.1.6
- handle new TimeoutError exception from pylgtv

* used full name for exception handling of concurrent.futures._base.TimeoutError

* the exception handling should now follow the rules

* float typecasting should not be necessary

* use asyncio for TimeoutError it’s an alias for concurrent.futures.TimeoutError
2017-04-21 20:24:21 -07:00
Sean Dague
b641f6863c Fix arwn platform to update hass state when events are received (#7202)
The arwn platform was refactored to be asyncio friendly, however in
doing so one thing was missed which was explicitly telling hass when
something interesting has happened. This led to the very interesting
to debug issue that the state cards were all out of date, even though
the graphs were not.
2017-04-21 20:22:49 -07:00
Sean Dague
b77b22b01a Fix arwn platform to update hass state when events are received (#7202)
The arwn platform was refactored to be asyncio friendly, however in
doing so one thing was missed which was explicitly telling hass when
something interesting has happened. This led to the very interesting
to debug issue that the state cards were all out of date, even though
the graphs were not.
2017-04-21 20:22:36 -07:00
Nikolas Beutler
07fcf22aeb Update ios.py (#7160)
* Update ios.py

as discussed. the part: 
       if battery_state == ios.ATTR_BATTERY_STATE_FULL:
            returning_icon_level = DEFAULT_ICON_LEVEL
kinda screws up the charging icon.

i might just miss a logical solution for that though.
let me know what you think. it might not be beautiful but i think its an overall improve over the current "double battery" solution

* Update ios.py

chound fix and full_battery_charge fix

* Update ios.py

removed new line

* Update ios.py

* Update ios.py

* Update ios.py

* Update ios.py

* Update ios.py

* Update ios.py

* merged request from robbie

* Update ios.py

* Update ios.py

* Update ios.py
2017-04-21 20:18:31 -07:00
Anders Melchiorsen
2d57c6a1c7 Support xy_color with LIFX lights (#7208) 2017-04-21 20:18:31 -07:00
Nikolas Beutler
1194690c42 Update ios.py (#7160)
* Update ios.py

as discussed. the part: 
       if battery_state == ios.ATTR_BATTERY_STATE_FULL:
            returning_icon_level = DEFAULT_ICON_LEVEL
kinda screws up the charging icon.

i might just miss a logical solution for that though.
let me know what you think. it might not be beautiful but i think its an overall improve over the current "double battery" solution

* Update ios.py

chound fix and full_battery_charge fix

* Update ios.py

removed new line

* Update ios.py

* Update ios.py

* Update ios.py

* Update ios.py

* Update ios.py

* Update ios.py

* merged request from robbie

* Update ios.py

* Update ios.py

* Update ios.py
2017-04-21 20:16:59 -07:00
Anders Melchiorsen
2657668a86 Support xy_color with LIFX lights (#7208) 2017-04-21 20:16:36 -07:00
Pierre Ståhl
f5dd25c87f Capture and log pip install error output (#7200)
Add an optional extended description…
2017-04-21 14:15:05 +02:00
Pascal Vizeli
5c737cfa6e HassIO API v2 (#7201)
Add an optional extended description…
2017-04-21 12:21:55 +02:00
Pascal Vizeli
0acc52b23b HassIO API v2 (#7201)
Add an optional extended description…
2017-04-21 12:20:19 +02:00
Anders Melchiorsen
e3f682c7d3 LIFX light effects (#7145)
* Refactor into find_hsbk

This will be useful for new methods that also have to find passed in colors.

* Add AwaitAioLIFX

This encapsulates the callback and Event that aiolifx needs and thus avoids an
explosion of those when new calls are added.

The refresh_state is now generally useful, so move it into its own method.

* Initial effects support for LIFX

These effects are useful as notifications. They mimic the breathe and pulse
effects from the LIFX HTTP API:

    https://api.developer.lifx.com/docs/breathe-effect
    https://api.developer.lifx.com/docs/pulse-effect

However, this implementation runs locally with the LIFX LAN protocol.

* Saturate LIFX no color value

Now the color is "full saturation, no brightness". This avoids a lot of
temporary white when fading from the "no color" value and into a real color.

* Organize LIFX effects in classes

This is to move the setup/restore away from the actual effect, making it quite
simple to add additional effects.

* Stop running LIFX effects on conflicting service calls

Turning the light on/off or starting a new effect will now stop the running
effect.

* Present default LIFX effects as light.turn_on effects

This makes the effects (with default parameters) easily accessible from
the UI.

* Add LIFX colorloop effect

This cycles the HSV colors, so that is added as an internal way to set a
color.

* Move lifx to its own package and split effects into a separate file

* Always show LIFX light name in logs

The name is actually the easiest way to identify a bulb so just using it
as a fallback was a bit odd.

* Compact effect getter

* Always use full brightness for random flash color

This is a stopgap. When a bit more infrastructure is in place, the intention
is to turn the current hue some degrees. This will guarantee a flash color
that is both unlike the current color and unlike white.

* Clear effects concurrently

We have to wait for the bulbs, so let us wait for all of them at once.

* Add lifx_effect_stop

The colorloop effect is most impressive if run on many lights. Testing
this has revealed the need for an easy way to stop effects on all lights
and return to the initial state of each bulb. This new call does just that.

Calling turn_on/turn_off could also stop the effect but that would not
restore the initial state.

* Always calculate the initial effect color

To fade nicely from power off, the breathe effect needs to keep an
unchanging hue. So give up on using a static start color and just find the
correct hue from the target color.

The colorloop effect can start from anything but we use a random color
just to keep things a little interesting during power on.

* Fix lint

* Update .coveragerc
2017-04-20 22:46:29 -07:00
Anders Melchiorsen
d4b085081a LIFX light effects (#7145)
* Refactor into find_hsbk

This will be useful for new methods that also have to find passed in colors.

* Add AwaitAioLIFX

This encapsulates the callback and Event that aiolifx needs and thus avoids an
explosion of those when new calls are added.

The refresh_state is now generally useful, so move it into its own method.

* Initial effects support for LIFX

These effects are useful as notifications. They mimic the breathe and pulse
effects from the LIFX HTTP API:

    https://api.developer.lifx.com/docs/breathe-effect
    https://api.developer.lifx.com/docs/pulse-effect

However, this implementation runs locally with the LIFX LAN protocol.

* Saturate LIFX no color value

Now the color is "full saturation, no brightness". This avoids a lot of
temporary white when fading from the "no color" value and into a real color.

* Organize LIFX effects in classes

This is to move the setup/restore away from the actual effect, making it quite
simple to add additional effects.

* Stop running LIFX effects on conflicting service calls

Turning the light on/off or starting a new effect will now stop the running
effect.

* Present default LIFX effects as light.turn_on effects

This makes the effects (with default parameters) easily accessible from
the UI.

* Add LIFX colorloop effect

This cycles the HSV colors, so that is added as an internal way to set a
color.

* Move lifx to its own package and split effects into a separate file

* Always show LIFX light name in logs

The name is actually the easiest way to identify a bulb so just using it
as a fallback was a bit odd.

* Compact effect getter

* Always use full brightness for random flash color

This is a stopgap. When a bit more infrastructure is in place, the intention
is to turn the current hue some degrees. This will guarantee a flash color
that is both unlike the current color and unlike white.

* Clear effects concurrently

We have to wait for the bulbs, so let us wait for all of them at once.

* Add lifx_effect_stop

The colorloop effect is most impressive if run on many lights. Testing
this has revealed the need for an easy way to stop effects on all lights
and return to the initial state of each bulb. This new call does just that.

Calling turn_on/turn_off could also stop the effect but that would not
restore the initial state.

* Always calculate the initial effect color

To fade nicely from power off, the breathe effect needs to keep an
unchanging hue. So give up on using a static start color and just find the
correct hue from the target color.

The colorloop effect can start from anything but we use a random color
just to keep things a little interesting during power on.

* Fix lint

* Update .coveragerc
2017-04-20 22:46:12 -07:00
Paulus Schoutsen
dbb0525311 Merge branch 'master' into dev 2017-04-20 22:39:09 -07:00
Pascal Vizeli
f641287aa2 Add HassIO to discovery component (#7195)
* Add HassIO to autodiscovery

* Fix tests

* fix tests

* fix test v2

* fix mock test

* call
2017-04-20 18:45:15 -07:00
LvivEchoes
bbeb64eb24 Add support of input registers while querying modbus sensor. (#7082)
* Add support of input registers while querying modbus sensor.

* Changed config option. Refactoring.
2017-04-20 21:28:49 -04:00
Fabian Affolter
eb2e5e5b9d Upgrade py-cpuinfo to 3.2.0 (#7190) 2017-04-20 12:07:56 +02:00
mountainsandcode
920d298c7e mvglive bug fixes and improvements (#6953)
* Refactored mvglive.py

This pull requests builds on the first work with the mvglive sensor:
- Refactoring the code so that multiple sensors for departures can be added
- Rewrites the transport mode restrictions ("products") to be more modular
- Fixes bugs, such as missing implementation of line restriction
- Other improvements, such as including data attribution

* Further improvements to mvglive sensor

- The API returns the property 'direction', which can be used to filter U-Bahn trains by direction without having to enter all final destinations
- The sensor icon now corresponds to the mode of transport of the next departure

* UBahnDirection refactored

U-Bahn SEV (bus replacement services) have unexpected direction values, fixed resulting bug and hound issues
2017-04-20 00:11:55 -07:00
Pierre Ståhl
93820d5124 Do not request artwork if not available (#7189)
This should fix the "dancing media player" issue where the media player
requests artwork when it's not really available, making the UI "dance".
2017-04-20 00:10:06 -07:00
Pierre Ståhl
2e11d49af3 Fix auto discovery for Apple TV (#7188) 2017-04-20 00:09:27 -07:00
Mitko Masarliev
2d5ab520ef Fix for errors on missing preview on LG webos TV (#6755)
* fix for missing image preview on LG webos TV

* fix to use largeIcon if it start with http
2017-04-20 00:08:53 -07:00
Sören Oldag
0c14c66fbc Added light.pwm component. (#7009)
* Added light.pwm component.

* Renamed pwm platform to rpi_gpio_pwm.

* Update requirements_all.txt
2017-04-19 23:32:20 -07:00
Fabian Affolter
b1621d4175 Add ping binary sensor (#7052)
* Add ping binary sensor

* Fix typo and lint issues

* Use SCAN_INTERVAL
2017-04-19 23:15:26 -07:00
happyleavesaoc
1860b6c521 opensky sensor (#7061)
* opensky sensor

* address opensky review comments

* update opensky distance calc
2017-04-19 22:56:20 -07:00
Gianluca Barbaro
f59b3da5fe JSON MQTT Device tracker (#7055)
* ready for PR

* minor fix

* another minor fix

* new platform mqtt_json

* using ATTR constants

* voluptuous check on JSON payload

* voluptuous check on JSON payload
2017-04-19 22:53:07 -07:00
happyleavesaoc
e020d5114a spotify media player (#6980)
* spotify media player

* fix refresh token

* spotify improvements

* add checks for idle

* import STATE_IDLE

* support more media_ids, limit updates

* move spotify device update

* Remove schedule_update_ha_state because should_poll is true
2017-04-19 22:45:12 -07:00
Paulus Schoutsen
ce51866bd2 Update frontend 2017-04-19 22:03:48 -07:00
Charles Blonde
931fce8239 Add Bose soundtouch discovery support and upgrade libsoundtouch library (#7005)
* Add Bose soundtouch discovery support and upgrade libsoundtouch library

* Remove DEVICE global variable

* Update netdisco to lastest version
2017-04-19 21:52:37 -07:00
Paulus Schoutsen
76d2154820 Fix wemo discovery (#7183)
* Fix wemo discovery

* Fix key
2017-04-19 21:25:45 -07:00
Henrik Nicolaisen
b985e4ef0b updated pylgtv module to fix problems with timeouts (#7184) 2017-04-19 19:36:11 -04:00
Gianluca Barbaro
632256fae2 Mqtt camera test (#7175)
* mock mqtt

* minor fix

* minor fix

* minor fix
2017-04-19 09:26:44 -07:00
Paulus Schoutsen
9b43b39370 Update frontend 2017-04-19 09:24:02 -07:00
Paulus Schoutsen
1a635fede3 Tweak Tradfri (#7172) 2017-04-19 09:15:39 -07:00
Paulus Schoutsen
90baa2ce4d Add history to component priority list (#7173) 2017-04-19 09:15:18 -07:00
Sytone
2f4b2ddc0a Add condition for API failure (#7181)
* Add condition for API failure

If you are not running the latest ve3rsion of ZM this will cause exceptions to fire. This fix handles a response from ZM but a non successful attempt. 

This resolves the issue https://github.com/home-assistant/home-assistant/issues/7178

* Fixed houndci-bot issues
2017-04-19 09:08:48 -07:00
Fabian Affolter
921760f8c1 Upgrade mypy to 0.501 (was renamed from mypy-lang) (#7117) 2017-04-19 14:34:23 +02:00
Fabian Affolter
8ba41563c9 Disable invalid-sequence-index (#7177) 2017-04-19 14:09:00 +02:00
Fabian Affolter
a41d0aced7 Supress trackback and upgrade PyMata to 2.14 (#7176) 2017-04-19 12:48:15 +02:00
Alessandro Mogavero
5179832f6f Added new services to platform kodi (#6426)
* added new service

* fixed basic test in kodi platform

* Added new method async_get_albums

* Added new methods in module kodi

* added method find_song in kodi module

* method add_song_to_playlist made
async

* Added media type to method async_play_media

* added methods async_clear_playlist
and play_song

* methods play_song and find_song
made async

* added new service play_song

* Improved kodi._find
now it find for whole words only

* added possibility to specify artist in
kodi.async_find_artist

* added kodi.async_find_album

* added new optional input to play_song service

* In async_play_song added handling of no song found

* default artist value changed to ''

* async_add_song_to_playlist now can also
search for musinc

* added service add_song_to_playlist

* Added new service add_album_to_playlist

* added services to switch shuffle mode

* added service add_all_albums_to_playlist

* handled error in async_unset_shuffle
and async_set_shuffle

* Added abstract methods to media_player

* _server substituted with server property

* style made consistent with requirements

* Fixed issue with pylint

* Services moved to kodi platform

* service play_song removed

* removed service unset_shuffle

* all add services merged into one

* removed service get_artists

* added kodi_ to service names

* Fixed some style issues

* Removed changes in media_player __init__

* Implemented requested changes

* Fixed pylint problem
2017-04-18 23:19:27 -07:00
Paulus Schoutsen
ce9bb0e84c Upgrade netdisco (#7171) 2017-04-18 20:58:25 -07:00
Johan Bloemberg
e5feeec7a4 Value of 0 should not be considered unknown. (#7139)
* Value of 0 should not be considered `unknown`.

* Reflect disconnect state in entity states.

* Due to adding unknown state on disconnect, the amount of reconnects can sometimes be more. Test for at least 2 reconnect attempts.
2017-04-18 20:24:44 -07:00
Paulus Schoutsen
4becfb66e3 Upgrade pytradfri to 1.0 (#7163) 2017-04-18 20:11:18 -07:00
Mitesh Patel
e4bbbe20dd Fix id zone mismatch (#7165)
* Fixes issue with id mismatch when multiple devices are connected to the lutron bridge

* Updates labels

* removes no longer needed config values.

* removes no longer needed imports
2017-04-19 00:24:58 +02:00
Erik Eriksson
1e758ed030 Keep track of already added players (#7149) 2017-04-19 00:20:52 +02:00
Michaël Arnauts
d007269ecc Update neato.py (#7166)
Fix leftover copy/paste error in comment of neato.py
2017-04-18 22:03:06 +02:00
Greg Dowling
bbad15f853 Add subscription update for Wemo switches, fix bug in Insight switches, fix wemo motion bug, fix wemo discovery (#7135)
* Fix wemo discovery.

* Bump wemo version, add subscription_update for basic switch, fix bug with turning insight switches off.

* Fix missed callback change for wemo motion.

* Regress netdisco changes.
2017-04-18 09:11:08 -07:00
Thibault Cohen
de71fee0a0 Fix #7026 adding a new wol parameter (#7144) 2017-04-18 09:09:06 -07:00
Fabian Affolter
c7a11277ac myStrom WiFi bulbs (#7161)
* Add initial support for myStrom WiFi bulbs

* Upgrade python-mystrom to 0.3.8

* Add myStrom light

* Fix lint issue
2017-04-18 09:03:56 -07:00
Paulus Schoutsen
5574686d74 Disable MQTT camera test (#7164) 2017-04-18 08:55:51 -07:00
Martin Hjelmare
15d8f8b827 Add support for tradfri color temp (#7153)
* Add support for tradfri color temp

* Only return rgb_color if supported features indicate support.
* Return color_temp if supported features indicate support and dict
  with allowed color temperatures exist for manufacturer.
* Add manufacturer specific supported features, with default.
* Color temperature is set from a dict of allowed pairs per
  manufacturer, where kelvin is mapped to hex_color. When a user sets a
  color temperature, the closest matching temperature is selected and
  set.

* Clean up
2017-04-18 08:26:59 -07:00
Greg Dowling
1925748f61 Add vera power meter. (#7134)
* Add vera power meter.

* Use W for power.
2017-04-18 12:01:23 +02:00
Mike Megally
226066eafd exposed content_type in rest_command (#7101)
* exposed content_type in rest_command, which allows for manually specifying the content_type for more-strict api endpoints

* fixed up column length

Length was 86 chars, and it needed to be 79

* double import of HTTP_HEADER_CONTENT_TYPE

Removed the accidental double-import of HTTP_HEADER_CONTENT_TYPE

* moved rest_command-specific config value into component

* if no content_type, default to None

* unit test

* newline

* unused CONTENT_TYPE_TEXT_PLAIN

* removed the http-agnostic abstraction hass provided in favor of aiohttps hdrs constant
2017-04-18 11:50:43 +02:00
Kevin
43799b8fee small fix for random effect in order to use the whole rgb range. So 255 is not excluded anymore. (#7156) 2017-04-18 11:46:18 +02:00
Robbie Trencheny
9c0171ec5e Track device last identify time 2017-04-17 23:31:50 -07:00
Robbie Trencheny
b7141901f6 Change iOS sensor unique ID to use the device ID 2017-04-17 22:58:04 -07:00
Robbie Trencheny
919bb08d02 Fix iOS icon calculation to return mdi:battery for levels above 95 2017-04-17 22:51:06 -07:00
Pascal Vizeli
cec39077ba Fix HassIO timeout bug (#7155)
* Fix HassIO timeout bug

* fix lint

* Add long polling timeout to stop event
2017-04-18 00:25:50 +02:00
thecynic
9ed4ed2e47 lutron: fix typo that prevented callback registration (#7148) 2017-04-17 23:04:44 +02:00
Anders Melchiorsen
d4b05a6a85 Fix LIFX lights with disappearing names (#7119)
* Cache the name of LIFX lights

After #7031 the LIFX device will change during an unregister/register
transition. This has the user-visible effect of the new device missing
a friendly name until the next poll.

We now cache the name internally and it will then transfer to the new
device when it registers.

* Allow LIFX logging even without an available device

This will allow us to set the device to None when it unregisters.

* Calculate LIFX availability from the existence of a device

This has become possible because the device is no longer needed
to provide the name of the light when it is unavailable.

We just have to forget the device when it unregisters.
2017-04-16 17:40:22 -07:00
Anders Melchiorsen
103377bdb0 Add LIFX Cloud scene support (#7124)
This uses the LIFX HTTP API to list and activate the scenes that are
stored in the LIFX cloud by the native LIFX smartphone apps.
2017-04-16 16:40:12 -07:00
Anders Melchiorsen
5fa8037231 Always return True/False from is_state and is_state_attr (#7138)
* Always return True/False from is_state and is_state_attr

These functions are documented to always return True/False but the
short-circuit evaluation would return None if the entity_id did not exist.

* Reword into a single statement
2017-04-16 16:36:15 -07:00
Paulus Schoutsen
a2d268a061 Merge pull request #7142 from home-assistant/release-0-42-4
0.42.4
2017-04-16 16:02:10 -07:00
Adam Mills
37f959eb02 Add debug logging to automation initial state (#7068) 2017-04-16 15:45:40 -07:00
Robbie Trencheny
1ce2b6357a Replace rollershutter with cover in demo (#7140) 2017-04-16 15:27:03 -07:00
Adam Mills
527223b992 Fix for zwave RGB setting (#7137) 2017-04-16 15:07:11 -07:00
Adam Mills
409fd62a7c Fix for zwave RGB setting (#7137) 2017-04-16 15:06:59 -07:00
Robbie Trencheny
fadd33bcb2 Make version number optional and a string to fix identify issue introduced in iOS 1.0.1 (#7141) 2017-04-16 15:00:08 -07:00
Fabian Affolter
904b017552 Upgrade aiohttp to 2.0.7 (#7106) 2017-04-16 15:00:08 -07:00
Martin Hjelmare
1efa6eaf0f Fix mysensors callback (#7057)
* Fix mysensors callback

* All messages was not triggering proper updates. Fix by checking all
  child value types each update.

* Upgrade mysensors dep

* Fix pickle persistence when upgrading.
2017-04-16 15:00:08 -07:00
Paulus Schoutsen
9744ec584a Version bump to 0.42.4 2017-04-16 14:59:15 -07:00
Robbie Trencheny
58dfc1d1b1 Make version number optional and a string to fix identify issue introduced in iOS 1.0.1 (#7141) 2017-04-16 14:53:03 -07:00
Paulus Schoutsen
951af6c76d Make Tradfri discoverable (#7128)
* Make Tradfri discoverable

* Fix lint errors

* Fix bugs and clean up calls to light_control

* Add more color util tests

* Add coap client to dockerfile
2017-04-16 14:37:39 -07:00
Patrik
75242e67a7 IKEA Tradfri Gateway: added support for RGB (#7115)
* After rebase and all fixes

* Added color_rgb_to_hex to util.color

* Added test_color_rgb_to_hex

* Changed reference to color_rgb_to_hex

* Bumped to pytradfri 0.5, having support for retry

* Bumped to pytradfri 0.5, having support for retry

* Bumped to pytradfri 0.5, having support for retry

* Bumped to pytradfri 0.5, having support for retry

* Rolled back to 0.4

* Rolled back to 0.4
2017-04-16 11:35:52 -07:00
Paulus Schoutsen
a1208261a8 Load zwave panel (#7127)
* Load Z-Wave panel when component loads

* Update frontend

* Fix tests
2017-04-16 11:10:55 -07:00
Martin Hjelmare
3528705afd Bump version to 0.43.0.dev0 (#7132) 2017-04-16 13:27:25 +02:00
Gianluca Barbaro
7d76186798 Mqtt camera (#7092)
* first commit

* minor fixes

* minor fix

* async_camera_image + test

* minor fix

* async calls
2017-04-16 11:06:57 +02:00
Marcelo Moreira de Mello
9249b6bc33 Upgraded Amcrest module to 1.1.9 to support new firmware versions: (#7130)
- V2.400.AC01.15.R.20170328
    - V2.420.AC00.17.R.20170322
2017-04-16 09:05:15 +02:00
Anders Melchiorsen
6cbe28a9cd Send stderr of ping tracker to devnull (#7096)
When pinging an inaccessible device, OS errors like

    ping: sendto: No route to host

can occur. For a ping tracker this is not an error but rather a normal
situation. Thus, it makes sense to hide the error.
2017-04-15 19:00:01 -07:00
Fabian Affolter
f7b6f8e8fb Upgrade chardet to 3.0.2 (#7112) 2017-04-15 18:32:06 -07:00
Adam Mills
35de3a1dc4 Use third-party lib aioautomatic for automatic (#7126) 2017-04-15 18:11:36 -07:00
Robbie Trencheny
815422a886 Merge pull request #7109 from home-assistant/allow-extra-in-zone-config
Allow extra keys in zone config
2017-04-15 16:39:29 -07:00
Fabian Affolter
c43a3efabd Remove globally disabled pylint issue and update docstrings (#7111) 2017-04-15 00:32:04 +02:00
Fabian Affolter
b0ffc55cfa Upgrade speedtest-cli to 1.0.4 (#7105) 2017-04-15 00:28:04 +02:00
Fabian Affolter
cce372ff66 Update file header, add const for defaults, and update log messages (#7110) 2017-04-15 00:26:04 +02:00
Fabian Affolter
5ffda53805 Upgrade aiohttp to 2.0.7 (#7106) 2017-04-15 00:18:39 +02:00
Robbie Trencheny
60f7a1947f Allow extra keys in zone config 2017-04-14 14:31:10 -07:00
Adam Mills
0ca80cc27e No product ids configured should fetch all ids (#7091) 2017-04-14 19:09:21 +02:00
Adam Mills
46352f6de9 Uber version bump (#7100) 2017-04-14 19:08:28 +02:00
Robbie Trencheny
7e3e742938 Merge pull request #7094 from robbiet480/zwave-manufacturer-product-names
Break Z-Wave product name up into manufacturer name and product name
2017-04-13 23:10:40 -07:00
Robbie Trencheny
e5756ba41d Break product name up into manufacturer name and product name 2017-04-13 22:48:59 -07:00
Andrey
b6ee2332f4 Better thread safety in zwave node_entity (#7087)
* Better thread safety

* Update node_entity.py
2017-04-13 23:45:27 +03:00
Patrik
c267326891 Added initial support for IKEA Tradfri Gateway (#7074)
* Added initial support for IKEA Tradfri Gateway

* Pinned requirement

* Fixed lint-errors

* Added file to .coveragerc

* Trying to fix commit

* Fixed requirements_all again

* Minor reorder of code

* Minor reorder of code

* Made the changes suggested by @balloob

* Made the changes suggested by @balloob and removed debug

* Update tradfri.py
2017-04-13 10:04:42 -07:00
John Arild Berentsen
38ad5714cd Add support fo map data from Neato (#6939)
* Responsiveness

* Delay was not needed as commands does not return until done.

* Add support for cleaning maps and cleaning data

* Hound

* Docstring

* Update requirements

* Review changes

* External lib now returns the raw data.

* debug

* Sensor did not refresh

* Error handling

* Issue warning on connection error

* Update requirements

* Review changes
2017-04-13 07:41:25 -07:00
Colin O'Dell
01c7616147 Bump qnapstats library version to 0.2.4 (#7085) 2017-04-13 07:39:36 -07:00
Gianluca Barbaro
fa65783f39 MQTT: Managing binary payloads (#6976)
* Managing binary payloads

Hello,
background: I wrote a HA camera component that gets the image from a binary payload. I'm testing it with Zanzito (https://play.google.com/store/apps/details?id=it.barbaro.zanzito) and it works apparently well: it gets the image and correctly displays it in the front-end.
But I had to make the changes I'm proposing here: the message was being blocked because the utf-8 decoding failed.
As far as I know, the utf-8 encoding is required for the topic, not for the payload. What I did here was try the utf-8 decoding, but even if unsuccessful, it dispatches the message anyway.
Is there anything else I'm missing?
thanks
Gianluca

* Update __init__.py

* Update __init__.py

* Update __init__.py

* git test - ignore

* Should work

* minor fixes

* updated mqtt/services.yaml

* added two tests, modified threaded subscribe

* removing polymer

* requested changes

* requested changes - minor fix

* security wrap around payload_file_path

* services.yaml updated

* removed file publishing

* minor fix
2017-04-13 07:38:09 -07:00
Thibault Cohen
9a9342ec3f Fix account balance in fido sensor (#7077) 2017-04-13 07:42:48 +02:00
Robbie Trencheny
34cb02177d Bump braviarc version to 0.3.7 (#7078) 2017-04-12 18:22:23 -07:00
Robbie Trencheny
5ba4033651 Merge pull request #6869 from JesseWebDotCom/dev
Exposed more attributes, enabled play_media tv show or season episodes
2017-04-12 15:17:53 -07:00
Andrey
5e18c997f7 Add product_name attribute to zwave nodes. (#7071) 2017-04-12 21:12:37 +03:00
John Arild Berentsen
d63028e44a Add communication data attributes to Zwave node_entity (#6813)
* Add quality attribute to node

* Move quality to node_entity

* adjustments

* Line lenght

* flake8

* Cleanup and add each entry from getNodeStatistics as attribute

* resolve conflict

* Move NETWORK to hass.data

* Test Done

* Cleanup from review

* Resolve conflicts

* Review changes

* Long lines....

* blank line

* import-error-disable

* Update tests Part1... Again

* Hound

* Argh!

* Argh!

* YABBADABBADOOOOOOO!

* Enhance tests

* hound

* Resolve

* resolve tests...
2017-04-12 19:09:29 +02:00
hawk259
f68542ba0d Adding AlarmDecoder platform (#6900)
* Added AlarmDecoder platform

* remove try/catch for generic execption

* Changes for @pvizeli, thanks for the review!

Removed _ prefix from normal function variables
Removed _hass as it will be set via .hass for us
Broke out the three config (socket, serial, usb) and use vol.Any
Added support for USB I think, don't have device, but should work
Removed components dictionary, was form old group all code that didn't work

* Fix hass string handling
2017-04-12 11:35:35 +02:00
Pascal Vizeli
9d20a17642 Lutron. Bugfix callback registration. (#7042)
* Lutron. Bugfix callback registration.

* Change handling to event
2017-04-12 09:52:01 +02:00
Pascal Vizeli
e026717239 Fix handling with register callbacks on added_to_hass (#7067) 2017-04-12 09:51:19 +02:00
Fabian Affolter
f06cff35ff Upgrade paho-mqtt to 1.2.2 (#7066) 2017-04-12 09:48:21 +02:00
sander76
7cb8f49d62 Telegram bot component (incl. webhook and polling platform) (#6913)
* first commit.

* removed pointless string statement

* manually removed  # homeassistant.components.telegram_webhooks from requirements_all.txt

* deleted obsolete file.

* coveragerc abc
2017-04-11 21:10:56 -07:00
Paulus Schoutsen
edf500e66b Upgrade netdisco to 1.0.0rc2 (#7008)
* Upgrade netdisco to 1.0.0rc2

* fix tests
2017-04-11 20:10:02 -07:00
Paulus Schoutsen
72a01b8a90 Speed up aiohttp (#7064) 2017-04-11 19:58:54 -07:00
micw
3c35d5ea58 Fix/slugify with german umlaut ss (#7029)
* more tests for slugify

* Fix german umlauts in slugify

* Update __init__.py
2017-04-11 19:51:07 -07:00
Paulus Schoutsen
4d9e681fc1 Constrain chardet to 2.3 (#7063) 2017-04-11 19:50:43 -07:00
Martin Hjelmare
4e388666b2 Fix mysensors callback (#7057)
* Fix mysensors callback

* All messages was not triggering proper updates. Fix by checking all
  child value types each update.

* Upgrade mysensors dep

* Fix pickle persistence when upgrading.
2017-04-11 19:17:09 -07:00
johanpalmqvist
ed012014bc Add MaryTTS platform (#6988)
* Add MaryTTS platform

* Fix lint error

* Doc link, config and formatting fixes

* Remove stuff not needed with aiohttp2

* Get rid of unnecessary else statement
2017-04-11 22:52:44 +02:00
Paulus Schoutsen
bf6c4604f4 Merge pull request #7050 from home-assistant/release-0-42-3
0.42.3
2017-04-11 09:30:04 -07:00
Pascal Vizeli
c91cf66dec Bugfix slider (#7047)
* Bugfix slider

* Update input_slider.py

* Update input_slider.py
2017-04-11 09:24:25 -07:00
Pascal Vizeli
11125864c6 Bugfix slider (#7047)
* Bugfix slider

* Update input_slider.py

* Update input_slider.py
2017-04-11 09:23:41 -07:00
Pascal Vizeli
7377ce2640 Bugfix wait on start event (#7013)
* Bugfix wait on start event

* Paulus sugestion

* Change handling with stop_track_task

* Add new unittests

* Update test_core.py
2017-04-11 09:15:31 -07:00
Anders Melchiorsen
0013139591 Plug file leak on LIFX unregister (#7031)
* Plug file leak on LIFX unregister

The aiolifx 0.4.4 release closes its socket when the unregister callback is
called. This plugs a file descriptor leak but also means that we must be
careful to not use the device after it goes unavailable.

Also, when a light reappears, it has a new device that must be used.

* Do not test self.available in service calls

The core will learn to handle that.
2017-04-11 09:15:30 -07:00
Fabian Affolter
e3c2d27f4a Fix US states check (fixes #7015) (#7017) 2017-04-11 09:15:30 -07:00
Xorso
f00d721293 Bump pyalarmdotcom to support new version of aiohttp (#7021)
Add an optional extended description…
2017-04-11 09:15:30 -07:00
Paulus Schoutsen
b295451d46 Fix two more instances of JSON parsing synology (#7014)
Add an optional extended description…
2017-04-11 09:15:30 -07:00
Paulus Schoutsen
7a3df037ba Fix Synology camera content type (#7010) 2017-04-11 09:15:30 -07:00
Paulus Schoutsen
a60e8b16c0 Version bump to 0.42.3 2017-04-11 09:14:37 -07:00
Pascal Vizeli
b52cabf2c0 Bugfix wait on start event (#7013)
* Bugfix wait on start event

* Paulus sugestion

* Change handling with stop_track_task

* Add new unittests

* Update test_core.py
2017-04-11 09:09:31 -07:00
Fabian Affolter
cc459e25cc Remove configuration sample (#7048) 2017-04-11 09:05:27 -07:00
Pascal Vizeli
d7ca9e7a66 Make core to look avilable state of device on servicecall (#7045) 2017-04-11 08:59:46 -07:00
Anders Melchiorsen
f099aee69a Plug file leak on LIFX unregister (#7031)
* Plug file leak on LIFX unregister

The aiolifx 0.4.4 release closes its socket when the unregister callback is
called. This plugs a file descriptor leak but also means that we must be
careful to not use the device after it goes unavailable.

Also, when a light reappears, it has a new device that must be used.

* Do not test self.available in service calls

The core will learn to handle that.
2017-04-11 08:58:51 -07:00
David Straub
07bb64815d Missing line name restriction added (fixes #7039) (#7040) 2017-04-11 13:55:42 +02:00
Fabian Affolter
2cfdb44df6 Upgrade sendgrid to 4.0.0 (#7038) 2017-04-11 13:52:47 +02:00
Fabian Affolter
2748bc4165 Upgrade psutil to 5.2.2 (#7037) 2017-04-11 13:52:34 +02:00
micw
f76a4b2806 Feature/min max improvements (#6786)
* Fix #6783, remove a test that makes no sense anymore

* Fix #6784

* Fix typo in docstring

* Fix handling of known->unknown state, extended test, fix lint errors

* Better handling of mismatch in unit of measurement.

Set state to "unkown" and unit of measurement to "ERR" if unit of measurement differs between aggregatet states.
Add entity_id to logged warning.

* Make icon configurable

* Fix typo

* Fix lint

* Fix lint

* Fix lint

* Add option to set entity_id on min_max sensor

* Fix lint logging-not-lazy

* Revert "Add option to set entity_id on min_max sensor"

This reverts commit 4685f26647.

* Revert "Make icon configurable"

This reverts commit fe45aec82d.

* Fixes
2017-04-11 13:52:12 +02:00
pezinek
197db6bded Google TTS can't read percent sign (#6971) (#7030) 2017-04-11 10:27:45 +02:00
happyleavesaoc
aa3ccf16ca update fedex (#7034) 2017-04-11 08:10:31 +02:00
happyleavesaoc
aa91351ff0 update usps version (#7035) 2017-04-11 08:10:07 +02:00
happyleavesaoc
32da163421 bump ups version (#7033) 2017-04-11 08:09:39 +02:00
Adam Mills
ee988dc884 Additional ZWave coverage (#7024)
* Additional ZWave coverage

* setup_platform tests
2017-04-10 16:11:39 -04:00
micw
05eb73a0e3 more tests for slugify (#7027) 2017-04-10 22:51:46 +03:00
Fabian Affolter
89e8e1a4c7 Replace 'vendor_id' with 'arch' (fixes #7003) (#7023) 2017-04-10 18:43:40 +02:00
Paulus Schoutsen
d081e5ab3a Remove deprecated remote classes (#7011)
* Remove deprecated remote classes

* Lint

* Fix tests

* Lint
2017-04-10 09:04:19 -07:00
Fabian Affolter
ab247b0f4d Fix US states check (fixes #7015) (#7017) 2017-04-10 16:13:43 +02:00
Xorso
6cd3758b58 Bump pyalarmdotcom to support new version of aiohttp (#7021)
Add an optional extended description…
2017-04-10 16:13:07 +02:00
Paulus Schoutsen
90e73fda3c Fix two more instances of JSON parsing synology (#7014)
Add an optional extended description…
2017-04-10 10:18:37 +02:00
Paulus Schoutsen
d5e3cd51a5 Fix Synology camera content type (#7010) 2017-04-10 08:19:22 +02:00
Greg Dowling
ecfe0770ed Bump pywemo version. (#7004) 2017-04-09 22:48:18 +01:00
Paulus Schoutsen
6cc5bb0713 Merge pull request #6995 from home-assistant/release-0-42-2
0.42.2
2017-04-09 01:37:18 -07:00
Paulus Schoutsen
f6e819e799 Downgrade aiohttp to 205 (#6994) 2017-04-09 01:36:36 -07:00
Paulus Schoutsen
c42293eb10 Downgrade aiohttp to 205 (#6994) 2017-04-09 01:36:01 -07:00
Paulus Schoutsen
a6dc86fa75 version bump to 0.42.2 2017-04-09 01:31:46 -07:00
Paulus Schoutsen
9c386c68dd Merge pull request #6993 from home-assistant/release-0-42-1
0.42.1
2017-04-09 01:06:10 -07:00
Paulus Schoutsen
f51d705ac7 Make discovery not block start (#6991)
* Make discovery not block start

* Fix tests
2017-04-09 01:06:16 -07:00
Paulus Schoutsen
ba8488d8f1 Make discovery not block start (#6991)
* Make discovery not block start

* Fix tests
2017-04-09 01:05:34 -07:00
Paulus Schoutsen
62d0df4f73 Upgrade to aiohttp 2.0.6 (#6992) 2017-04-08 18:30:02 -07:00
Paulus Schoutsen
d675804119 Version bump to 0.42.1 2017-04-08 18:29:39 -07:00
Paulus Schoutsen
eb0a9869d8 Upgrade to aiohttp 2.0.6 (#6992) 2017-04-08 18:29:28 -07:00
Paulus Schoutsen
cd8723f742 Merge pull request #6956 from home-assistant/release-0-42
0.42
2017-04-08 15:40:30 -07:00
Marcelo Moreira de Mello
50cc2ed97c Bump Amcrest module to 1.1.8 (#6990)
Fixed traceback when calculating SD card percent storage

   self._state = self._camera.percent(sd_used[0], sd_total[0])
AttributeError: 'Http' object has no attribute 'percent'
2017-04-08 14:55:12 -07:00
Paulus Schoutsen
dea9aec268 Warn if start takes a long time. (#6975)
* Warn if start takes a long time.

* ps - cleanup

* Tweak message

* Add tests

* Tweak messagE
2017-04-08 14:55:12 -07:00
Paulus Schoutsen
5d3fe83e62 Warn if start takes a long time. (#6975)
* Warn if start takes a long time.

* ps - cleanup

* Tweak message

* Add tests

* Tweak messagE
2017-04-08 14:53:32 -07:00
happyleavesaoc
2277778d8d update gstreamer (#6987) 2017-04-08 14:53:16 -07:00
Marcelo Moreira de Mello
c5d89499fa Bump Amcrest module to 1.1.8 (#6990)
Fixed traceback when calculating SD card percent storage

   self._state = self._camera.percent(sd_used[0], sd_total[0])
AttributeError: 'Http' object has no attribute 'percent'
2017-04-08 14:52:10 -07:00
Adam Mills
31da54d530 Add tests for ZWaveDeviceEntityValues helper (#6978)
* Add tests for ZWaveDeviceEntityValues helper

* Add remaining coverage
2017-04-08 06:34:59 -07:00
Teemu R
5a2ab3167b switch.tplink: bump pyhs100 version requirement (#6986) 2017-04-08 06:33:59 -07:00
Teemu R
475ac52180 switch.tplink: bump pyhs100 version requirement (#6986) 2017-04-08 06:33:25 -07:00
John Mihalic
660b1b616b Update Emby for aiohttp v2 (#6981) 2017-04-08 04:51:47 -07:00
Paulus Schoutsen
d8558ad173 Fix control+c quitting HASS (#6974) 2017-04-08 04:50:52 -07:00
Pascal Vizeli
a93c01788d Bugfix time and task coro (#6968)
* Bugfix time and task coro

* fix also other create_task

* fix tests

* fix lint in test
2017-04-08 04:50:52 -07:00
Adam Mills
d3c1a48475 Update kodi for aiohttp2 (#6967) 2017-04-08 04:50:52 -07:00
happyleavesaoc
01672e63ea Crime Reports sensor (#6966)
* add crimereports

* add crimereports metadata

* implicit interval

* remove zone support
2017-04-08 04:50:52 -07:00
viswa-swami
382519e082 Foscam Camera: Adding exception handling when fetching the camera image to avoid python exception errors when host is not reachable or rather any url error to camera (#6964)
* Adding exception handling when fetching the camera image to avoid python errors when host is not reachable or any url errors to camera

* Added exception as ConnectionError instead of plain except

* Added exception as ConnectionError instead of plain except. Removed the unused error handle
2017-04-08 04:50:52 -07:00
Andrey
5d1dbd61b2 Preserve customize glob order. (#6963)
* Preserve customize glob order.

* add tests
2017-04-08 04:50:52 -07:00
aufano
69dee168a1 Fix current_temperature is rounded (#6960)
* Fix current_temperature is rounded

* fix  Unnecessary parens after 'if'
2017-04-08 04:50:52 -07:00
Teemu R
6d8af58891 light.yeelight: catch i/o related exceptions from the backend lib (#6952)
Fixes/mitigates problems with #5949 and #6624
2017-04-08 04:50:52 -07:00
Pascal Vizeli
0bb224d8c7 Initial import for HassIO (#6935)
* Initial import for HassIO

* Cleanup api code for views

* First unittest for view

* Add test for edit view

* Finish unittest

* fix addons test

* cleanup service.yaml

* Address first round with ping command

* handle timeout dynamic

* fix lint
2017-04-08 04:50:52 -07:00
Teemu R
55077b9965 switch.tplink: upgrade to the newest upstream release which adds support for plugs using the newer communication protocol (#6979) 2017-04-07 19:19:11 -07:00
John Mihalic
ad8ee1383c Update Emby for aiohttp v2 (#6981) 2017-04-07 19:17:10 -07:00
Paulus Schoutsen
64174f5763 Fix control+c quitting HASS (#6974) 2017-04-07 21:02:49 +02:00
Adam Mills
df77529bfe Tests for zwave services (#6937)
* Initial tests for zwave services

* Fix linter issues

* Complete zwave service tests
2017-04-07 09:17:23 -04:00
Nate
8cff98d07b From Dusk till Dawn (#6857)
* Added dawn, dusk, noon and midnight to the Sun component

* Created a helper method for the solar events
2017-04-06 22:59:41 -07:00
happyleavesaoc
216c2682f0 Crime Reports sensor (#6966)
* add crimereports

* add crimereports metadata

* implicit interval

* remove zone support
2017-04-06 22:47:03 -07:00
Teemu R
d952a07658 light.yeelight: catch i/o related exceptions from the backend lib (#6952)
Fixes/mitigates problems with #5949 and #6624
2017-04-06 22:41:47 -07:00
viswa-swami
9254e7e862 Foscam Camera: Adding exception handling when fetching the camera image to avoid python exception errors when host is not reachable or rather any url error to camera (#6964)
* Adding exception handling when fetching the camera image to avoid python errors when host is not reachable or any url errors to camera

* Added exception as ConnectionError instead of plain except

* Added exception as ConnectionError instead of plain except. Removed the unused error handle
2017-04-06 22:40:33 -07:00
Andrey
f96e06a2c2 Preserve customize glob order. (#6963)
* Preserve customize glob order.

* add tests
2017-04-06 22:39:35 -07:00
Pascal Vizeli
3e66df50c8 Initial import for HassIO (#6935)
* Initial import for HassIO

* Cleanup api code for views

* First unittest for view

* Add test for edit view

* Finish unittest

* fix addons test

* cleanup service.yaml

* Address first round with ping command

* handle timeout dynamic

* fix lint
2017-04-06 22:19:08 -07:00
Pascal Vizeli
74ac160355 Bugfix time and task coro (#6968)
* Bugfix time and task coro

* fix also other create_task

* fix tests

* fix lint in test
2017-04-06 21:00:58 -07:00
JesseWebDotCom
c20d48c8e0 import order fix 2017-04-06 20:52:56 -04:00
aufano
2ce8c2f80e Fix current_temperature is rounded (#6960)
* Fix current_temperature is rounded

* fix  Unnecessary parens after 'if'
2017-04-06 17:40:59 -07:00
Adam Mills
51dc8b78cc Update kodi for aiohttp2 (#6967) 2017-04-07 00:12:24 +02:00
Fabian Affolter
eb55fc8e77 Update for 0.42 2017-04-06 09:36:57 +02:00
Fabian Affolter
37246449f1 Upgrade sqlalchemy to 1.1.9 (#6955) 2017-04-06 00:27:49 -07:00
Diogo Soares
2551bf8645 Added average temperature for the day before and the current period (#6883)
* Added average temperature for the day before and the current period

* Fixed "line too long" warnings

* Fixed "indentation contains tabs" and "indentation contains mixed spaces and tabs" warnings

* Fixed "trailing whitespace" warnings

* upgrade pyhydroquebec requirements to version 1.1.0
2017-04-06 00:26:26 -07:00
Martin Hjelmare
749f79e813 Upgrade mysensors dep and callbacks (#6950) 2017-04-06 00:21:21 -07:00
Pascal Vizeli
86568b443c Fix startup of sonos / snapshot handling / error handling (#6945)
* Fix startup of sonos / snapshot handling / error handling

* Use decorator for coordinator relay

* fix lint

* Fix unittest

* Move subscribe into executor
2017-04-05 23:24:30 -07:00
Paulus Schoutsen
29f385ea76 Fix automations listening to HOMEASSISTANT_START (#6936)
* Fire EVENT_HOMEASSISTANT_START automations off right away while starting

* Actually have core state be set to 'starting' during boot

* Fix correct start implementation

* Test and deprecate event automation platform on start

* Fix doc strings

* Remove shutting down exception

* More strict when to mark an instance as finished

* Add automation platform to listen for start/shutdown

* When we stop we should wait till it's all done

* Fix testing

* Fix async bugs in tests

* Only set UVLOOP when hass starts from CLI

* This hangs normal asyncio event loop

* Clean up Z-Wave node entity test
2017-04-05 23:23:02 -07:00
Fabian Affolter
289d6b6605 Upgrade py-cpuinfo to 3.0.0 (#6948) 2017-04-05 21:29:59 +02:00
Fabian Affolter
73f69085d9 Upgrade Sphinx to 1.5.5 (#6947) 2017-04-05 21:05:50 +02:00
Thibault Cohen
118bd34d74 Add multi phone numbers support (#6605)
* Add multi phone numbers support

* Update fido.py
2017-04-05 17:18:02 +02:00
Jeff Wilson
f1f033e5d2 Report proper features in mqtt_json light (#6941)
* Add tests for supported features in mqtt_json (it fails)

* Fix supported features in mqtt_json
2017-04-05 14:39:19 +02:00
Adam Mills
75a3747f61 Rename zwave nodes by node ID instead of entity ID (#6938) 2017-04-05 08:11:37 -04:00
Marcelo Moreira de Mello
a5f77d5f46 Clean artifacts after running Ring tests. (#6944)
* Clean artifacts after running Ring tests.

* Clean artifacts from top level test_ring.py
2017-04-05 11:26:56 +02:00
Greg Dowling
534187f4cd Bump pywemo version. Fixes Osram/Sylvania Lightify tunable white bulbs. (#6946)
Add an optional extended description…
2017-04-05 11:26:03 +02:00
Pascal Vizeli
8f4fd951e5 Add android ip webcam support for aiohttp2 (#6940) 2017-04-04 21:40:19 -07:00
JesseWebDotCom
90a834cbda String formatting, import order, type check fixes 2017-04-04 22:33:52 -04:00
citruz
e4e7141ae7 Eddystone Beacon Temperature Sensor (#6789)
* Added eddystone_temperature platform.

* Fixed style issues.

* Fixed style issues #2.

* Fixed style issues #3.

* Added new platform to .coveragerc

* Refactored platform to use the beacontools package.

* Fixed style issues and added beacontools to excluded requirements.

* Removed obsolete constants and added pylint exception.

* Added blank line

* Updated beacontools to version 1.0.0

* Updated beacontools to version 1.0.1

* Forgot to regenerate requirements_all

* Minor changes
2017-04-04 23:57:19 +02:00
Paulus Schoutsen
c4e1255a84 Initial state over restore state (#6924)
* Input Boolean: initial state > restore state

* Input select: initial state overrules restored state

* Input slider: initial state overrule restore state

* Lint

* Lint
2017-04-04 09:29:49 -07:00
Craig J. Ward
c5574c2684 total connect alarm support (#6887)
* total connect alarm support

* linting fixes

* linting fixes

* docstring

* docstring

* use sync and update coveragerc

* remove unused import

* changes as per notes

* Update HA code style
2017-04-04 12:21:53 +02:00
Greg Dowling
dcbc0b490c WIP - Fix bug in state handling in Vera Switch and Light (#6931)
* Fix bug in state handling.

* Tidy.
2017-04-04 12:02:09 +02:00
Klaas Hoekema
57a00c1fbf Allow token authentication for 'hook' switch component (#6922)
The Hook switch component currently uses username/password to get a token
from the Hook web app to use for subsequent requests. This adds an option
to specify the token directly in config.

Makes the 'password' and 'token' options mutually exclusive since
otherwise one would have to take precedence, and it seems worth
preventing people from filling their config with passwords that don't
even need to be there.
2017-04-04 10:55:43 +02:00
Fabian Affolter
aff8c0f695 Upgrade Sphinx to 1.5.4 (#6927) 2017-04-04 10:50:04 +02:00
Fabian Affolter
542e430c1c Upgrade distro to 1.0.4 (#6926) 2017-04-04 10:44:08 +02:00
Fabian Affolter
26e9e59a5b Upgrade paho-mqtt to 1.2.1 (#6928) 2017-04-04 10:43:41 +02:00
Daniel Høyer Iversen
86d265d407 Upgrade flux_led to 0.17 (#6929)
* Update flux_led lib
2017-04-04 10:42:51 +02:00
Paulus Schoutsen
23645da74c Automation: initial state > restore state (#6911)
* Automation: initial state > restore state

* Clean up code

* Ensure MQTT defaults are used.

* Ensure failed platforms always return None

* Automation: write state to state machine after start
2017-04-03 23:11:39 -07:00
Paulus Schoutsen
3895979e39 Update frontend 2017-04-03 23:02:15 -07:00
Greg Dowling
5b9d9954c5 Update vera cover refresh logic (#6897)
* Update cover update logic to fix compatibility bug. Bump vera library.

* Tidy.

* Add missed file.
2017-04-03 22:44:52 -07:00
John Mihalic
4c7ec4932c Bump pyHik library version to support more cameras (#6921) 2017-04-04 06:54:33 +02:00
Adam Mills
06e1c21b1f Support for zwave light transitions (#6868)
* Support for zwave light transitions

* Dimming duration is optional

* Updated supported_features to show transition
2017-04-03 14:56:48 -04:00
Mitesh Patel
01e581aced Adds support for the PlugInDimmer hardware (#6915) 2017-04-03 08:52:02 -07:00
John Arild Berentsen
a107a592de Fix for #6691 Neato Connection error handling (#6731)
* Responsiveness

* Delay was not needed as commands does not return until done.

* Offline error catch

* Remove unneeded code
2017-04-03 14:42:21 +02:00
Dan
134b21dfea Onkyo update (#6906)
* Update onkyo req, change volume to int

* Update Onkyo

Updates onkyo component. Pulls added sources (Bluetooth, built-in
streaming, etc.)

* Regenerated requirements_all.txt via script

* Update onkyo.py

* Update requirements_all.txt
2017-04-03 00:35:36 -07:00
David McNett
c27a526f5b Eliminate needless async_add_job invocation of async_add_devices (#6864) 2017-04-03 00:01:53 -07:00
Marcelo Moreira de Mello
f4d2ece2fe Make sensor.ring to handle scan_interval option as expected. (#6886)
* Make sensor.ring to handle scan_interval option as expected.

* Fix lint

* Fixed lint timedelta
2017-04-02 23:46:54 -07:00
Marcelo Moreira de Mello
5b8f1850fa Makes amcrest.sensor to handle properly the scan_interval option. (#6885)
* Makes amcrest.sensor to handle scan_interval option as expected.

* Added _LOGGER.debug statement for troubleshooting.

* Fixed lint
2017-04-02 23:46:18 -07:00
Paulus Schoutsen
ce42648a51 Update README.rst 2017-04-02 17:35:03 -07:00
Paulus Schoutsen
36e5878b2e Move examples out (#6908)
* Remove examples from main repo

* Simplify README

* Point screenshot for components at dev branch for now
2017-04-02 17:01:51 -07:00
Dan
f0027e3cc1 Fox UMP volume set (#6904)
async needs consistant paramater namming accross platforms. This fixes
UMP's volume set method by renaming the paramater.
2017-04-02 15:31:28 -07:00
Wolfgang Malgadey
864b57d42c Fix Tado climate set off mode (#6848) 2017-04-02 12:47:15 -04:00
JesseWebDotCom
b99dd19ad6 Fixed log errors if session username or content rating is blank 2017-04-02 10:51:03 -04:00
Daniel Høyer Iversen
8806265e99 Fluxled (#6892)
* Update flux_led lib
2017-04-02 14:12:38 +02:00
ChristianKuehnel
2413d97415 added support for Fibaro FGR-222 (similar to FGRM-222) (#6890) 2017-04-02 12:41:53 +03:00
Fabian Affolter
395f9b6548 Upgrade sqlalchemy to 1.1.8 (#6873) 2017-04-01 12:36:46 +02:00
Fabian Affolter
7afe694cc7 Upgrade aiohttp_cors to 0.5.2 (#6874) 2017-04-01 12:36:35 +02:00
Fabian Affolter
ec2df2ca0f Upgrade pytz to 2017.02 (#6875) 2017-04-01 12:36:24 +02:00
Marcelo Moreira de Mello
65b9383e04 Bumped amcrest module to 1.1.5 (#6872) 2017-04-01 12:36:04 +02:00
JesseWebDotCom
ae21fa9ce1 Fixed setting username and content rating data 2017-03-31 23:20:36 -04:00
JesseWebDotCom
564a01f344 mend
Exposed more attributes, enabled play_media tv show or season episodes
2017-03-31 22:36:37 -04:00
JesseWebDotCom
05bab8c808 Exposed more attributes, enabled play_media tv show or season episodes 2017-03-31 22:19:04 -04:00
Fabian Affolter
a0bb554f8a Upgrade speedtest-cli to 1.0.3 (#6867) 2017-03-31 22:57:29 +02:00
Jacob Tomlinson
2d6b09586d Added Met Office weather and sensor components (#6742)
* Added Met Office weather and sensor components

* Removed unnecessary dependancy

* Generated requirements

* Fix time interval

* Updated coverage

* Some review changes

* Allow user to specify lat and lon in component

* Added missing import

* Fixed unit

* Fixed import indent

* Updated condition to use CONDITION_CLASSES
2017-03-31 22:03:27 +02:00
Fabian Affolter
573b2a11c0 Upgrade sphinx-autodoc-typehints to 1.2.0 (#6865) 2017-03-31 21:39:22 +02:00
Fabian Affolter
ac25eff2d0 Upgrade sendgrid to 3.6.5 (#6866) 2017-03-31 12:37:34 -07:00
Marcelo Moreira de Mello
05398a9dff Introduced Ring binary sensors and refactored Ring component (#6520)
* - Introduced Ring binary_sensor.

- Added unittest for Ring binary_sensor.

- Bumped ring_doorbell 3rd party module.

* Updated requirements

* Added correct file for unittest

* - Introduced Ring binary_sensor.

- Added unittest for Ring binary_sensor.

- Bumped ring_doorbell 3rd party module.

* Updated requirements

* Added correct file for unittest

* Added extra sensors last_ding and last_motion

* Modified Ring binary_sensor and sensor to inherit DOMAIN configuration

* Moved static to top ring.py

* Fixed requirements

* Bump version ring_doorbell to 0.1.2

* testing unittests

* Use hass.data dict instead GLOBALS

* Fixed unittests

* Bump ring_doorbell to 0.1.3

* Updated unittest and coverted to use decorator @requests_mock.Mocker()

* Updated ring_session with lower case
2017-03-31 08:53:56 -07:00
Paulus Schoutsen
8c97bccaaa Handle aiohttp task cancellation better (#6862) 2017-03-31 11:55:22 +02:00
Craig J. Ward
5bb201c7fc use change light level to avoid variable ramp speeds (#6860) 2017-03-30 23:53:10 -07:00
Pascal Vizeli
72db4a80dd Update aioHTTP to 2.0.5 (#6856) 2017-03-30 08:27:53 -07:00
Johan Bloemberg
816b1891b5 Add option to disable automatic add for lights and sensors. (#6852) 2017-03-30 08:02:03 -07:00
Beat
ee8701b560 Fix configuration setup (#6853)
When the user exceeds the request limit for google APIs, the response status stays at 200 but the response body is different:
```
{
   "error_message" : "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console: https://console.developers.google.com/apis/credentials?project=_",
   "results" : [],
   "status" : "OVER_QUERY_LIMIT"
}
```
This prevents HA from creating the initial configuration
2017-03-30 15:26:11 +02:00
Paulus Schoutsen
714b516176 aiohttp 2 (#6835)
* Upgrade aiohttp2

* Fix resource caching

* Fix helpers.aiohttp_client

* Lint

* Use static path for api error_log

* Fix ClientErrors import

* Remove not needed DisconnectError

* Remove releasing responses code

* Add timeout if stream starts non responding

* More async_aiohttp_proxy_stream cleanup

* Fix references to ClientError

* Fix fingerprinting

* Fix aiohttp stream tests

* Rename aiohttp_proxy_stream

* Remove impossible darksky test

* Fix sleepiq requests escaping mocker

* Lint

* Remove deprecated parameter

* Break up aiohttp_proxy_stream in 2 methods

* Lint

* Upgrade to aiohttp 2.0.4

* Convert connector close to a callback

* Fix static fingerprinted links
2017-03-30 00:50:53 -07:00
Anders Melchiorsen
7b83a836f3 Lifx legacy (#6847)
* Add legacy LIFX platform for Windows support

The async platform introduced in 9ef084d903 has
turned out to use Python functionality that is not available in Windows.

This commit restores the previous implementation, now named lifx_legacy.

* Add a comment about the platform being a legacy implementation

* Warn when using unsupported lifx platform on Windows

* Update .coveragerc
2017-03-29 23:00:22 -07:00
Johan Bloemberg
ead00e956f Handle initial event after entity is instantiated. (#6760) 2017-03-29 22:50:32 -07:00
Paulus Schoutsen
556dba4020 Convert Alexa tests to use aiohttp test utils (#6839) 2017-03-29 22:21:39 -07:00
Paulus Schoutsen
bfe0aee468 Locative tests to use aiohttp test utils (#6838) 2017-03-29 22:19:58 -07:00
Lewis Juggins
9de4c2b056 [switch.wemo] Fix today_energy_kwh calculation. (#6846)
* [switch.wemo] Fix today_energy_kwh calculation.

* Blank line fail

* Round to two decimal places.
2017-03-29 21:49:28 +02:00
Anubhaw Arya
c935bfce2a Integration with lockitron (#6805)
* Integration with lockitron

* Let super class deal with polling and updating
2017-03-29 17:25:23 +02:00
Martin Hjelmare
7c614a6738 Add voluptuous config validation to scenes (#6830)
* Add platform schema to scene component and homeassistant platform.
* Clean up code and add constants.
* Add unit test and clean up tests.
2017-03-28 23:39:53 -07:00
Xorso
d1b519a418 Updating Alarm.com Component for async and no Selenium (#6752)
* Updating Alarm.com Component for async and no Selenium

* Fixed gen_all_requirements
2017-03-28 23:21:40 -07:00
Johan Bloemberg
e1ed076015 Rflink group commands (#5969)
* Add support for group commands (allon/alloff).
Add 'group_aliasses' config attribute that only respond to group commands.
Add nogroup_aliases that only respond to 'on' 'off' commands.
Allow settings device id group behaviour.

* Fix linting.

* Fix lint.
2017-03-29 01:04:25 -04:00
Oleksii Serdiuk
63c15e997a history_stats: Fix schema, as state can be arbitrary string (#6753) 2017-03-29 00:58:59 -04:00
Andrey
fb8323f48d Remove zwave cover invert workaround. Use config instead. (#6832) 2017-03-28 23:01:29 +03:00
William Scanlon
b5336ed04e Updated pubnubsub-handler version (#6829) 2017-03-28 14:13:45 -04:00
Teemu R
429367409c yeelight: adjust supported features on update() (#6799)
* yeelight: adjust supported features on update()

Earlier we checked for the type only during the initialization,
but this won't work when the bulb is disconnected during the init,
causing failures to adjust rgb&color temperature even if those should be supported.

fixes #6692

* Use reassign instead of OR for updating the supported features
2017-03-28 17:26:43 +02:00
Lewis Juggins
6dba05c79f [switch.wemo] Fix mW to kW conversion. (#6826)
* Fix mW to kW conversion.

* Line length.
2017-03-28 17:24:33 +02:00
Janne Grunau
5c80da6a8f lights/hue: use device class for on/off devices like the osram lightify plug (#6817)
* hue: remove duplicate SUPPORT_FLASH flag

* hue: use correct device class for the Osram Lightify Plug
2017-03-28 00:04:28 +02:00
Fabian Affolter
d027df5a89 Allow to monitor Windows hosts (#6803) 2017-03-27 22:11:15 +02:00
goto100
b8c1bc9542 fix WOL in docker/jail (#6810)
* fix WOL in docker/jail

add ip_address parameter to send_magic_packet if host specific.

in docker/jail, WOL doesn't works due to subnet broadcast issues.

* Update wake_on_lan.py

lint
2017-03-27 14:02:43 +02:00
Greg Dowling
c53de19246 Update Insight parameters using the subscription data. (#6782)
* Update Insight parameters using the subscription dta.

* Minor refactor.

* Tidy.
2017-03-27 12:43:43 +02:00
John Mihalic
f242ad26ca Add NVR support to Hikvision Binary Sensors (#6807)
* Add NVR support to hikvision

* Only append channel for nvr devices

* Descriptor cleanup

* Update requirements
2017-03-27 12:41:57 +02:00
tantecky
a70af62e60 Make get_snmp_data more robust (#6798) 2017-03-27 12:22:59 +02:00
Fabian Affolter
be04ef7be1 Upgrade matrix-client to 0.0.6 (#6808) 2017-03-27 10:35:40 +02:00
Fabian Affolter
f4f72e420a Fix typo and update name (#6809) 2017-03-27 10:35:27 +02:00
Fabian Affolter
84287872bb Use string formatting and remove already global disabled pylint issue (#6801) 2017-03-26 21:13:38 +02:00
David Straub
78b5eb7aac Platform for Munich public transport departure times (#6704)
* Add MVGLive (Munich public transport real-time departure) sensor platform

* Move update on startup to add_devices; rewrite dictionary filtering

* Fix lint error

* Updated requirement to PyMVGLive 1.1.3 (PyPI version)

* Refactor and clean up MVGLiveData.update method

* Shorten line
2017-03-26 19:06:40 +02:00
Fabian Affolter
6e44ccf683 Upgrade pysnmp to 4.3.5 (#6793) 2017-03-26 15:53:53 +02:00
Fabian Affolter
ad649009cd Upgrade zeroconf to 0.19.0 (#6792) 2017-03-26 15:53:42 +02:00
Fabian Affolter
7782e7e948 Add optional unit of measurement (#6796) 2017-03-26 15:52:59 +02:00
Fabian Affolter
5d5547cdb6 Update docstrings (#6795)
* Add link to docs and remove comments which are obvious

* Update docstrings

* Repleace conf details with link to docs

* Add link to docs

* Update docstrings

* Update import

* Update ordering

* Update ordering

* Update docstring

* Update ordering

* Update ordering
2017-03-26 15:50:40 +02:00
Fabian Affolter
22b28d85db Add switch to MQTT discovery (#6733) 2017-03-26 15:48:28 +02:00
Teemu R
f5d4f853ba switch.tplink: upgrade to the newest upstream release which adds support for plugs using the newer communication protocol (#6790) 2017-03-26 10:55:17 +02:00
Fabian Affolter
0f098df232 Merge branch 'master' into dev 2017-03-26 00:07:25 +01:00
John Arild Berentsen
5a7155fc4a Wrong info in discovery schema (#6779) 2017-03-25 19:39:03 +01:00
Nick Sabinske
c817ab08b7 Fix bridge-led support in limitlessled.py (#6776)
Addressing #6382 . Feedback from github & forums is the bridge_led feature never worked and defining the bridge LED as another group+bulb type is the right way to do this in the limitlessled component.
2017-03-25 15:32:57 +01:00
William Scanlon
f8005153c9 Fix wink siren (#6775)
* Fix siren/switch attributes and update python-wink

* Updated requirements_all.txt
2017-03-25 15:28:16 +01:00
Daniel Perna
447048701c Homematic Fixes (#6769)
* Added missing operational modes for thermostats

* Added attributes

* Updated requirements

* Bumped dependency
2017-03-25 09:48:05 +01:00
Pascal Vizeli
f4e9466394 Bugfix automation fire on bootstrap (#6770)
* Bugfix automation fire on bootstrap

* Add test & fix bug

* fix lint
2017-03-24 15:52:14 -07:00
Adam Mills
cffc6c7bea Tests for zwave workaround detection (#6761)
* Tests for zwave workaround detection

* Remove unused code

* Revert "Remove unused code"

This reverts commit e06cce0abe.

* Tests for empty manufacturer ID
2017-03-24 15:31:46 -07:00
Fabian Affolter
8d606f8d16 Upgrade sleekxmpp to 1.3.2 (#6773) 2017-03-24 21:44:04 +01:00
Fabian Affolter
7ae814357a Upgrade psutil to 5.2.1 (#6771) 2017-03-24 21:43:48 +01:00
Fabian Affolter
1be2706de3 Upgrade pydroid-ipcam to 0.7 (#6772) 2017-03-24 21:42:00 +01:00
geekofweek
06d3889e1b Wink Aros Fixes (#6726)
Wink Aros only supports 3 Fan Modes:

Low
Medium
High

Fan Mode had a Typo and wasn't represented in the UI
2017-03-24 16:13:14 -04:00
John Arild Berentsen
ee6c9ab6a9 Typing error and update test (#6757) 2017-03-23 23:53:59 -07:00
John Arild Berentsen
82c599a749 current temp could be none (#6759) 2017-03-23 23:50:36 -07:00
Paulus Schoutsen
0b7f873120 Merge branch 'release-0-41' into dev 2017-03-23 23:34:08 -07:00
Paulus Schoutsen
9f2f0c5566 Version bump to 0.42.0.dev0 2017-03-23 23:33:49 -07:00
Adam Mills
22613d8e2e Repair zwave sensor coverage (#6764) 2017-03-23 20:57:15 -07:00
Adam Mills
efbd66bca1 Fix flaky template test (#6768) 2017-03-23 20:56:39 -07:00
Tim Soderstrom
5dfdb9e481 New indexes for states and recording_runs tables (#6688)
* New indexes for states table

* Added recorder_runs indexes

* Created a new function for compound indexes.

A new function was created because it makes it a little cleaner when creating
a single-field index since one doesn't have to create a list. This is mostly
when creating the name of the index so with a bit more logic it's possible
to combine it into one function. Given how often migration changes are run,
I thought that code bloat was probably a worthy trade-off for now.

* Adjusted indexes, POC for ref indexes by name.

* Corrected lint errors

* Fixed pydocstyle error

* Moved create_index function outside apply_update

* Moved to single line (just barely)
2017-03-23 20:48:31 -07:00
micw
6c5989895a Adding expire_after to mqtt sensor to expire outdated values (#6708)
* Adding expire_after to mqtt sensor to expire outdated values

* Extending test case

* mqtt: refactoring expire_after to use timed events instead of polling; lint

* refactor to reset unused trigger

* Fix: handler must be set to None after execution or removal to avoid warning

* Commenting out non-working test

* Fix lint

* Commit to trigger new build

* Commit to trigger new build

* Make testcase work

* Undo unnecessary change

* Remove default value, add extra check
2017-03-23 17:55:07 -04:00
Daniel Høyer Iversen
3acd926d29 Flux led update lib (#6763)
* Update flux_led lib
2017-03-23 21:58:22 +01:00
2156 changed files with 200937 additions and 48683 deletions

View File

@@ -4,19 +4,51 @@ source = homeassistant
omit =
homeassistant/__main__.py
homeassistant/scripts/*.py
homeassistant/util/async.py
homeassistant/monkey_patch.py
homeassistant/helpers/typing.py
homeassistant/helpers/signal.py
# omit pieces of code that rely on external devices being present
homeassistant/components/abode.py
homeassistant/components/*/abode.py
homeassistant/components/ads/__init__.py
homeassistant/components/*/ads.py
homeassistant/components/alarmdecoder.py
homeassistant/components/*/alarmdecoder.py
homeassistant/components/amcrest.py
homeassistant/components/*/amcrest.py
homeassistant/components/apcupsd.py
homeassistant/components/*/apcupsd.py
homeassistant/components/apple_tv.py
homeassistant/components/*/apple_tv.py
homeassistant/components/arduino.py
homeassistant/components/*/arduino.py
homeassistant/components/bmw_connected_drive/*.py
homeassistant/components/*/bmw_connected_drive.py
homeassistant/components/android_ip_webcam.py
homeassistant/components/*/android_ip_webcam.py
homeassistant/components/arlo.py
homeassistant/components/*/arlo.py
homeassistant/components/asterisk_mbox.py
homeassistant/components/*/asterisk_mbox.py
homeassistant/components/august.py
homeassistant/components/*/august.py
homeassistant/components/axis.py
homeassistant/components/*/axis.py
homeassistant/components/bbb_gpio.py
homeassistant/components/*/bbb_gpio.py
@@ -26,56 +58,178 @@ omit =
homeassistant/components/bloomsky.py
homeassistant/components/*/bloomsky.py
homeassistant/components/coinbase.py
homeassistant/components/sensor/coinbase.py
homeassistant/components/cast/*
homeassistant/components/*/cast.py
homeassistant/components/comfoconnect.py
homeassistant/components/*/comfoconnect.py
homeassistant/components/daikin.py
homeassistant/components/*/daikin.py
homeassistant/components/deconz/*
homeassistant/components/*/deconz.py
homeassistant/components/digital_ocean.py
homeassistant/components/*/digital_ocean.py
homeassistant/components/dominos.py
homeassistant/components/doorbird.py
homeassistant/components/*/doorbird.py
homeassistant/components/dweet.py
homeassistant/components/*/dweet.py
homeassistant/components/eight_sleep.py
homeassistant/components/*/eight_sleep.py
homeassistant/components/ecobee.py
homeassistant/components/*/ecobee.py
homeassistant/components/egardia.py
homeassistant/components/*/egardia.py
homeassistant/components/enocean.py
homeassistant/components/*/enocean.py
homeassistant/components/envisalink.py
homeassistant/components/*/envisalink.py
homeassistant/components/fritzbox.py
homeassistant/components/switch/fritzbox.py
homeassistant/components/eufy.py
homeassistant/components/*/eufy.py
homeassistant/components/gc100.py
homeassistant/components/*/gc100.py
homeassistant/components/google.py
homeassistant/components/*/google.py
homeassistant/components/insteon_hub.py
homeassistant/components/*/insteon_hub.py
homeassistant/components/hdmi_cec.py
homeassistant/components/*/hdmi_cec.py
homeassistant/components/hive.py
homeassistant/components/*/hive.py
homeassistant/components/homekit_controller/__init__.py
homeassistant/components/*/homekit_controller.py
homeassistant/components/homematic/__init__.py
homeassistant/components/*/homematic.py
homeassistant/components/homematicip_cloud.py
homeassistant/components/*/homematicip_cloud.py
homeassistant/components/hydrawise.py
homeassistant/components/*/hydrawise.py
homeassistant/components/ihc/*
homeassistant/components/*/ihc.py
homeassistant/components/insteon_local.py
homeassistant/components/*/insteon_local.py
homeassistant/components/insteon_plm.py
homeassistant/components/insteon_plm/*
homeassistant/components/*/insteon_plm.py
homeassistant/components/ios.py
homeassistant/components/*/ios.py
homeassistant/components/iota.py
homeassistant/components/*/iota.py
homeassistant/components/isy994.py
homeassistant/components/*/isy994.py
homeassistant/components/joaoapps_join.py
homeassistant/components/*/joaoapps_join.py
homeassistant/components/juicenet.py
homeassistant/components/*/juicenet.py
homeassistant/components/kira.py
homeassistant/components/*/kira.py
homeassistant/components/knx.py
homeassistant/components/*/knx.py
homeassistant/components/konnected.py
homeassistant/components/*/konnected.py
homeassistant/components/lametric.py
homeassistant/components/*/lametric.py
homeassistant/components/linode.py
homeassistant/components/*/linode.py
homeassistant/components/lutron.py
homeassistant/components/*/lutron.py
homeassistant/components/lutron_caseta.py
homeassistant/components/*/lutron_caseta.py
homeassistant/components/mailgun.py
homeassistant/components/*/mailgun.py
homeassistant/components/matrix.py
homeassistant/components/*/matrix.py
homeassistant/components/maxcube.py
homeassistant/components/*/maxcube.py
homeassistant/components/mochad.py
homeassistant/components/*/mochad.py
homeassistant/components/modbus.py
homeassistant/components/*/modbus.py
homeassistant/components/mysensors.py
homeassistant/components/mychevy.py
homeassistant/components/*/mychevy.py
homeassistant/components/mysensors/*
homeassistant/components/*/mysensors.py
homeassistant/components/nest.py
homeassistant/components/neato.py
homeassistant/components/*/neato.py
homeassistant/components/nest/__init__.py
homeassistant/components/*/nest.py
homeassistant/components/netatmo.py
homeassistant/components/*/netatmo.py
homeassistant/components/netgear_lte.py
homeassistant/components/*/netgear_lte.py
homeassistant/components/octoprint.py
homeassistant/components/*/octoprint.py
homeassistant/components/qwikswitch.py
homeassistant/components/*/qwikswitch.py
homeassistant/components/opencv.py
homeassistant/components/*/opencv.py
homeassistant/components/pilight.py
homeassistant/components/*/pilight.py
homeassistant/components/switch/qwikswitch.py
homeassistant/components/light/qwikswitch.py
homeassistant/components/rachio.py
homeassistant/components/*/rachio.py
homeassistant/components/raincloud.py
homeassistant/components/*/raincloud.py
homeassistant/components/rainmachine/*
homeassistant/components/*/rainmachine.py
homeassistant/components/raspihats.py
homeassistant/components/*/raspihats.py
homeassistant/components/rfxtrx.py
homeassistant/components/*/rfxtrx.py
@@ -83,21 +237,69 @@ omit =
homeassistant/components/rpi_gpio.py
homeassistant/components/*/rpi_gpio.py
homeassistant/components/rpi_pfio.py
homeassistant/components/*/rpi_pfio.py
homeassistant/components/sabnzbd.py
homeassistant/components/*/sabnzbd.py
homeassistant/components/satel_integra.py
homeassistant/components/*/satel_integra.py
homeassistant/components/scsgate.py
homeassistant/components/*/scsgate.py
homeassistant/components/skybell.py
homeassistant/components/*/skybell.py
homeassistant/components/smappee.py
homeassistant/components/*/smappee.py
homeassistant/components/sonos/__init__.py
homeassistant/components/*/sonos.py
homeassistant/components/tado.py
homeassistant/components/*/tado.py
homeassistant/components/tahoma.py
homeassistant/components/*/tahoma.py
homeassistant/components/tellduslive.py
homeassistant/components/*/tellduslive.py
homeassistant/components/tellstick.py
homeassistant/components/*/tellstick.py
homeassistant/components/tesla.py
homeassistant/components/*/tesla.py
homeassistant/components/thethingsnetwork.py
homeassistant/components/*/thethingsnetwork.py
homeassistant/components/*/thinkingcleaner.py
homeassistant/components/toon.py
homeassistant/components/*/toon.py
homeassistant/components/tradfri.py
homeassistant/components/*/tradfri.py
homeassistant/components/twilio.py
homeassistant/components/notify/twilio_sms.py
homeassistant/components/notify/twilio_call.py
homeassistant/components/upcloud.py
homeassistant/components/*/upcloud.py
homeassistant/components/usps.py
homeassistant/components/*/usps.py
homeassistant/components/velbus.py
homeassistant/components/*/velbus.py
homeassistant/components/velux.py
homeassistant/components/*/velux.py
homeassistant/components/vera.py
homeassistant/components/*/vera.py
@@ -107,139 +309,187 @@ omit =
homeassistant/components/volvooncall.py
homeassistant/components/*/volvooncall.py
homeassistant/components/waterfurnace.py
homeassistant/components/*/waterfurnace.py
homeassistant/components/*/webostv.py
homeassistant/components/wemo.py
homeassistant/components/*/wemo.py
homeassistant/components/wink.py
homeassistant/components/wink/*
homeassistant/components/*/wink.py
homeassistant/components/zigbee.py
homeassistant/components/*/zigbee.py
homeassistant/components/wirelesstag.py
homeassistant/components/*/wirelesstag.py
homeassistant/components/enocean.py
homeassistant/components/*/enocean.py
homeassistant/components/xiaomi_aqara.py
homeassistant/components/*/xiaomi_aqara.py
homeassistant/components/netatmo.py
homeassistant/components/*/netatmo.py
homeassistant/components/neato.py
homeassistant/components/*/neato.py
homeassistant/components/homematic.py
homeassistant/components/*/homematic.py
homeassistant/components/knx.py
homeassistant/components/*/knx.py
homeassistant/components/zoneminder.py
homeassistant/components/*/zoneminder.py
homeassistant/components/mochad.py
homeassistant/components/*/mochad.py
homeassistant/components/*/xiaomi_miio.py
homeassistant/components/zabbix.py
homeassistant/components/*/zabbix.py
homeassistant/components/maxcube.py
homeassistant/components/*/maxcube.py
homeassistant/components/zha/__init__.py
homeassistant/components/zha/const.py
homeassistant/components/*/zha.py
homeassistant/components/zigbee.py
homeassistant/components/*/zigbee.py
homeassistant/components/zoneminder.py
homeassistant/components/*/zoneminder.py
homeassistant/components/tado.py
homeassistant/components/*/tado.py
homeassistant/components/alarm_control_panel/alarmdotcom.py
homeassistant/components/alarm_control_panel/canary.py
homeassistant/components/alarm_control_panel/concord232.py
homeassistant/components/alarm_control_panel/ialarm.py
homeassistant/components/alarm_control_panel/ifttt.py
homeassistant/components/alarm_control_panel/manual_mqtt.py
homeassistant/components/alarm_control_panel/nx584.py
homeassistant/components/alarm_control_panel/simplisafe.py
homeassistant/components/alarm_control_panel/totalconnect.py
homeassistant/components/apiai.py
homeassistant/components/binary_sensor/arest.py
homeassistant/components/binary_sensor/concord232.py
homeassistant/components/binary_sensor/flic.py
homeassistant/components/binary_sensor/hikvision.py
homeassistant/components/binary_sensor/iss.py
homeassistant/components/binary_sensor/mystrom.py
homeassistant/components/binary_sensor/ping.py
homeassistant/components/binary_sensor/rest.py
homeassistant/components/binary_sensor/tapsaff.py
homeassistant/components/binary_sensor/uptimerobot.py
homeassistant/components/browser.py
homeassistant/components/camera/amcrest.py
homeassistant/components/calendar/caldav.py
homeassistant/components/calendar/todoist.py
homeassistant/components/camera/bloomsky.py
homeassistant/components/camera/canary.py
homeassistant/components/camera/familyhub.py
homeassistant/components/camera/ffmpeg.py
homeassistant/components/camera/foscam.py
homeassistant/components/camera/mjpeg.py
homeassistant/components/camera/onvif.py
homeassistant/components/camera/proxy.py
homeassistant/components/camera/ring.py
homeassistant/components/camera/rpi_camera.py
homeassistant/components/camera/synology.py
homeassistant/components/camera/xeoma.py
homeassistant/components/camera/xiaomi.py
homeassistant/components/camera/yi.py
homeassistant/components/climate/econet.py
homeassistant/components/climate/ephember.py
homeassistant/components/climate/eq3btsmart.py
homeassistant/components/climate/flexit.py
homeassistant/components/climate/heatmiser.py
homeassistant/components/climate/homematic.py
homeassistant/components/climate/honeywell.py
homeassistant/components/climate/knx.py
homeassistant/components/climate/oem.py
homeassistant/components/climate/proliphix.py
homeassistant/components/climate/radiotherm.py
homeassistant/components/config/zwave.py
homeassistant/components/climate/sensibo.py
homeassistant/components/climate/touchline.py
homeassistant/components/climate/venstar.py
homeassistant/components/climate/zhong_hong.py
homeassistant/components/cover/garadget.py
homeassistant/components/cover/gogogate2.py
homeassistant/components/cover/homematic.py
homeassistant/components/cover/knx.py
homeassistant/components/cover/myq.py
homeassistant/components/cover/opengarage.py
homeassistant/components/cover/rpi_gpio.py
homeassistant/components/cover/ryobi_gdo.py
homeassistant/components/cover/scsgate.py
homeassistant/components/cover/wink.py
homeassistant/components/device_tracker/actiontec.py
homeassistant/components/device_tracker/aruba.py
homeassistant/components/device_tracker/asuswrt.py
homeassistant/components/device_tracker/automatic.py
homeassistant/components/device_tracker/bbox.py
homeassistant/components/device_tracker/bluetooth_le_tracker.py
homeassistant/components/device_tracker/bluetooth_tracker.py
homeassistant/components/device_tracker/bt_home_hub_5.py
homeassistant/components/device_tracker/cisco_ios.py
homeassistant/components/device_tracker/ddwrt.py
homeassistant/components/device_tracker/freebox.py
homeassistant/components/device_tracker/fritz.py
homeassistant/components/device_tracker/google_maps.py
homeassistant/components/device_tracker/gpslogger.py
homeassistant/components/device_tracker/hitron_coda.py
homeassistant/components/device_tracker/huawei_router.py
homeassistant/components/device_tracker/icloud.py
homeassistant/components/device_tracker/keenetic_ndms2.py
homeassistant/components/device_tracker/linksys_ap.py
homeassistant/components/device_tracker/linksys_smart.py
homeassistant/components/device_tracker/luci.py
homeassistant/components/device_tracker/mikrotik.py
homeassistant/components/device_tracker/netgear.py
homeassistant/components/device_tracker/nmap_tracker.py
homeassistant/components/device_tracker/ping.py
homeassistant/components/device_tracker/sky_hub.py
homeassistant/components/device_tracker/snmp.py
homeassistant/components/device_tracker/swisscom.py
homeassistant/components/device_tracker/thomson.py
homeassistant/components/device_tracker/tomato.py
homeassistant/components/device_tracker/tado.py
homeassistant/components/device_tracker/thomson.py
homeassistant/components/device_tracker/tile.py
homeassistant/components/device_tracker/tomato.py
homeassistant/components/device_tracker/tplink.py
homeassistant/components/device_tracker/trackr.py
homeassistant/components/device_tracker/ubus.py
homeassistant/components/device_tracker/xiaomi.py
homeassistant/components/downloader.py
homeassistant/components/emoncms_history.py
homeassistant/components/emulated_hue/upnp.py
homeassistant/components/fan/mqtt.py
homeassistant/components/feedreader.py
homeassistant/components/folder_watcher.py
homeassistant/components/foursquare.py
homeassistant/components/hdmi_cec.py
homeassistant/components/goalfeed.py
homeassistant/components/ifttt.py
homeassistant/components/joaoapps_join.py
homeassistant/components/keyboard.py
homeassistant/components/image_processing/dlib_face_detect.py
homeassistant/components/image_processing/dlib_face_identify.py
homeassistant/components/image_processing/seven_segments.py
homeassistant/components/keyboard_remote.py
homeassistant/components/keyboard.py
homeassistant/components/light/avion.py
homeassistant/components/light/blinksticklight.py
homeassistant/components/light/blinkt.py
homeassistant/components/light/decora_wifi.py
homeassistant/components/light/decora.py
homeassistant/components/light/flux_led.py
homeassistant/components/light/greenwave.py
homeassistant/components/light/hue.py
homeassistant/components/light/hyperion.py
homeassistant/components/light/iglo.py
homeassistant/components/light/lifx_legacy.py
homeassistant/components/light/lifx.py
homeassistant/components/light/limitlessled.py
homeassistant/components/light/lw12wifi.py
homeassistant/components/light/mystrom.py
homeassistant/components/light/nanoleaf_aurora.py
homeassistant/components/light/osramlightify.py
homeassistant/components/light/piglow.py
homeassistant/components/light/rpi_gpio_pwm.py
homeassistant/components/light/sensehat.py
homeassistant/components/light/tikteck.py
homeassistant/components/light/tplink.py
homeassistant/components/light/tradfri.py
homeassistant/components/light/x10.py
homeassistant/components/light/yeelight.py
homeassistant/components/light/yeelightsunflower.py
homeassistant/components/light/piglow.py
homeassistant/components/light/zengge.py
homeassistant/components/lirc.py
homeassistant/components/lock/kiwi.py
homeassistant/components/lock/lockitron.py
homeassistant/components/lock/nello.py
homeassistant/components/lock/nuki.py
homeassistant/components/lock/sesame.py
homeassistant/components/map.py
homeassistant/components/media_extractor.py
homeassistant/components/media_player/anthemav.py
homeassistant/components/media_player/apple_tv.py
homeassistant/components/media_player/aquostv.py
homeassistant/components/media_player/bluesound.py
homeassistant/components/media_player/braviatv.py
homeassistant/components/media_player/cast.py
homeassistant/components/media_player/channels.py
homeassistant/components/media_player/clementine.py
homeassistant/components/media_player/cmus.py
homeassistant/components/media_player/denon.py
@@ -247,18 +497,21 @@ omit =
homeassistant/components/media_player/directv.py
homeassistant/components/media_player/dunehd.py
homeassistant/components/media_player/emby.py
homeassistant/components/media_player/epson.py
homeassistant/components/media_player/firetv.py
homeassistant/components/media_player/frontier_silicon.py
homeassistant/components/media_player/gpmdp.py
homeassistant/components/media_player/gstreamer.py
homeassistant/components/media_player/hdmi_cec.py
homeassistant/components/media_player/horizon.py
homeassistant/components/media_player/itunes.py
homeassistant/components/media_player/kodi.py
homeassistant/components/media_player/lg_netcast.py
homeassistant/components/media_player/liveboxplaytv.py
homeassistant/components/media_player/mediaroom.py
homeassistant/components/media_player/mpchc.py
homeassistant/components/media_player/mpd.py
homeassistant/components/media_player/nad.py
homeassistant/components/media_player/nadtcp.py
homeassistant/components/media_player/onkyo.py
homeassistant/components/media_player/openhome.py
homeassistant/components/media_player/panasonic_viera.py
@@ -267,177 +520,261 @@ omit =
homeassistant/components/media_player/pioneer.py
homeassistant/components/media_player/plex.py
homeassistant/components/media_player/roku.py
homeassistant/components/media_player/russound_rio.py
homeassistant/components/media_player/russound_rnet.py
homeassistant/components/media_player/samsungtv.py
homeassistant/components/media_player/snapcast.py
homeassistant/components/media_player/sonos.py
homeassistant/components/media_player/songpal.py
homeassistant/components/media_player/spotify.py
homeassistant/components/media_player/squeezebox.py
homeassistant/components/media_player/ue_smart_radio.py
homeassistant/components/media_player/vizio.py
homeassistant/components/media_player/vlc.py
homeassistant/components/media_player/volumio.py
homeassistant/components/media_player/xiaomi_tv.py
homeassistant/components/media_player/yamaha_musiccast.py
homeassistant/components/media_player/yamaha.py
homeassistant/components/media_player/ziggo_mediabox_xl.py
homeassistant/components/mycroft.py
homeassistant/components/notify/aws_lambda.py
homeassistant/components/notify/aws_sns.py
homeassistant/components/notify/aws_sqs.py
homeassistant/components/notify/ciscospark.py
homeassistant/components/notify/clickatell.py
homeassistant/components/notify/clicksend.py
homeassistant/components/notify/clicksend_tts.py
homeassistant/components/notify/discord.py
homeassistant/components/notify/facebook.py
homeassistant/components/notify/flock.py
homeassistant/components/notify/free_mobile.py
homeassistant/components/notify/gntp.py
homeassistant/components/notify/group.py
homeassistant/components/notify/hipchat.py
homeassistant/components/notify/instapush.py
homeassistant/components/notify/joaoapps_join.py
homeassistant/components/notify/kodi.py
homeassistant/components/notify/lannouncer.py
homeassistant/components/notify/llamalab_automate.py
homeassistant/components/notify/mailgun.py
homeassistant/components/notify/matrix.py
homeassistant/components/notify/mastodon.py
homeassistant/components/notify/message_bird.py
homeassistant/components/notify/mycroft.py
homeassistant/components/notify/nfandroidtv.py
homeassistant/components/notify/nma.py
homeassistant/components/notify/prowl.py
homeassistant/components/notify/pushbullet.py
homeassistant/components/notify/pushetta.py
homeassistant/components/notify/pushover.py
homeassistant/components/notify/pushsafer.py
homeassistant/components/notify/rest.py
homeassistant/components/notify/rocketchat.py
homeassistant/components/notify/sendgrid.py
homeassistant/components/notify/simplepush.py
homeassistant/components/notify/slack.py
homeassistant/components/notify/smtp.py
homeassistant/components/notify/stride.py
homeassistant/components/notify/synology_chat.py
homeassistant/components/notify/syslog.py
homeassistant/components/notify/telegram.py
homeassistant/components/notify/telstra.py
homeassistant/components/notify/twitter.py
homeassistant/components/notify/xmpp.py
homeassistant/components/notify/yessssms.py
homeassistant/components/nuimo_controller.py
homeassistant/components/prometheus.py
homeassistant/components/rainbird.py
homeassistant/components/remember_the_milk/__init__.py
homeassistant/components/remote/harmony.py
homeassistant/components/remote/itach.py
homeassistant/components/scene/hunterdouglas_powerview.py
homeassistant/components/sensor/amcrest.py
homeassistant/components/scene/lifx_cloud.py
homeassistant/components/sensor/airvisual.py
homeassistant/components/sensor/alpha_vantage.py
homeassistant/components/sensor/arest.py
homeassistant/components/sensor/arwn.py
homeassistant/components/sensor/bbox.py
homeassistant/components/sensor/bh1750.py
homeassistant/components/sensor/bitcoin.py
homeassistant/components/sensor/blockchain.py
homeassistant/components/sensor/bme280.py
homeassistant/components/sensor/bme680.py
homeassistant/components/sensor/bom.py
homeassistant/components/sensor/broadlink.py
homeassistant/components/sensor/dublin_bus_transport.py
homeassistant/components/sensor/coinmarketcap.py
homeassistant/components/sensor/buienradar.py
homeassistant/components/sensor/cert_expiry.py
homeassistant/components/sensor/citybikes.py
homeassistant/components/sensor/comed_hourly_pricing.py
homeassistant/components/sensor/cpuspeed.py
homeassistant/components/sensor/crimereports.py
homeassistant/components/sensor/cups.py
homeassistant/components/sensor/currencylayer.py
homeassistant/components/sensor/darksky.py
homeassistant/components/sensor/deluge.py
homeassistant/components/sensor/deutsche_bahn.py
homeassistant/components/sensor/dht.py
homeassistant/components/sensor/discogs.py
homeassistant/components/sensor/dnsip.py
homeassistant/components/sensor/dovado.py
homeassistant/components/sensor/domain_expiry.py
homeassistant/components/sensor/dte_energy_bridge.py
homeassistant/components/sensor/dublin_bus_transport.py
homeassistant/components/sensor/dwd_weather_warnings.py
homeassistant/components/sensor/ebox.py
homeassistant/components/sensor/eddystone_temperature.py
homeassistant/components/sensor/eliqonline.py
homeassistant/components/sensor/emoncms.py
homeassistant/components/sensor/envirophat.py
homeassistant/components/sensor/etherscan.py
homeassistant/components/sensor/fastdotcom.py
homeassistant/components/sensor/fedex.py
homeassistant/components/sensor/fido.py
homeassistant/components/sensor/filesize.py
homeassistant/components/sensor/fints.py
homeassistant/components/sensor/fitbit.py
homeassistant/components/sensor/fixer.py
homeassistant/components/sensor/folder.py
homeassistant/components/sensor/foobot.py
homeassistant/components/sensor/fritzbox_callmonitor.py
homeassistant/components/sensor/fritzbox_netmonitor.py
homeassistant/components/sensor/gearbest.py
homeassistant/components/sensor/geizhals.py
homeassistant/components/sensor/gitter.py
homeassistant/components/sensor/glances.py
homeassistant/components/sensor/google_travel_time.py
homeassistant/components/sensor/gpsd.py
homeassistant/components/sensor/gtfs.py
homeassistant/components/sensor/haveibeenpwned.py
homeassistant/components/sensor/hddtemp.py
homeassistant/components/sensor/hp_ilo.py
homeassistant/components/sensor/hydroquebec.py
homeassistant/components/sensor/imap.py
homeassistant/components/sensor/htu21d.py
homeassistant/components/sensor/imap_email_content.py
homeassistant/components/sensor/imap.py
homeassistant/components/sensor/influxdb.py
homeassistant/components/sensor/iperf3.py
homeassistant/components/sensor/irish_rail_transport.py
homeassistant/components/sensor/kwb.py
homeassistant/components/sensor/lacrosse.py
homeassistant/components/sensor/lastfm.py
homeassistant/components/sensor/linux_battery.py
homeassistant/components/sensor/loopenergy.py
homeassistant/components/sensor/luftdaten.py
homeassistant/components/sensor/lyft.py
homeassistant/components/sensor/metoffice.py
homeassistant/components/sensor/miflora.py
homeassistant/components/sensor/mitemp_bt.py
homeassistant/components/sensor/modem_callerid.py
homeassistant/components/sensor/mopar.py
homeassistant/components/sensor/mqtt_room.py
homeassistant/components/sensor/mvglive.py
homeassistant/components/sensor/nederlandse_spoorwegen.py
homeassistant/components/sensor/netdata.py
homeassistant/components/sensor/neurio_energy.py
homeassistant/components/sensor/nsw_fuel_station.py
homeassistant/components/sensor/nut.py
homeassistant/components/sensor/nzbget.py
homeassistant/components/sensor/ohmconnect.py
homeassistant/components/sensor/onewire.py
homeassistant/components/sensor/openevse.py
homeassistant/components/sensor/openexchangerates.py
homeassistant/components/sensor/opensky.py
homeassistant/components/sensor/openweathermap.py
homeassistant/components/sensor/otp.py
homeassistant/components/sensor/pi_hole.py
homeassistant/components/sensor/plex.py
homeassistant/components/sensor/pocketcasts.py
homeassistant/components/sensor/pollen.py
homeassistant/components/sensor/postnl.py
homeassistant/components/sensor/pushbullet.py
homeassistant/components/sensor/pvoutput.py
homeassistant/components/sensor/pyload.py
homeassistant/components/sensor/qnap.py
homeassistant/components/sensor/sabnzbd.py
homeassistant/components/sensor/radarr.py
homeassistant/components/sensor/rainbird.py
homeassistant/components/sensor/ripple.py
homeassistant/components/sensor/scrape.py
homeassistant/components/sensor/sense.py
homeassistant/components/sensor/sensehat.py
homeassistant/components/sensor/serial_pm.py
homeassistant/components/sensor/serial.py
homeassistant/components/sensor/sht31.py
homeassistant/components/sensor/shodan.py
homeassistant/components/sensor/sigfox.py
homeassistant/components/sensor/simulated.py
homeassistant/components/sensor/skybeacon.py
homeassistant/components/sensor/sma.py
homeassistant/components/sensor/snmp.py
homeassistant/components/sensor/sochain.py
homeassistant/components/sensor/socialblade.py
homeassistant/components/sensor/sonarr.py
homeassistant/components/sensor/speedtest.py
homeassistant/components/sensor/spotcrime.py
homeassistant/components/sensor/steam_online.py
homeassistant/components/sensor/supervisord.py
homeassistant/components/sensor/swiss_hydrological_data.py
homeassistant/components/sensor/swiss_public_transport.py
homeassistant/components/sensor/syncthru.py
homeassistant/components/sensor/synologydsm.py
homeassistant/components/sensor/systemmonitor.py
homeassistant/components/sensor/sytadin.py
homeassistant/components/sensor/tank_utility.py
homeassistant/components/sensor/ted5000.py
homeassistant/components/sensor/temper.py
homeassistant/components/sensor/tibber.py
homeassistant/components/sensor/time_date.py
homeassistant/components/sensor/torque.py
homeassistant/components/sensor/trafikverket_weatherstation.py
homeassistant/components/sensor/transmission.py
homeassistant/components/sensor/travisci.py
homeassistant/components/sensor/twitch.py
homeassistant/components/sensor/uber.py
homeassistant/components/sensor/upnp.py
homeassistant/components/sensor/ups.py
homeassistant/components/sensor/usps.py
homeassistant/components/sensor/uscis.py
homeassistant/components/sensor/vasttrafik.py
homeassistant/components/sensor/viaggiatreno.py
homeassistant/components/sensor/waqi.py
homeassistant/components/sensor/waze_travel_time.py
homeassistant/components/sensor/whois.py
homeassistant/components/sensor/worldtidesinfo.py
homeassistant/components/sensor/worxlandroid.py
homeassistant/components/sensor/xbox_live.py
homeassistant/components/sensor/yweather.py
homeassistant/components/sensor/zamg.py
homeassistant/components/sensor/zestimate.py
homeassistant/components/shiftr.py
homeassistant/components/spc.py
homeassistant/components/switch/acer_projector.py
homeassistant/components/switch/anel_pwrctrl.py
homeassistant/components/switch/arest.py
homeassistant/components/switch/broadlink.py
homeassistant/components/switch/deluge.py
homeassistant/components/switch/digitalloggers.py
homeassistant/components/switch/dlink.py
homeassistant/components/switch/edimax.py
homeassistant/components/switch/fritzdect.py
homeassistant/components/switch/hdmi_cec.py
homeassistant/components/switch/hikvisioncam.py
homeassistant/components/switch/hook.py
homeassistant/components/switch/kankun.py
homeassistant/components/switch/mystrom.py
homeassistant/components/switch/netio.py
homeassistant/components/switch/orvibo.py
homeassistant/components/switch/pilight.py
homeassistant/components/switch/pulseaudio_loopback.py
homeassistant/components/switch/rainbird.py
homeassistant/components/switch/rest.py
homeassistant/components/switch/rpi_rf.py
homeassistant/components/switch/snmp.py
homeassistant/components/switch/telnet.py
homeassistant/components/switch/tplink.py
homeassistant/components/switch/transmission.py
homeassistant/components/switch/wake_on_lan.py
homeassistant/components/telegram_webhooks.py
homeassistant/components/switch/vesync.py
homeassistant/components/telegram_bot/*
homeassistant/components/thingspeak.py
homeassistant/components/tts/amazon_polly.py
homeassistant/components/tts/baidu.py
homeassistant/components/tts/microsoft.py
homeassistant/components/tts/picotts.py
homeassistant/components/upnp.py
homeassistant/components/vacuum/mqtt.py
homeassistant/components/vacuum/roomba.py
homeassistant/components/watson_iot.py
homeassistant/components/weather/bom.py
homeassistant/components/weather/buienradar.py
homeassistant/components/weather/darksky.py
homeassistant/components/weather/metoffice.py
homeassistant/components/weather/openweathermap.py
homeassistant/components/weather/zamg.py
homeassistant/components/zeroconf.py
homeassistant/components/zwave/__init__.py
homeassistant/components/zwave/util.py
homeassistant/components/zwave/workaround.py
[report]
# Regexes for lines to exclude from consideration

View File

@@ -1,2 +1,14 @@
.tox
# General files
.git
.github
config
# Test related files
.tox
# Other virtualization methods
venv
.vagrant
# Temporary files
**/__pycache__

10
.gitattributes vendored Normal file
View File

@@ -0,0 +1,10 @@
# Ensure Docker script files uses LF to support Docker for Windows.
# Ensure "git config --global core.autocrlf input" before you clone
* text eol=lf
*.py whitespace=error
*.ico binary
*.jpg binary
*.png binary
*.zip binary
*.mp3 binary

View File

@@ -1,35 +1,45 @@
Make sure you are running the latest version of Home Assistant before reporting an issue.
<!-- READ THIS FIRST:
- 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
- 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!
-->
You should only file an issue if you found a bug. Feature and enhancement requests should go in [the Feature Requests section](https://community.home-assistant.io/c/feature-requests) of our community forum:
**Home Assistant release (`hass --version`):**
**Home Assistant release with the issue:**
<!--
- Frontend -> Developer tools -> Info
- Or use this command: hass --version
-->
**Python release (`python3 --version`):**
**Last working Home Assistant release (if known):**
**Operating environment (Hass.io/Docker/Windows/etc.):**
<!--
Please provide details about your environment.
-->
**Component/platform:**
<!--
Please add the link to the documentation at https://www.home-assistant.io/components/ of the component/platform in question.
-->
**Description of problem:**
**Expected:**
**Problem-relevant `configuration.yaml` entries and steps to reproduce:**
**Problem-relevant `configuration.yaml` entries and (fill out even if it seems unimportant):**
```yaml
```
1.
2.
3.
**Traceback (if applicable):**
```bash
```
```
**Additional info:**
**Additional information:**

50
.github/ISSUE_TEMPLATE/Bug_report.md vendored Normal file
View File

@@ -0,0 +1,50 @@
---
name: Bug report
about: Create a report to help us improve
---
<!-- READ THIS FIRST:
- 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
- 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!
-->
**Home Assistant release with the issue:**
<!--
- Frontend -> Developer tools -> Info
- Or use this command: hass --version
-->
**Last working Home Assistant release (if known):**
**Operating environment (Hass.io/Docker/Windows/etc.):**
<!--
Please provide details about your environment.
-->
**Component/platform:**
<!--
Please add the link to the documentation at https://www.home-assistant.io/components/ of the component/platform in question.
-->
**Description of problem:**
**Problem-relevant `configuration.yaml` entries and (fill out even if it seems unimportant):**
```yaml
```
**Traceback (if applicable):**
```
```
**Additional information:**

View File

@@ -11,19 +11,19 @@
```
## Checklist:
- [ ] The code change is tested and works locally.
- [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [home-assistant.github.io](https://github.com/home-assistant/home-assistant.github.io)
If the code communicates with devices, web services, or third-party tools:
- [ ] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**
- [ ] 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 dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
- [ ] 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:
- [ ] Local tests with `tox` run successfully. **Your PR cannot be merged unless tests pass**
- [ ] 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

13
.github/move.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# Configuration for move-issues - https://github.com/dessant/move-issues
# Delete the command comment. Ignored when the comment also contains other content
deleteCommand: true
# Close the source issue after moving
closeSourceIssue: true
# Lock the source issue after moving
lockSourceIssue: false
# Set custom aliases for targets
# aliases:
# r: repo
# or: owner/repo

28
.gitignore vendored
View File

@@ -1,15 +1,4 @@
config/*
!config/home-assistant.conf.default
# There is not a better solution afaik..
!config/custom_components
config/custom_components/*
!config/custom_components/example.py
!config/custom_components/hello_world.py
!config/custom_components/mqtt_example.py
!config/panels
config/panels/*
!config/panels/react.html
tests/testing_config/deps
tests/testing_config/home-assistant.log
@@ -27,9 +16,12 @@ Icon
# Thumbnails
._*
# IntelliJ IDEA
.idea
*.iml
# pytest
.pytest_cache
.cache
# GITHUB Proposed Python stuff:
@@ -84,6 +76,8 @@ pyvenv.cfg
pip-selfcheck.json
venv
.venv
Pipfile*
share/*
# vimmy stuff
*.swp
@@ -104,3 +98,15 @@ docs/build
# Windows Explorer
desktop.ini
/home-assistant.pyproj
/home-assistant.sln
/.vs/*
# mypy
/.mypy_cache/*
# Secrets
.lokalise_token
# monkeytype
monkeytype.sqlite3

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "homeassistant/components/frontend/www_static/home-assistant-polymer"]
path = homeassistant/components/frontend/www_static/home-assistant-polymer
url = https://github.com/home-assistant/home-assistant-polymer.git

View File

@@ -1,21 +1,23 @@
sudo: false
addons:
apt:
packages:
- libudev-dev
matrix:
fast_finish: true
include:
- python: "3.4.2"
env: TOXENV=py34
- python: "3.4.2"
env: TOXENV=requirements
- python: "3.4.2"
- python: "3.5.3"
env: TOXENV=lint
# - python: "3.5"
# env: TOXENV=typing
- python: "3.5"
- python: "3.5.3"
env: TOXENV=pylint
- python: "3.5.3"
env: TOXENV=typing
- python: "3.5.3"
env: TOXENV=py35
- python: "3.6"
env: TOXENV=py36
- python: "3.6-dev"
env: TOXENV=py36
# - python: "3.6-dev"
# env: TOXENV=py36
# allow_failures:
# - python: "3.5"
# env: TOXENV=typing
@@ -25,5 +27,16 @@ cache:
- $HOME/.cache/pip
install: pip install -U tox coveralls
language: python
script: tox
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
after_success: coveralls

118
CODEOWNERS Normal file
View File

@@ -0,0 +1,118 @@
# 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
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/automation/* @home-assistant/core
homeassistant/components/configurator.py @home-assistant/core
homeassistant/components/group.py @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/mqtt/* @home-assistant/core
homeassistant/components/panel_custom.py @home-assistant/core
homeassistant/components/panel_iframe.py @home-assistant/core
homeassistant/components/persistent_notification.py @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.py @home-assistant/core
homeassistant/components/websocket_api.py @home-assistant/core
homeassistant/components/zone.py @home-assistant/core
# HomeAssistant developer Teams
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.py @home-assistant/hassio
# Individual components
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/bmw_connected_drive.py @ChristianKuehnel
homeassistant/components/camera/yi.py @bachya
homeassistant/components/climate/ephember.py @ttroy50
homeassistant/components/climate/eq3btsmart.py @rytilahti
homeassistant/components/climate/sensibo.py @andrey-git
homeassistant/components/cover/group.py @cdce8p
homeassistant/components/cover/template.py @PhracturedBlue
homeassistant/components/device_tracker/automatic.py @armills
homeassistant/components/device_tracker/tile.py @bachya
homeassistant/components/history_graph.py @andrey-git
homeassistant/components/light/tplink.py @rytilahti
homeassistant/components/light/yeelight.py @rytilahti
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/sonos.py @amelchio
homeassistant/components/media_player/xiaomi_tv.py @fattdev
homeassistant/components/media_player/yamaha_musiccast.py @jalmeroth
homeassistant/components/plant.py @ChristianKuehnel
homeassistant/components/sensor/airvisual.py @bachya
homeassistant/components/sensor/filter.py @dgomes
homeassistant/components/sensor/gearbest.py @HerrHofrat
homeassistant/components/sensor/irish_rail_transport.py @ttroy50
homeassistant/components/sensor/miflora.py @danielhiversen @ChristianKuehnel
homeassistant/components/sensor/nsw_fuel_station.py @nickw444
homeassistant/components/sensor/pollen.py @bachya
homeassistant/components/sensor/qnap.py @colinodell
homeassistant/components/sensor/sma.py @kellerza
homeassistant/components/sensor/sql.py @dgomes
homeassistant/components/sensor/sytadin.py @gautric
homeassistant/components/sensor/tibber.py @danielhiversen
homeassistant/components/sensor/upnp.py @dgomes
homeassistant/components/sensor/waqi.py @andrey-git
homeassistant/components/switch/tplink.py @rytilahti
homeassistant/components/vacuum/roomba.py @pschmitt
homeassistant/components/xiaomi_aqara.py @danielhiversen @syssi
homeassistant/components/*/axis.py @kane610
homeassistant/components/*/bmw_connected_drive.py @ChristianKuehnel
homeassistant/components/*/broadlink.py @danielhiversen
homeassistant/components/*/deconz.py @kane610
homeassistant/components/eight_sleep.py @mezz64
homeassistant/components/*/eight_sleep.py @mezz64
homeassistant/components/hive.py @Rendili @KJonline
homeassistant/components/*/hive.py @Rendili @KJonline
homeassistant/components/homekit/* @cdce8p
homeassistant/components/knx.py @Julius2342
homeassistant/components/*/knx.py @Julius2342
homeassistant/components/konnected.py @heythisisnate
homeassistant/components/*/konnected.py @heythisisnate
homeassistant/components/matrix.py @tinloaf
homeassistant/components/*/matrix.py @tinloaf
homeassistant/components/qwikswitch.py @kellerza
homeassistant/components/*/qwikswitch.py @kellerza
homeassistant/components/rainmachine/* @bachya
homeassistant/components/*/rainmachine.py @bachya
homeassistant/components/*/rfxtrx.py @danielhiversen
homeassistant/components/tahoma.py @philklei
homeassistant/components/*/tahoma.py @philklei
homeassistant/components/tesla.py @zabuldon
homeassistant/components/*/tesla.py @zabuldon
homeassistant/components/tellduslive.py @molobrakos @fredrike
homeassistant/components/*/tellduslive.py @molobrakos @fredrike
homeassistant/components/*/tradfri.py @ggravlingen
homeassistant/components/velux.py @Julius2342
homeassistant/components/*/velux.py @Julius2342
homeassistant/components/*/xiaomi_aqara.py @danielhiversen @syssi
homeassistant/components/*/xiaomi_miio.py @rytilahti @syssi
homeassistant/scripts/check_config.py @kellerza

View File

@@ -4,11 +4,11 @@ Everybody is invited and welcome to contribute to Home Assistant. There is a lot
The process is straight-forward.
- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/devel/faster_reviews.md) by Kubernetes (but skip step 0)
- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) by Kubernetes (but skip step 0)
- Fork the Home Assistant [git repository](https://github.com/home-assistant/home-assistant).
- Write the code for your device, notification service, sensor, or IoT thing.
- Ensure tests work.
- Create a Pull Request against the [**dev**](https://github.com/home-assistant/home-assistant/tree/dev) branch of Home Assistant.
Still interested? Then you should take a peak at the [developer documentation](https://home-assistant.io/developers/) to get more details.
Still interested? Then you should take a peek at the [developer documentation](https://home-assistant.io/developers/) to get more details.

View File

@@ -1,13 +1,18 @@
FROM python:3.5
MAINTAINER Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>
# Notice:
# 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
LABEL maintainer="Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>"
# Uncomment any of the following lines to disable the installation.
#ENV INSTALL_TELLSTICK no
#ENV INSTALL_OPENALPR no
#ENV INSTALL_FFMPEG no
#ENV INSTALL_OPENZWAVE no
#ENV INSTALL_LIBCEC no
#ENV INSTALL_PHANTOMJS no
#ENV INSTALL_SSOCR no
#ENV INSTALL_IPERF3 no
VOLUME /config
@@ -20,10 +25,12 @@ RUN virtualization/Docker/setup_docker_prereqs
# Install hass component dependencies
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
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet cython
# Copy source
COPY . .
CMD [ "python", "-m", "homeassistant", "--config", "/config" ]
CMD [ "python", "-m", "homeassistant", "--config", "/config" ]

View File

@@ -1,5 +1,4 @@
include README.rst
include LICENSE.md
graft homeassistant
prune homeassistant/components/frontend/www_static/home-assistant-polymer
recursive-exclude * *.py[co]

View File

@@ -1,9 +1,7 @@
Home Assistant |Build Status| |Coverage Status| |Join the chat at https://gitter.im/home-assistant/home-assistant| |Join the dev chat at https://gitter.im/home-assistant/home-assistant/devs|
==============================================================================================================================================================================================
Home Assistant |Build Status| |Coverage Status| |Chat Status|
=============================================================
Home Assistant is a home automation platform running on Python 3. The
goal of Home Assistant is to be able to track and control all devices at
home and offer a platform for automating control.
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.
To get started:
@@ -12,91 +10,30 @@ To get started:
python3 -m pip install homeassistant
hass --open-ui
Check out `the website <https://home-assistant.io>`__ for `a
demo <https://home-assistant.io/demo/>`__, installation instructions,
tutorials and documentation.
Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://home-assistant.io/demo/>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation-2/>`__ and `documentation <https://home-assistant.io/docs/>`__.
|screenshot-states|
Examples of devices Home Assistant can interface with:
Featured integrations
---------------------
- Monitoring connected devices to a wireless router:
`OpenWrt <https://openwrt.org/>`__,
`Tomato <http://www.polarcloud.com/tomato>`__,
`Netgear <http://netgear.com>`__,
`DD-WRT <http://www.dd-wrt.com/site/index>`__,
`TPLink <http://www.tp-link.us/>`__,
`ASUSWRT <http://event.asus.com/2013/nw/ASUSWRT/>`__,
`Xiaomi <http://miwifi.com/>`__ and any SNMP
capable Linksys WAP/WRT
- `Philips Hue <http://meethue.com>`__ lights,
`WeMo <http://www.belkin.com/us/Products/home-automation/c/wemo-home-automation/>`__
switches, `Edimax <http://www.edimax.com/>`__ switches,
`Efergy <https://efergy.com>`__ energy monitoring, and
`Tellstick <http://www.telldus.se/products/tellstick>`__ devices and
sensors
- `Google
Chromecasts <http://www.google.com/intl/en/chrome/devices/chromecast>`__,
`Music Player Daemon <http://www.musicpd.org/>`__, `Logitech
Squeezebox <https://en.wikipedia.org/wiki/Squeezebox_%28network_music_player%29>`__,
`Plex <https://plex.tv/>`__, `Kodi (XBMC) <http://kodi.tv/>`__,
iTunes (by way of
`itunes-api <https://github.com/maddox/itunes-api>`__), and Amazon
Fire TV (by way of
`python-firetv <https://github.com/happyleavesaoc/python-firetv>`__)
- Support for
`ISY994 <https://www.universal-devices.com/residential/isy994i-series/>`__
(Insteon and X10 devices), `Z-Wave <http://www.z-wave.com/>`__, `Nest
Thermostats <https://nest.com/>`__,
`RFXtrx <http://www.rfxcom.com/>`__,
`Arduino <https://www.arduino.cc/>`__, `Raspberry
Pi <https://www.raspberrypi.org/>`__, and
`Modbus <http://www.modbus.org/>`__
- Interaction with `IFTTT <https://ifttt.com/>`__
- Integrate data from the `Bitcoin <https://bitcoin.org>`__ network,
meteorological data from
`OpenWeatherMap <http://openweathermap.org/>`__ and
`Forecast.io <https://forecast.io/>`__,
`Transmission <http://www.transmissionbt.com/>`__, or
`SABnzbd <http://sabnzbd.org>`__.
- `See full list of supported
devices <https://home-assistant.io/components/>`__
|screenshot-components|
Build home automation on top of your devices:
- Keep a precise history of every change to the state of your house
- Turn on the lights when people get home after sunset
- Turn on lights slowly during sunset to compensate for less light
- Turn off all lights and devices when everybody leaves the house
- Offers a `REST API <https://home-assistant.io/developers/rest_api/>`__
and can interface with MQTT for easy integration with other projects
like `OwnTracks <http://owntracks.org/>`__
- Allow sending notifications using
`Instapush <https://instapush.im>`__, `Notify My Android
(NMA) <http://www.notifymyandroid.com/>`__,
`PushBullet <https://www.pushbullet.com/>`__,
`PushOver <https://pushover.net/>`__,
`Slack <https://slack.com/>`__,
`Telegram <https://telegram.org/>`__, `Join <http://joaoapps.com/join/>`__, and `Jabber
(XMPP) <http://xmpp.org>`__
The system is built using a modular approach so support for other devices or actions can
be implemented easily. See also the `section on
architecture <https://home-assistant.io/developers/architecture/>`__
and the `section on creating your own
The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://home-assistant.io/developers/architecture/>`__ and the `section on creating your own
components <https://home-assistant.io/developers/creating_components/>`__.
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.
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
:target: https://travis-ci.org/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
.. |Join the chat at https://gitter.im/home-assistant/home-assistant| image:: https://img.shields.io/badge/gitter-general-blue.svg
:target: https://gitter.im/home-assistant/home-assistant?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. |Join the dev chat at https://gitter.im/home-assistant/home-assistant/devs| image:: https://img.shields.io/badge/gitter-development-yellowgreen.svg
:target: https://gitter.im/home-assistant/home-assistant/devs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
:target: https://discord.gg/c5DvZ4e
.. |screenshot-states| image:: https://raw.github.com/home-assistant/home-assistant/master/docs/screenshots.png
:target: https://home-assistant.io/demo/
.. |screenshot-components| image:: https://raw.github.com/home-assistant/home-assistant/dev/docs/screenshot-components.png
:target: https://home-assistant.io/components/

View File

@@ -1,158 +0,0 @@
homeassistant:
# Omitted values in this section will be auto detected using freegeoip.io
# Location required to calculate the time the sun rises and sets.
# Coordinates are also used for location for weather related components.
# Google Maps can be used to determine more precise GPS coordinates.
latitude: 32.87336
longitude: 117.22743
# Impacts weather/sunrise data
elevation: 665
# 'metric' for Metric System, 'imperial' for imperial system
unit_system: metric
# Pick yours from here:
# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Los_Angeles
# Name of the location where Home Assistant is running
name: Home
http:
api_password: mypass
# Set to 1 to enable development mode
# development: 1
# Enable the frontend
frontend:
light:
# platform: hue
wink:
# Get your token at https://winkbearertoken.appspot.com
access_token: 'YOUR_TOKEN'
device_tracker:
# The following tracker are available:
# https://home-assistant.io/components/#presence-detection
platform: netgear
host: 192.168.1.1
username: admin
password: PASSWORD
switch:
platform: wemo
climate:
platform: nest
# Required: username and password that are used to login to the Nest thermostat.
username: myemail@mydomain.com
password: mypassword
downloader:
download_dir: downloads
notify:
platform: pushbullet
api_key: ABCDEFGHJKLMNOPQRSTUVXYZ
device_sun_light_trigger:
# Optional: specify a specific light/group of lights that has to be turned on
light_group: group.living_room
# Optional: specify which light profile to use when turning lights on
light_profile: relax
# Optional: disable lights being turned off when everybody leaves the house
# disable_turn_off: 1
# A comma separated list of states that have to be tracked as a single group
# Grouped states should share the same type of states (ON/OFF or HOME/NOT_HOME)
# You can also have groups within groups.
# https://home-assistant.io/components/group/
group:
default_view:
view: yes
entities:
- group.awesome_people
- group.climate
kitchen:
name: Kitchen
entities:
- switch.kitchen_pin_3
upstairs:
name: Kids
icon: mdi:account-multiple
view: yes
entities:
- input_boolean.notify_home
- camera.demo_camera
browser:
keyboard:
# https://home-assistant.io/getting-started/automation/
automation:
- alias: Turn on light when sun sets
trigger:
platform: sun
event: sunset
offset: "-01:00:00"
condition:
condition: state
entity_id: group.all_devices
state: 'home'
action:
service: light.turn_on
# Another way to do is to collect all entries under one "sensor:"
# sensor:
# - platform: mqtt
# name: "MQTT Sensor 1"
# - platform: mqtt
# name: "MQTT Sensor 2"
#
# Details: https://home-assistant.io/getting-started/devices/
sensor:
platform: systemmonitor
resources:
- type: 'disk_use_percent'
arg: '/'
- type: 'disk_use_percent'
arg: '/home'
sensor 2:
platform: cpuspeed
script:
wakeup:
alias: Wake Up
sequence:
- event: LOGBOOK_ENTRY
event_data:
name: Paulus
message: is waking up
entity_id: device_tracker.paulus
domain: light
- alias: Bedroom lights on
service: light.turn_on
data:
entity_id: group.bedroom
brightness: 100
- delay:
minutes: 1
- alias: Living room lights on
service: light.turn_on
data:
entity_id: group.living_room
scene:
- name: Romantic
entities:
light.tv_back_light: on
light.ceiling:
state: on
xy_color: [0.33, 0.66]
brightness: 200

View File

@@ -1,149 +0,0 @@
"""
Example of a custom component.
Example component to target an entity_id to:
- turn it on at 7AM in the morning
- turn it on if anyone comes home and it is off
- turn it off if all lights are turned off
- turn it off if all people leave the house
- offer a service to turn it on for 10 seconds
Configuration:
To use the Example custom component you will need to add the following to
your configuration.yaml file.
example:
target: TARGET_ENTITY
Variable:
target
*Required
TARGET_ENTITY should be one of your devices that can be turned on and off,
ie a light or a switch. Example value could be light.Ceiling or switch.AC
(if you have these devices with those names).
"""
import time
import logging
from homeassistant.const import STATE_HOME, STATE_NOT_HOME, STATE_ON, STATE_OFF
from homeassistant.helpers import validate_config
from homeassistant.helpers.event_decorators import \
track_state_change, track_time_change
from homeassistant.helpers.service import service
import homeassistant.components as core
from homeassistant.components import device_tracker
from homeassistant.components import light
# The domain of your component. Should be equal to the name of your component.
DOMAIN = "example"
# List of component names (string) your component depends upon.
# We depend on group because group will be loaded after all the components that
# initialize devices have been setup.
DEPENDENCIES = ['group', 'device_tracker', 'light']
# Configuration key for the entity id we are targeting.
CONF_TARGET = 'target'
# Variable for storing configuration parameters.
TARGET_ID = None
# Name of the service that we expose.
SERVICE_FLASH = 'flash'
# Shortcut for the logger
_LOGGER = logging.getLogger(__name__)
def setup(hass, config):
"""Setup example component."""
global TARGET_ID
# Validate that all required config options are given.
if not validate_config(config, {DOMAIN: [CONF_TARGET]}, _LOGGER):
return False
TARGET_ID = config[DOMAIN][CONF_TARGET]
# Validate that the target entity id exists.
if hass.states.get(TARGET_ID) is None:
_LOGGER.error("Target entity id %s does not exist",
TARGET_ID)
# Tell the bootstrapper that we failed to initialize and clear the
# stored target id so our functions don't run.
TARGET_ID = None
return False
# Tell the bootstrapper that we initialized successfully.
return True
@track_state_change(device_tracker.ENTITY_ID_ALL_DEVICES)
def track_devices(hass, entity_id, old_state, new_state):
"""Called when the group.all devices change state."""
# If the target id is not set, return
if not TARGET_ID:
return
# If anyone comes home and the entity is not on, turn it on.
if new_state.state == STATE_HOME and not core.is_on(hass, TARGET_ID):
core.turn_on(hass, TARGET_ID)
# If all people leave the house and the entity is on, turn it off.
elif new_state.state == STATE_NOT_HOME and core.is_on(hass, TARGET_ID):
core.turn_off(hass, TARGET_ID)
@track_time_change(hour=7, minute=0, second=0)
def wake_up(hass, now):
"""Turn light on in the morning.
Turn the light on at 7 AM if there are people home and it is not already
on.
"""
if not TARGET_ID:
return
if device_tracker.is_on(hass) and not core.is_on(hass, TARGET_ID):
_LOGGER.info('People home at 7AM, turning it on')
core.turn_on(hass, TARGET_ID)
@track_state_change(light.ENTITY_ID_ALL_LIGHTS, STATE_ON, STATE_OFF)
def all_lights_off(hass, entity_id, old_state, new_state):
"""If all lights turn off, turn off."""
if not TARGET_ID:
return
if core.is_on(hass, TARGET_ID):
_LOGGER.info('All lights have been turned off, turning it off')
core.turn_off(hass, TARGET_ID)
@service(DOMAIN, SERVICE_FLASH)
def flash_service(hass, call):
"""Service that will toggle the target.
Set the light to off for 10 seconds if on and vice versa.
"""
if not TARGET_ID:
return
if core.is_on(hass, TARGET_ID):
core.turn_off(hass, TARGET_ID)
time.sleep(10)
core.turn_on(hass, TARGET_ID)
else:
core.turn_on(hass, TARGET_ID)
time.sleep(10)
core.turn_off(hass, TARGET_ID)

View File

@@ -1,27 +0,0 @@
"""
The "hello world" custom component.
This component implements the bare minimum that a component should implement.
Configuration:
To use the hello_word component you will need to add the following to your
configuration.yaml file.
hello_world:
"""
# The domain of your component. Should be equal to the name of your component.
DOMAIN = "hello_world"
# List of component names (string) your component depends upon.
DEPENDENCIES = []
def setup(hass, config):
"""Setup our skeleton component."""
# States are in the format DOMAIN.OBJECT_ID.
hass.states.set('hello_world.Hello_World', 'Works!')
# Return boolean to indicate that initialization was successfully.
return True

View File

@@ -1,55 +0,0 @@
"""
Example of a custom MQTT component.
Shows how to communicate with MQTT. Follows a topic on MQTT and updates the
state of an entity to the last message received on that topic.
Also offers a service 'set_state' that will publish a message on the topic that
will be passed via MQTT to our message received listener. Call the service with
example payload {"new_state": "some new state"}.
Configuration:
To use the mqtt_example component you will need to add the following to your
configuration.yaml file.
mqtt_example:
topic: "home-assistant/mqtt_example"
"""
import homeassistant.loader as loader
# The domain of your component. Should be equal to the name of your component.
DOMAIN = "mqtt_example"
# List of component names (string) your component depends upon.
DEPENDENCIES = ['mqtt']
CONF_TOPIC = 'topic'
DEFAULT_TOPIC = 'home-assistant/mqtt_example'
def setup(hass, config):
"""Setup the MQTT example component."""
mqtt = loader.get_component('mqtt')
topic = config[DOMAIN].get('topic', DEFAULT_TOPIC)
entity_id = 'mqtt_example.last_message'
# Listen to a message on MQTT.
def message_received(topic, payload, qos):
"""A new MQTT message has been received."""
hass.states.set(entity_id, payload)
mqtt.subscribe(hass, topic, message_received)
hass.states.set(entity_id, 'No messages')
# Service to publish a message on MQTT.
def set_state_service(call):
"""Service to send a message."""
mqtt.publish(hass, topic, call.data.get('new_state'))
# Register our service with Home Assistant.
hass.services.register(DOMAIN, 'set_state', set_state_service)
# Return boolean to indicate that initialization was successfully.
return True

View File

@@ -1,432 +0,0 @@
<!--
Custom Home Assistant panel example.
Currently only works in Firefox and Chrome because it uses ES6.
Make sure this file is in <config>/panels/react.html
Add to your configuration.yaml:
panel_custom:
- name: react
sidebar_title: TodoMVC
sidebar_icon: mdi:checkbox-marked-outline
config:
title: Wow hello!
-->
<script src="https://fb.me/react-15.2.1.min.js"></script>
<script src="https://fb.me/react-dom-15.2.1.min.js"></script>
<!-- for development, replace with:
<script src="https://fb.me/react-15.2.1.js"></script>
<script src="https://fb.me/react-dom-15.2.1.js"></script>
-->
<!--
CSS taken from ReactJS TodoMVC example by Pete Hunt
http://todomvc.com/examples/react/
-->
<style>
.todoapp input[type="checkbox"] {
outline: none;
}
.todoapp {
background: #fff;
margin: 130px 0 40px 0;
position: relative;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
0 25px 50px 0 rgba(0, 0, 0, 0.1);
}
.todoapp h1 {
position: absolute;
top: -155px;
width: 100%;
font-size: 100px;
font-weight: 100;
text-align: center;
color: rgba(175, 47, 47, 0.15);
-webkit-text-rendering: optimizeLegibility;
-moz-text-rendering: optimizeLegibility;
text-rendering: optimizeLegibility;
}
.todoapp .main {
position: relative;
border-top: 1px solid #e6e6e6;
}
.todoapp .todo-list {
margin: 0;
padding: 0;
list-style: none;
}
.todoapp .todo-list li {
position: relative;
font-size: 24px;
border-bottom: 1px solid #ededed;
}
.todoapp .todo-list li:last-child {
border-bottom: none;
}
.todoapp .todo-list li .toggle {
text-align: center;
width: 40px;
/* auto, since non-WebKit browsers doesn't support input styling */
height: auto;
position: absolute;
top: 0;
bottom: 0;
margin: auto 0;
border: none; /* Mobile Safari */
-webkit-appearance: none;
appearance: none;
cursor: pointer;
}
.todoapp .todo-list li .toggle:focus {
border-left: 3px solid rgba(175, 47, 47, 0.35);
}
.todoapp .todo-list li .toggle:after {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>');
}
.todoapp .todo-list li .toggle:checked:after {
content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#bddad5" stroke-width="3"/><path fill="#5dc2af" d="M72 25L42 71 27 56l-4 4 20 20 34-52z"/></svg>');
}
.todoapp .todo-list li label {
white-space: pre-line;
word-break: break-all;
padding: 15px 60px 15px 15px;
margin-left: 45px;
display: block;
line-height: 1.2;
transition: color 0.4s;
}
.todoapp .todo-list li.completed label {
color: #d9d9d9;
text-decoration: line-through;
}
.todoapp .footer {
color: #777;
padding: 10px 15px;
height: 20px;
text-align: center;
border-top: 1px solid #e6e6e6;
}
.todoapp .footer:before {
content: '';
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 50px;
overflow: hidden;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2),
0 8px 0 -3px #f6f6f6,
0 9px 1px -3px rgba(0, 0, 0, 0.2),
0 16px 0 -6px #f6f6f6,
0 17px 2px -6px rgba(0, 0, 0, 0.2);
}
.todoapp .todo-count {
float: left;
text-align: left;
font-weight: 300;
}
.todoapp .toggle-menu {
position: absolute;
right: 15px;
font-weight: 300;
color: rgba(175, 47, 47, 0.75);
}
.todoapp .filters {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
right: 0;
left: 0;
}
.todoapp .filters li {
display: inline;
}
.todoapp .filters li a {
color: inherit;
margin: 3px;
padding: 3px 7px;
text-decoration: none;
border: 1px solid transparent;
border-radius: 3px;
}
.todoapp .filters li a.selected,
.filters li a:hover {
border-color: rgba(175, 47, 47, 0.1);
}
.todoapp .filters li a.selected {
border-color: rgba(175, 47, 47, 0.2);
}
/*
Hack to remove background from Mobile Safari.
Can't use it globally since it destroys checkboxes in Firefox
*/
@media screen and (-webkit-min-device-pixel-ratio:0) {
.todoapp .toggle-all,
.todoapp .todo-list li .toggle {
background: none;
}
.todoapp .todo-list li .toggle {
height: 40px;
}
.todoapp .toggle-all {
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
-webkit-appearance: none;
appearance: none;
}
}
@media (max-width: 430px) {
.todoapp .footer {
height: 50px;
}
.todoapp .filters {
bottom: 10px;
}
}
</style>
<dom-module id='ha-panel-react'>
<template>
<style>
:host {
background: #f5f5f5;
display: block;
height: 100%;
overflow: auto;
}
.mount {
font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
line-height: 1.4em;
color: #4d4d4d;
min-width: 230px;
max-width: 550px;
margin: 0 auto;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
font-weight: 300;
}
</style>
<div id='mount' class='mount'></div>
</template>
</dom-module>
<script>
// Example uses ES6. Will only work in modern browsers
class TodoMVC extends React.Component {
constructor(props) {
super(props);
this.state = {
filter: 'all',
// load initial value of entities
entities: this.props.hass.reactor.evaluate(
this.props.hass.entityGetters.visibleEntityMap),
};
}
componentDidMount() {
// register to entity updates
this._unwatchHass = this.props.hass.reactor.observe(
this.props.hass.entityGetters.visibleEntityMap,
entities => this.setState({entities}))
}
componentWillUnmount() {
// unregister to entity updates
this._unwatchHass();
}
handlePickFilter(filter, ev) {
ev.preventDefault();
this.setState({filter});
}
handleEntityToggle(entity, ev) {
this.props.hass.serviceActions.callService(
entity.domain, 'toggle', { entity_id: entity.entityId });
}
handleToggleMenu(ev) {
ev.preventDefault();
Polymer.Base.fire('open-menu', null, {node: ev.target});
}
entityRow(entity) {
const completed = entity.state === 'on';
return React.createElement(
'li', {
className: completed && 'completed',
key: entity.entityId,
},
React.createElement(
"div", { className: "view" },
React.createElement(
"input", {
checked: completed,
className: "toggle",
type: "checkbox",
onChange: ev => this.handleEntityToggle(entity, ev),
}),
React.createElement("label", null, entity.entityDisplay)));
}
filterRow(filter) {
return React.createElement(
"li", { key: filter },
React.createElement(
"a", {
href: "#",
className: this.state.filter === filter && "selected",
onClick: ev => this.handlePickFilter(filter, ev),
},
filter.substring(0, 1).toUpperCase() + filter.substring(1)
)
);
}
render() {
const { entities, filter } = this.state;
if (!entities) return null;
const filters = ['all', 'light', 'switch'];
const showEntities = filter === 'all' ?
entities.filter(ent => filters.includes(ent.domain)) :
entities.filter(ent => ent.domain == filter);
return React.createElement(
'div', { className: 'todoapp-wrapper' },
React.createElement(
"section", { className: "todoapp" },
React.createElement(
"div", null,
React.createElement(
"header", { className: "header" },
React.createElement("h1", null, this.props.title || "todos")
),
React.createElement(
"section", { className: "main" },
React.createElement(
"ul", { className: "todo-list" },
showEntities.valueSeq().map(ent => this.entityRow(ent)))
)
),
React.createElement(
"footer", { className: "footer" },
React.createElement(
"span", { className: "todo-count" },
showEntities.filter(ent => ent.state === 'off').size + " items left"
),
React.createElement(
"ul", { className: "filters" },
filters.map(filter => this.filterRow(filter))
),
!this.props.showMenu && React.createElement(
"a", {
className: "toggle-menu",
href: '#',
onClick: ev => this.handleToggleMenu(ev),
},
"Show menu"
)
)
));
}
}
Polymer({
is: 'ha-panel-react',
properties: {
// Home Assistant object
hass: {
type: Object,
},
// If should render in narrow mode
narrow: {
type: Boolean,
value: false,
},
// If sidebar is currently shown
showMenu: {
type: Boolean,
value: false,
},
// Home Assistant panel info
// panel.config contains config passed to register_panel serverside
panel: {
type: Object,
}
},
// This will make sure we forward changed properties to React
observers: [
'propsChanged(hass, narrow, showMenu, panel)',
],
// Mount React when element attached
attached: function () {
this.mount(this.hass, this.narrow, this.showMenu, this.panel);
},
// Called when properties change
propsChanged: function (hass, narrow, showMenu, panel) {
this.mount(hass, narrow, showMenu, panel);
},
// Render React. Debounce in case multiple properties change.
mount: function (hass, narrow, showMenu, panel) {
this.debounce('mount', function () {
ReactDOM.render(React.createElement(TodoMVC, {
hass: hass,
narrow: narrow,
showMenu: showMenu,
title: panel.config ? panel.config.title : null
}), this.$.mount);
}.bind(this));
},
// Unmount React node when panel no longer in use.
detached: function () {
ReactDOM.unmountComponentAtNode(this.$.mount);
},
});
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,8 +1,6 @@
<ul>
<li><a href="https://community.home-assistant.io">📌 Community Forums</a></li>
<li><a href="https://github.com/home-assistant/home-assistant">🚀 GitHub</a></li>
<li><a href="https://home-assistant.io/">🏡 Homepage</a></li>
<li><a href="https://gitter.im/home-assistant/home-assistant">💬 Gitter</a></li>
<li><a href="https://pypi.python.org/pypi/homeassistant">💾 Download Releases</a></li>
<li><a href="https://home-assistant.io/">Homepage</a></li>
<li><a href="https://community.home-assistant.io">Community Forums</a></li>
<li><a href="https://github.com/home-assistant/home-assistant">GitHub</a></li>
<li><a href="https://discord.gg/c5DvZ4e">Discord</a></li>
</ul>
<hr>

View File

@@ -4,10 +4,10 @@ homeassistant.util package
Submodules
----------
homeassistant.util.async module
homeassistant.util.async_ module
-------------------------------
.. automodule:: homeassistant.util.async
.. automodule:: homeassistant.util.async_
:members:
:undoc-members:
:show-inheritance:

View File

@@ -19,14 +19,25 @@
#
import sys
import os
from os.path import relpath
import inspect
from homeassistant.const import (__version__, __short_version__, PROJECT_NAME,
PROJECT_LONG_DESCRIPTION,
PROJECT_COPYRIGHT, PROJECT_AUTHOR,
PROJECT_GITHUB_USERNAME,
PROJECT_GITHUB_REPOSITORY,
GITHUB_PATH, GITHUB_URL)
from homeassistant.const import __version__, __short_version__
PROJECT_NAME = 'Home Assistant'
PROJECT_PACKAGE_NAME = 'homeassistant'
PROJECT_AUTHOR = 'The Home Assistant Authors'
PROJECT_COPYRIGHT = ' 2013-2018, {}'.format(PROJECT_AUTHOR)
PROJECT_LONG_DESCRIPTION = ('Home Assistant is an open-source '
'home automation platform running on Python 3. '
'Track and control all devices at home and '
'automate control. '
'Installation in less than a minute.')
PROJECT_GITHUB_USERNAME = 'home-assistant'
PROJECT_GITHUB_REPOSITORY = 'home-assistant'
GITHUB_PATH = '{}/{}'.format(
PROJECT_GITHUB_USERNAME, PROJECT_GITHUB_REPOSITORY)
GITHUB_URL = 'https://github.com/{}'.format(GITHUB_PATH)
sys.path.insert(0, os.path.abspath('_ext'))
@@ -87,9 +98,7 @@ edit_on_github_src_path = 'docs/source/'
def linkcode_resolve(domain, info):
"""
Determine the URL corresponding to Python object
"""
"""Determine the URL corresponding to Python object."""
if domain != 'py':
return None
modname = info['module']
@@ -117,7 +126,11 @@ def linkcode_resolve(domain, info):
linespec = "#L%d" % (lineno + 1)
else:
linespec = ""
fn = relpath(fn, start='../')
index = fn.find("/homeassistant/")
if index == -1:
index = 0
fn = fn[index:]
return '{}/blob/{}/{}{}'.format(GITHUB_URL, code_branch, fn, linespec)

View File

@@ -1,606 +0,0 @@
swagger: '2.0'
info:
title: Home Assistant
description: Home Assistant REST API
version: "1.0.1"
# the domain of the service
host: localhost:8123
# array of all schemes that your API supports
schemes:
- http
- https
securityDefinitions:
#api_key:
# type: apiKey
# description: API password
# name: api_password
# in: query
api_key:
type: apiKey
description: API password
name: x-ha-access
in: header
# will be prefixed to all paths
basePath: /api
consumes:
- application/json
produces:
- application/json
paths:
/:
get:
summary: API alive message
description: Returns message if API is up and running.
tags:
- Core
security:
- api_key: []
responses:
200:
description: API is up and running
schema:
$ref: '#/definitions/Message'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/config:
get:
summary: API alive message
description: Returns the current configuration as JSON.
tags:
- Core
security:
- api_key: []
responses:
200:
description: Current configuration
schema:
$ref: '#/definitions/ApiConfig'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/discovery_info:
get:
summary: Basic information about Home Assistant instance
tags:
- Core
responses:
200:
description: Basic information
schema:
$ref: '#/definitions/DiscoveryInfo'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/bootstrap:
get:
summary: Returns all data needed to bootstrap Home Assistant.
tags:
- Core
security:
- api_key: []
responses:
200:
description: Bootstrap information
schema:
$ref: '#/definitions/BootstrapInfo'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/events:
get:
summary: Array of event objects.
description: Returns an array of event objects. Each event object contain event name and listener count.
tags:
- Events
security:
- api_key: []
responses:
200:
description: Events
schema:
type: array
items:
$ref: '#/definitions/Event'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/services:
get:
summary: Array of service objects.
description: Returns an array of service objects. Each object contains the domain and which services it contains.
tags:
- Services
security:
- api_key: []
responses:
200:
description: Services
schema:
type: array
items:
$ref: '#/definitions/Service'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/history:
get:
summary: Array of state changes in the past.
description: Returns an array of state changes in the past. Each object contains further detail for the entities.
tags:
- State
security:
- api_key: []
responses:
200:
description: State changes
schema:
type: array
items:
$ref: '#/definitions/History'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/states:
get:
summary: Array of state objects.
description: |
Returns an array of state objects. Each state has the following attributes: entity_id, state, last_changed and attributes.
tags:
- State
security:
- api_key: []
responses:
200:
description: States
schema:
type: array
items:
$ref: '#/definitions/State'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/states/{entity_id}:
get:
summary: Specific state object.
description: |
Returns a state object for specified entity_id.
tags:
- State
security:
- api_key: []
parameters:
- name: entity_id
in: path
description: entity_id of the entity to query
required: true
type: string
responses:
200:
description: State
schema:
$ref: '#/definitions/State'
404:
description: Not found
schema:
$ref: '#/definitions/Message'
default:
description: Error
schema:
$ref: '#/definitions/Message'
post:
description: |
Updates or creates the current state of an entity.
tags:
- State
consumes:
- application/json
parameters:
- name: entity_id
in: path
description: entity_id to set the state of
required: true
type: string
- $ref: '#/parameters/State'
responses:
200:
description: State of existing entity was set
schema:
$ref: '#/definitions/State'
201:
description: State of new entity was set
schema:
$ref: '#/definitions/State'
headers:
location:
type: string
description: location of the new entity
default:
description: Error
schema:
$ref: '#/definitions/Message'
/error_log:
get:
summary: Error log
description: |
Retrieve all errors logged during the current session of Home Assistant as a plaintext response.
tags:
- Core
security:
- api_key: []
produces:
- text/plain
responses:
200:
description: Plain text error log
default:
description: Error
schema:
$ref: '#/definitions/Message'
/camera_proxy/camera.{entity_id}:
get:
summary: Camera image.
description: |
Returns the data (image) from the specified camera entity_id.
tags:
- Camera
security:
- api_key: []
produces:
- image/jpeg
parameters:
- name: entity_id
in: path
description: entity_id of the camera to query
required: true
type: string
responses:
200:
description: Camera image
schema:
type: file
default:
description: Error
schema:
$ref: '#/definitions/Message'
/events/{event_type}:
post:
description: |
Fires an event with event_type
tags:
- Events
security:
- api_key: []
consumes:
- application/json
parameters:
- name: event_type
in: path
description: event_type to fire event with
required: true
type: string
- $ref: '#/parameters/EventData'
responses:
200:
description: Response message
schema:
$ref: '#/definitions/Message'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/services/{domain}/{service}:
post:
description: |
Calls a service within a specific domain. Will return when the service has been executed or 10 seconds has past, whichever comes first.
tags:
- Services
security:
- api_key: []
consumes:
- application/json
parameters:
- name: domain
in: path
description: domain of the service
required: true
type: string
- name: service
in: path
description: service to call
required: true
type: string
- $ref: '#/parameters/ServiceData'
responses:
200:
description: List of states that have changed while the service was being executed. The result will include any changed states that changed while the service was being executed, even if their change was the result of something else happening in the system.
schema:
type: array
items:
$ref: '#/definitions/State'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/template:
post:
description: |
Render a Home Assistant template.
tags:
- Template
security:
- api_key: []
consumes:
- application/json
produces:
- text/plain
parameters:
- $ref: '#/parameters/Template'
responses:
200:
description: Returns the rendered template in plain text.
schema:
type: string
default:
description: Error
schema:
$ref: '#/definitions/Message'
/event_forwarding:
post:
description: |
Setup event forwarding to another Home Assistant instance.
tags:
- Core
security:
- api_key: []
consumes:
- application/json
parameters:
- $ref: '#/parameters/EventForwarding'
responses:
200:
description: It will return a message if event forwarding was setup successful.
schema:
$ref: '#/definitions/Message'
default:
description: Error
schema:
$ref: '#/definitions/Message'
delete:
description: |
Cancel event forwarding to another Home Assistant instance.
tags:
- Core
consumes:
- application/json
parameters:
- $ref: '#/parameters/EventForwarding'
responses:
200:
description: It will return a message if event forwarding was cancelled successful.
schema:
$ref: '#/definitions/Message'
default:
description: Error
schema:
$ref: '#/definitions/Message'
/stream:
get:
summary: Server-sent events
description: The server-sent events feature is a one-way channel from your Home Assistant server to a client which is acting as a consumer.
tags:
- Core
- Events
security:
- api_key: []
produces:
- text/event-stream
parameters:
- name: restrict
in: query
description: comma-separated list of event_types to filter
required: false
type: string
responses:
default:
description: Stream of events
schema:
type: object
x-events:
state_changed:
type: object
properties:
entity_id:
type: string
old_state:
$ref: '#/definitions/State'
new_state:
$ref: '#/definitions/State'
definitions:
ApiConfig:
type: object
properties:
components:
type: array
description: List of component types
items:
type: string
description: Component type
latitude:
type: number
format: float
description: Latitude of Home Assistant server
longitude:
type: number
format: float
description: Longitude of Home Assistant server
location_name:
type: string
unit_system:
type: object
properties:
length:
type: string
mass:
type: string
temperature:
type: string
volume:
type: string
time_zone:
type: string
version:
type: string
DiscoveryInfo:
type: object
properties:
base_url:
type: string
location_name:
type: string
requires_api_password:
type: boolean
version:
type: string
BootstrapInfo:
type: object
properties:
config:
$ref: '#/definitions/ApiConfig'
events:
type: array
items:
$ref: '#/definitions/Event'
services:
type: array
items:
$ref: '#/definitions/Service'
states:
type: array
items:
$ref: '#/definitions/State'
Event:
type: object
properties:
event:
type: string
listener_count:
type: integer
Service:
type: object
properties:
domain:
type: string
services:
type: object
additionalProperties:
$ref: '#/definitions/DomainService'
DomainService:
type: object
properties:
description:
type: string
fields:
type: object
description: Object with service fields that can be called
State:
type: object
properties:
attributes:
$ref: '#/definitions/StateAttributes'
state:
type: string
entity_id:
type: string
last_changed:
type: string
format: date-time
StateAttributes:
type: object
additionalProperties:
type: string
History:
allOf:
- $ref: '#/definitions/State'
- type: object
properties:
last_updated:
type: string
format: date-time
Message:
type: object
properties:
message:
type: string
parameters:
State:
name: body
in: body
description: State parameter
required: false
schema:
type: object
required:
- state
properties:
attributes:
$ref: '#/definitions/StateAttributes'
state:
type: string
EventData:
name: body
in: body
description: event_data
required: false
schema:
type: object
ServiceData:
name: body
in: body
description: service_data
required: false
schema:
type: object
Template:
name: body
in: body
description: Template to render
required: true
schema:
type: object
required:
- template
properties:
template:
description: Jinja2 template string
type: string
EventForwarding:
name: body
in: body
description: Event Forwarding parameter
required: true
schema:
type: object
required:
- host
- api_password
properties:
host:
type: string
api_password:
type: string
port:
type: integer

View File

@@ -1,4 +1,4 @@
"""Starts home assistant."""
"""Start Home Assistant."""
from __future__ import print_function
import argparse
@@ -8,68 +8,32 @@ import subprocess
import sys
import threading
from typing import Optional, List
from typing import Optional, List, Dict, Any # noqa #pylint: disable=unused-import
from homeassistant import monkey_patch
from homeassistant.const import (
__version__,
EVENT_HOMEASSISTANT_START,
REQUIRED_PYTHON_VER,
REQUIRED_PYTHON_VER_WIN,
RESTART_EXIT_CODE,
)
from homeassistant.util.async import run_callback_threadsafe
def monkey_patch_asyncio():
"""Replace weakref.WeakSet to address Python 3 bug.
def attempt_use_uvloop():
"""Attempt to use uvloop."""
import asyncio
Under heavy threading operations that schedule calls into
the asyncio event loop, Task objects are created. Due to
a bug in Python, GC may have an issue when switching between
the threads and objects with __del__ (which various components
in HASS have).
This monkey-patch removes the weakref.Weakset, and replaces it
with an object that ignores the only call utilizing it (the
Task.__init__ which calls _all_tasks.add(self)). It also removes
the __del__ which could trigger the future objects __del__ at
unpredictable times.
The side-effect of this manipulation of the Task is that
Task.all_tasks() is no longer accurate, and there will be no
warning emitted if a Task is GC'd while in use.
On Python 3.6, after the bug is fixed, this monkey-patch can be
disabled.
See https://bugs.python.org/issue26617 for details of the Python
bug.
"""
# pylint: disable=no-self-use, protected-access, bare-except
import asyncio.tasks
class IgnoreCalls:
"""Ignore add calls."""
def add(self, other):
"""No-op add."""
return
asyncio.tasks.Task._all_tasks = IgnoreCalls()
try:
del asyncio.tasks.Task.__del__
except:
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
except ImportError:
pass
def validate_python() -> None:
"""Validate we're running the right Python version."""
if sys.platform == "win32" and \
sys.version_info[:3] < REQUIRED_PYTHON_VER_WIN:
print("Home Assistant requires at least Python {}.{}.{}".format(
*REQUIRED_PYTHON_VER_WIN))
sys.exit(1)
elif sys.version_info[:3] < REQUIRED_PYTHON_VER:
"""Validate that the right Python version is running."""
if sys.version_info[:3] < REQUIRED_PYTHON_VER:
print("Home Assistant requires at least Python {}.{}.{}".format(
*REQUIRED_PYTHON_VER))
sys.exit(1)
@@ -157,6 +121,16 @@ def get_arguments() -> argparse.Namespace:
type=int,
default=None,
help='Enables daily log rotation and keeps up to the specified days')
parser.add_argument(
'--log-file',
type=str,
default=None,
help='Log file to write to. If not set, CONFIG/home-assistant.log '
'is used')
parser.add_argument(
'--log-no-color',
action='store_true',
help="Disable color logs")
parser.add_argument(
'--runner',
action='store_true',
@@ -204,10 +178,11 @@ def daemonize() -> None:
def check_pid(pid_file: str) -> None:
"""Check that HA is not already running."""
"""Check that Home Assistant is not already running."""
# Check pid file
try:
pid = int(open(pid_file, 'r').readline())
with open(pid_file, 'r') as file:
pid = int(file.readline())
except IOError:
# PID File does not exist
return
@@ -229,7 +204,8 @@ def write_pid(pid_file: str) -> None:
"""Create a PID File."""
pid = os.getpid()
try:
open(pid_file, 'w').write(str(pid))
with open(pid_file, 'w') as file:
file.write(str(pid))
except IOError:
print('Fatal Error: Unable to write pid file {}'.format(pid_file))
sys.exit(1)
@@ -255,18 +231,18 @@ def closefds_osx(min_fd: int, max_fd: int) -> None:
def cmdline() -> List[str]:
"""Collect path and arguments to re-execute the current hass instance."""
if sys.argv[0].endswith(os.path.sep + '__main__.py'):
if os.path.basename(sys.argv[0]) == '__main__.py':
modulepath = os.path.dirname(sys.argv[0])
os.environ['PYTHONPATH'] = os.path.dirname(modulepath)
return [sys.executable] + [arg for arg in sys.argv if
arg != '--daemon']
else:
return [arg for arg in sys.argv if arg != '--daemon']
return [arg for arg in sys.argv if arg != '--daemon']
def setup_and_run_hass(config_dir: str,
args: argparse.Namespace) -> Optional[int]:
"""Setup HASS and run."""
"""Set up HASS and run."""
from homeassistant import bootstrap
# Run a simple daemon runner process on Windows to handle restarts
@@ -284,21 +260,26 @@ def setup_and_run_hass(config_dir: str,
config = {
'frontend': {},
'demo': {}
}
} # type: Dict[str, Any]
hass = bootstrap.from_config_dict(
config, config_dir=config_dir, verbose=args.verbose,
skip_pip=args.skip_pip, log_rotate_days=args.log_rotate_days)
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)
print('Config directory:', config_dir)
hass = bootstrap.from_config_file(
config_file, verbose=args.verbose, skip_pip=args.skip_pip,
log_rotate_days=args.log_rotate_days)
log_rotate_days=args.log_rotate_days, log_file=args.log_file,
log_no_color=args.log_no_color)
if hass is None:
return None
if args.open_ui:
# Imported here to avoid importing asyncio before monkey patch
from homeassistant.util.async_ import run_callback_threadsafe
def open_browser(event):
"""Open the webinterface in a browser."""
if hass.config.api is not None:
@@ -311,12 +292,11 @@ def setup_and_run_hass(config_dir: str,
EVENT_HOMEASSISTANT_START, open_browser
)
hass.start()
return hass.exit_code
return hass.start()
def try_to_restart() -> None:
"""Attempt to clean up state and start a new homeassistant instance."""
"""Attempt to clean up state and start a new Home Assistant instance."""
# Things should be mostly shut down already at this point, now just try
# to clean up things that may have been left behind.
sys.stderr.write('Home Assistant attempting to restart.\n')
@@ -348,22 +328,27 @@ def try_to_restart() -> None:
else:
os.closerange(3, max_fd)
# Now launch into a new instance of Home-Assistant. If this fails we
# Now launch into a new instance of Home Assistant. If this fails we
# fall through and exit with error 100 (RESTART_EXIT_CODE) in which case
# systemd will restart us when RestartForceExitStatus=100 is set in the
# systemd.service file.
sys.stderr.write("Restarting Home-Assistant\n")
sys.stderr.write("Restarting Home Assistant\n")
args = cmdline()
os.execv(args[0], args)
def main() -> int:
"""Start Home Assistant."""
if sys.version_info[:3] < (3, 5, 3):
monkey_patch_asyncio()
validate_python()
monkey_patch_needed = sys.version_info[:3] < (3, 6, 3)
if monkey_patch_needed and os.environ.get('HASS_NO_MONKEY') != '1':
if sys.version_info[:2] >= (3, 6):
monkey_patch.disable_c_asyncio()
monkey_patch.patch_weakref_tasks()
attempt_use_uvloop()
args = get_arguments()
if args.script is not None:

658
homeassistant/auth.py Normal file
View File

@@ -0,0 +1,658 @@
"""Provide an authentication layer for Home Assistant."""
import asyncio
import binascii
import importlib
import logging
import os
import uuid
from collections import OrderedDict
from datetime import datetime, timedelta
import attr
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant import data_entry_flow, requirements
from homeassistant.const import CONF_TYPE, CONF_NAME, CONF_ID
from homeassistant.core import callback
from homeassistant.util import dt as dt_util
from homeassistant.util.decorator import Registry
_LOGGER = logging.getLogger(__name__)
STORAGE_VERSION = 1
STORAGE_KEY = 'auth'
AUTH_PROVIDERS = Registry()
AUTH_PROVIDER_SCHEMA = vol.Schema({
vol.Required(CONF_TYPE): str,
vol.Optional(CONF_NAME): str,
# Specify ID if you have two auth providers for same type.
vol.Optional(CONF_ID): str,
}, extra=vol.ALLOW_EXTRA)
ACCESS_TOKEN_EXPIRATION = timedelta(minutes=30)
DATA_REQS = 'auth_reqs_processed'
def generate_secret(entropy: int = 32) -> str:
"""Generate a secret.
Backport of secrets.token_hex from Python 3.6
Event loop friendly.
"""
return binascii.hexlify(os.urandom(entropy)).decode('ascii')
class AuthProvider:
"""Provider of user authentication."""
DEFAULT_TITLE = 'Unnamed auth provider'
initialized = False
def __init__(self, hass, store, config):
"""Initialize an auth provider."""
self.hass = hass
self.store = store
self.config = config
@property
def id(self): # pylint: disable=invalid-name
"""Return id of the auth provider.
Optional, can be None.
"""
return self.config.get(CONF_ID)
@property
def type(self):
"""Return type of the provider."""
return self.config[CONF_TYPE]
@property
def name(self):
"""Return the name of the auth provider."""
return self.config.get(CONF_NAME, self.DEFAULT_TITLE)
async def async_credentials(self):
"""Return all credentials of this provider."""
return await self.store.credentials_for_provider(self.type, self.id)
@callback
def async_create_credentials(self, data):
"""Create credentials."""
return Credentials(
auth_provider_type=self.type,
auth_provider_id=self.id,
data=data,
)
# Implement by extending class
async def async_initialize(self):
"""Initialize the auth provider.
Optional.
"""
async def async_credential_flow(self):
"""Return the data flow for logging in with auth provider."""
raise NotImplementedError
async def async_get_or_create_credentials(self, flow_result):
"""Get credentials based on the flow result."""
raise NotImplementedError
async def async_user_meta_for_credentials(self, credentials):
"""Return extra user metadata for credentials.
Will be used to populate info when creating a new user.
"""
return {}
@attr.s(slots=True)
class User:
"""A user."""
id = attr.ib(type=str, default=attr.Factory(lambda: uuid.uuid4().hex))
is_owner = attr.ib(type=bool, default=False)
is_active = attr.ib(type=bool, default=False)
name = attr.ib(type=str, default=None)
# List of credentials of a user.
credentials = attr.ib(type=list, default=attr.Factory(list), cmp=False)
# Tokens associated with a user.
refresh_tokens = attr.ib(type=dict, default=attr.Factory(dict), cmp=False)
@attr.s(slots=True)
class RefreshToken:
"""RefreshToken for a user to grant new access tokens."""
user = attr.ib(type=User)
client_id = attr.ib(type=str)
id = attr.ib(type=str, default=attr.Factory(lambda: uuid.uuid4().hex))
created_at = attr.ib(type=datetime, default=attr.Factory(dt_util.utcnow))
access_token_expiration = attr.ib(type=timedelta,
default=ACCESS_TOKEN_EXPIRATION)
token = attr.ib(type=str,
default=attr.Factory(lambda: generate_secret(64)))
access_tokens = attr.ib(type=list, default=attr.Factory(list), cmp=False)
@attr.s(slots=True)
class AccessToken:
"""Access token to access the API.
These will only ever be stored in memory and not be persisted.
"""
refresh_token = attr.ib(type=RefreshToken)
created_at = attr.ib(type=datetime, default=attr.Factory(dt_util.utcnow))
token = attr.ib(type=str,
default=attr.Factory(generate_secret))
@property
def expired(self):
"""Return if this token has expired."""
expires = self.created_at + self.refresh_token.access_token_expiration
return dt_util.utcnow() > expires
@attr.s(slots=True)
class Credentials:
"""Credentials for a user on an auth provider."""
auth_provider_type = attr.ib(type=str)
auth_provider_id = attr.ib(type=str)
# Allow the auth provider to store data to represent their auth.
data = attr.ib(type=dict)
id = attr.ib(type=str, default=attr.Factory(lambda: uuid.uuid4().hex))
is_new = attr.ib(type=bool, default=True)
@attr.s(slots=True)
class Client:
"""Client that interacts with Home Assistant on behalf of a user."""
name = attr.ib(type=str)
id = attr.ib(type=str, default=attr.Factory(lambda: uuid.uuid4().hex))
secret = attr.ib(type=str, default=attr.Factory(generate_secret))
redirect_uris = attr.ib(type=list, default=attr.Factory(list))
async def load_auth_provider_module(hass, provider):
"""Load an auth provider."""
try:
module = importlib.import_module(
'homeassistant.auth_providers.{}'.format(provider))
except ImportError:
_LOGGER.warning('Unable to find auth provider %s', provider)
return None
if hass.config.skip_pip or not hasattr(module, 'REQUIREMENTS'):
return module
processed = hass.data.get(DATA_REQS)
if processed is None:
processed = hass.data[DATA_REQS] = set()
elif provider in processed:
return module
req_success = await requirements.async_process_requirements(
hass, 'auth provider {}'.format(provider), module.REQUIREMENTS)
if not req_success:
return None
return module
async def auth_manager_from_config(hass, provider_configs):
"""Initialize an auth manager from config."""
store = AuthStore(hass)
if provider_configs:
providers = await asyncio.gather(
*[_auth_provider_from_config(hass, store, config)
for config in provider_configs])
else:
providers = []
# So returned auth providers are in same order as config
provider_hash = OrderedDict()
for provider in providers:
if provider is None:
continue
key = (provider.type, provider.id)
if key in provider_hash:
_LOGGER.error(
'Found duplicate provider: %s. Please add unique IDs if you '
'want to have the same provider twice.', key)
continue
provider_hash[key] = provider
manager = AuthManager(hass, store, provider_hash)
return manager
async def _auth_provider_from_config(hass, store, config):
"""Initialize an auth provider from a config."""
provider_name = config[CONF_TYPE]
module = await load_auth_provider_module(hass, provider_name)
if module is None:
return None
try:
config = module.CONFIG_SCHEMA(config)
except vol.Invalid as err:
_LOGGER.error('Invalid configuration for auth provider %s: %s',
provider_name, humanize_error(config, err))
return None
return AUTH_PROVIDERS[provider_name](hass, store, config)
class AuthManager:
"""Manage the authentication for Home Assistant."""
def __init__(self, hass, store, providers):
"""Initialize the auth manager."""
self._store = store
self._providers = providers
self.login_flow = data_entry_flow.FlowManager(
hass, self._async_create_login_flow,
self._async_finish_login_flow)
self._access_tokens = {}
@property
def active(self):
"""Return if any auth providers are registered."""
return bool(self._providers)
@property
def async_auth_providers(self):
"""Return a list of available auth providers."""
return self._providers.values()
async def async_get_user(self, user_id):
"""Retrieve a user."""
return await self._store.async_get_user(user_id)
async def async_get_or_create_user(self, credentials):
"""Get or create a user."""
return await self._store.async_get_or_create_user(
credentials, self._async_get_auth_provider(credentials))
async def async_link_user(self, user, credentials):
"""Link credentials to an existing user."""
await self._store.async_link_user(user, credentials)
async def async_remove_user(self, user):
"""Remove a user."""
await self._store.async_remove_user(user)
async def async_create_refresh_token(self, user, client_id):
"""Create a new refresh token for a user."""
return await self._store.async_create_refresh_token(user, client_id)
async def async_get_refresh_token(self, token):
"""Get refresh token by token."""
return await self._store.async_get_refresh_token(token)
@callback
def async_create_access_token(self, refresh_token):
"""Create a new access token."""
access_token = AccessToken(refresh_token)
self._access_tokens[access_token.token] = access_token
return access_token
@callback
def async_get_access_token(self, token):
"""Get an access token."""
tkn = self._access_tokens.get(token)
if tkn is None:
return None
if tkn.expired:
self._access_tokens.pop(token)
return None
return tkn
async def async_create_client(self, name, *, redirect_uris=None,
no_secret=False):
"""Create a new client."""
return await self._store.async_create_client(
name, redirect_uris, no_secret)
async def async_get_or_create_client(self, name, *, redirect_uris=None,
no_secret=False):
"""Find a client, if not exists, create a new one."""
for client in await self._store.async_get_clients():
if client.name == name:
return client
return await self._store.async_create_client(
name, redirect_uris, no_secret)
async def async_get_client(self, client_id):
"""Get a client."""
return await self._store.async_get_client(client_id)
async def _async_create_login_flow(self, handler, *, source, data):
"""Create a login flow."""
auth_provider = self._providers[handler]
if not auth_provider.initialized:
auth_provider.initialized = True
await auth_provider.async_initialize()
return await auth_provider.async_credential_flow()
async def _async_finish_login_flow(self, result):
"""Result of a credential login flow."""
if result['type'] != data_entry_flow.RESULT_TYPE_CREATE_ENTRY:
return None
auth_provider = self._providers[result['handler']]
return await auth_provider.async_get_or_create_credentials(
result['data'])
@callback
def _async_get_auth_provider(self, credentials):
"""Helper to get auth provider from a set of credentials."""
auth_provider_key = (credentials.auth_provider_type,
credentials.auth_provider_id)
return self._providers[auth_provider_key]
class AuthStore:
"""Stores authentication info.
Any mutation to an object should happen inside the auth store.
The auth store is lazy. It won't load the data from disk until a method is
called that needs it.
"""
def __init__(self, hass):
"""Initialize the auth store."""
self.hass = hass
self._users = None
self._clients = None
self._store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY)
async def credentials_for_provider(self, provider_type, provider_id):
"""Return credentials for specific auth provider type and id."""
if self._users is None:
await self.async_load()
return [
credentials
for user in self._users.values()
for credentials in user.credentials
if (credentials.auth_provider_type == provider_type and
credentials.auth_provider_id == provider_id)
]
async def async_get_users(self):
"""Retrieve all users."""
if self._users is None:
await self.async_load()
return list(self._users.values())
async def async_get_user(self, user_id):
"""Retrieve a user."""
if self._users is None:
await self.async_load()
return self._users.get(user_id)
async def async_get_or_create_user(self, credentials, auth_provider):
"""Get or create a new user for given credentials.
If link_user is passed in, the credentials will be linked to the passed
in user if the credentials are new.
"""
if self._users is None:
await self.async_load()
# New credentials, store in user
if credentials.is_new:
info = await auth_provider.async_user_meta_for_credentials(
credentials)
# Make owner and activate user if it's the first user.
if self._users:
is_owner = False
is_active = False
else:
is_owner = True
is_active = True
new_user = User(
is_owner=is_owner,
is_active=is_active,
name=info.get('name'),
)
self._users[new_user.id] = new_user
await self.async_link_user(new_user, credentials)
return new_user
for user in self._users.values():
for creds in user.credentials:
if (creds.auth_provider_type == credentials.auth_provider_type
and creds.auth_provider_id ==
credentials.auth_provider_id):
return user
raise ValueError('We got credentials with ID but found no user')
async def async_link_user(self, user, credentials):
"""Add credentials to an existing user."""
user.credentials.append(credentials)
await self.async_save()
credentials.is_new = False
async def async_remove_user(self, user):
"""Remove a user."""
self._users.pop(user.id)
await self.async_save()
async def async_create_refresh_token(self, user, client_id):
"""Create a new token for a user."""
local_user = await self.async_get_user(user.id)
if local_user is None:
raise ValueError('Invalid user')
local_client = await self.async_get_client(client_id)
if local_client is None:
raise ValueError('Invalid client_id')
refresh_token = RefreshToken(user, client_id)
user.refresh_tokens[refresh_token.token] = refresh_token
await self.async_save()
return refresh_token
async def async_get_refresh_token(self, token):
"""Get refresh token by token."""
if self._users is None:
await self.async_load()
for user in self._users.values():
refresh_token = user.refresh_tokens.get(token)
if refresh_token is not None:
return refresh_token
return None
async def async_create_client(self, name, redirect_uris, no_secret):
"""Create a new client."""
if self._clients is None:
await self.async_load()
kwargs = {
'name': name,
'redirect_uris': redirect_uris
}
if no_secret:
kwargs['secret'] = None
client = Client(**kwargs)
self._clients[client.id] = client
await self.async_save()
return client
async def async_get_clients(self):
"""Return all clients."""
if self._clients is None:
await self.async_load()
return list(self._clients.values())
async def async_get_client(self, client_id):
"""Get a client."""
if self._clients is None:
await self.async_load()
return self._clients.get(client_id)
async def async_load(self):
"""Load the users."""
data = await self._store.async_load()
# Make sure that we're not overriding data if 2 loads happened at the
# same time
if self._users is not None:
return
if data is None:
self._users = {}
self._clients = {}
return
users = {
user_dict['id']: User(**user_dict) for user_dict in data['users']
}
for cred_dict in data['credentials']:
users[cred_dict['user_id']].credentials.append(Credentials(
id=cred_dict['id'],
is_new=False,
auth_provider_type=cred_dict['auth_provider_type'],
auth_provider_id=cred_dict['auth_provider_id'],
data=cred_dict['data'],
))
refresh_tokens = {}
for rt_dict in data['refresh_tokens']:
token = RefreshToken(
id=rt_dict['id'],
user=users[rt_dict['user_id']],
client_id=rt_dict['client_id'],
created_at=dt_util.parse_datetime(rt_dict['created_at']),
access_token_expiration=timedelta(
rt_dict['access_token_expiration']),
token=rt_dict['token'],
)
refresh_tokens[token.id] = token
users[rt_dict['user_id']].refresh_tokens[token.token] = token
for ac_dict in data['access_tokens']:
refresh_token = refresh_tokens[ac_dict['refresh_token_id']]
token = AccessToken(
refresh_token=refresh_token,
created_at=dt_util.parse_datetime(ac_dict['created_at']),
token=ac_dict['token'],
)
refresh_token.access_tokens.append(token)
clients = {
cl_dict['id']: Client(**cl_dict) for cl_dict in data['clients']
}
self._users = users
self._clients = clients
async def async_save(self):
"""Save users."""
users = [
{
'id': user.id,
'is_owner': user.is_owner,
'is_active': user.is_active,
'name': user.name,
}
for user in self._users.values()
]
credentials = [
{
'id': credential.id,
'user_id': user.id,
'auth_provider_type': credential.auth_provider_type,
'auth_provider_id': credential.auth_provider_id,
'data': credential.data,
}
for user in self._users.values()
for credential in user.credentials
]
refresh_tokens = [
{
'id': refresh_token.id,
'user_id': user.id,
'client_id': refresh_token.client_id,
'created_at': refresh_token.created_at.isoformat(),
'access_token_expiration':
refresh_token.access_token_expiration.total_seconds(),
'token': refresh_token.token,
}
for user in self._users.values()
for refresh_token in user.refresh_tokens.values()
]
access_tokens = [
{
'id': user.id,
'refresh_token_id': refresh_token.id,
'created_at': access_token.created_at.isoformat(),
'token': access_token.token,
}
for user in self._users.values()
for refresh_token in user.refresh_tokens.values()
for access_token in refresh_token.access_tokens
]
clients = [
{
'id': client.id,
'name': client.name,
'secret': client.secret,
'redirect_uris': client.redirect_uris,
}
for client in self._clients.values()
]
data = {
'users': users,
'clients': clients,
'credentials': credentials,
'access_tokens': access_tokens,
'refresh_tokens': refresh_tokens,
}
await self._store.async_save(data, delay=1)

View File

@@ -0,0 +1 @@
"""Auth providers for Home Assistant."""

View File

@@ -0,0 +1,178 @@
"""Home Assistant auth provider."""
import base64
from collections import OrderedDict
import hashlib
import hmac
import voluptuous as vol
from homeassistant import auth, data_entry_flow
from homeassistant.exceptions import HomeAssistantError
STORAGE_VERSION = 1
STORAGE_KEY = 'auth_provider.homeassistant'
CONFIG_SCHEMA = auth.AUTH_PROVIDER_SCHEMA.extend({
}, extra=vol.PREVENT_EXTRA)
class InvalidAuth(HomeAssistantError):
"""Raised when we encounter invalid authentication."""
class InvalidUser(HomeAssistantError):
"""Raised when invalid user is specified.
Will not be raised when validating authentication.
"""
class Data:
"""Hold the user data."""
def __init__(self, hass):
"""Initialize the user data store."""
self.hass = hass
self._store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY)
self._data = None
async def async_load(self):
"""Load stored data."""
data = await self._store.async_load()
if data is None:
data = {
'salt': auth.generate_secret(),
'users': []
}
self._data = data
@property
def users(self):
"""Return users."""
return self._data['users']
def validate_login(self, username, password):
"""Validate a username and password.
Raises InvalidAuth if auth invalid.
"""
password = self.hash_password(password)
found = None
# Compare all users to avoid timing attacks.
for user in self._data['users']:
if username == user['username']:
found = user
if found is None:
# Do one more compare to make timing the same as if user was found.
hmac.compare_digest(password, password)
raise InvalidAuth
if not hmac.compare_digest(password,
base64.b64decode(found['password'])):
raise InvalidAuth
def hash_password(self, password, for_storage=False):
"""Encode a password."""
hashed = hashlib.pbkdf2_hmac(
'sha512', password.encode(), self._data['salt'].encode(), 100000)
if for_storage:
hashed = base64.b64encode(hashed).decode()
return hashed
def add_user(self, username, password):
"""Add a user."""
if any(user['username'] == username for user in self.users):
raise InvalidUser
self.users.append({
'username': username,
'password': self.hash_password(password, True),
})
def change_password(self, username, new_password):
"""Update the password of a user.
Raises InvalidUser if user cannot be found.
"""
for user in self.users:
if user['username'] == username:
user['password'] = self.hash_password(new_password, True)
break
else:
raise InvalidUser
async def async_save(self):
"""Save data."""
await self._store.async_save(self._data)
@auth.AUTH_PROVIDERS.register('homeassistant')
class HassAuthProvider(auth.AuthProvider):
"""Auth provider based on a local storage of users in HASS config dir."""
DEFAULT_TITLE = 'Home Assistant Local'
async def async_credential_flow(self):
"""Return a flow to login."""
return LoginFlow(self)
async def async_validate_login(self, username, password):
"""Helper to validate a username and password."""
data = Data(self.hass)
await data.async_load()
await self.hass.async_add_executor_job(
data.validate_login, username, password)
async def async_get_or_create_credentials(self, flow_result):
"""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
})
class LoginFlow(data_entry_flow.FlowHandler):
"""Handler for the login flow."""
def __init__(self, auth_provider):
"""Initialize the login flow."""
self._auth_provider = auth_provider
async def async_step_init(self, user_input=None):
"""Handle the step of the form."""
errors = {}
if user_input is not None:
try:
await self._auth_provider.async_validate_login(
user_input['username'], user_input['password'])
except InvalidAuth:
errors['base'] = 'invalid_auth'
if not errors:
return self.async_create_entry(
title=self._auth_provider.name,
data=user_input
)
schema = OrderedDict()
schema['username'] = str
schema['password'] = str
return self.async_show_form(
step_id='init',
data_schema=vol.Schema(schema),
errors=errors,
)

View File

@@ -0,0 +1,118 @@
"""Example auth provider."""
from collections import OrderedDict
import hmac
import voluptuous as vol
from homeassistant.exceptions import HomeAssistantError
from homeassistant import auth, data_entry_flow
from homeassistant.core import callback
USER_SCHEMA = vol.Schema({
vol.Required('username'): str,
vol.Required('password'): str,
vol.Optional('name'): str,
})
CONFIG_SCHEMA = auth.AUTH_PROVIDER_SCHEMA.extend({
vol.Required('users'): [USER_SCHEMA]
}, extra=vol.PREVENT_EXTRA)
class InvalidAuthError(HomeAssistantError):
"""Raised when submitting invalid authentication."""
@auth.AUTH_PROVIDERS.register('insecure_example')
class ExampleAuthProvider(auth.AuthProvider):
"""Example auth provider based on hardcoded usernames and passwords."""
async def async_credential_flow(self):
"""Return a flow to login."""
return LoginFlow(self)
@callback
def async_validate_login(self, username, password):
"""Helper to validate a username and password."""
user = None
# Compare all users to avoid timing attacks.
for usr in self.config['users']:
if hmac.compare_digest(username.encode('utf-8'),
usr['username'].encode('utf-8')):
user = usr
if user is None:
# Do one more compare to make timing the same as if user was found.
hmac.compare_digest(password.encode('utf-8'),
password.encode('utf-8'))
raise InvalidAuthError
if not hmac.compare_digest(user['password'].encode('utf-8'),
password.encode('utf-8')):
raise InvalidAuthError
async def async_get_or_create_credentials(self, flow_result):
"""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):
"""Return extra user metadata for credentials.
Will be used to populate info when creating a new user.
"""
username = credentials.data['username']
for user in self.config['users']:
if user['username'] == username:
return {
'name': user.get('name')
}
return {}
class LoginFlow(data_entry_flow.FlowHandler):
"""Handler for the login flow."""
def __init__(self, auth_provider):
"""Initialize the login flow."""
self._auth_provider = auth_provider
async def async_step_init(self, user_input=None):
"""Handle the step of the form."""
errors = {}
if user_input is not None:
try:
self._auth_provider.async_validate_login(
user_input['username'], user_input['password'])
except InvalidAuthError:
errors['base'] = 'invalid_auth'
if not errors:
return self.async_create_entry(
title=self._auth_provider.name,
data=user_input
)
schema = OrderedDict()
schema['username'] = str
schema['password'] = str
return self.async_show_form(
step_id='init',
data_schema=vol.Schema(schema),
errors=errors,
)

View File

@@ -1,5 +1,4 @@
"""Provides methods to bootstrap a home assistant instance."""
import asyncio
"""Provide methods to bootstrap a Home Assistant instance."""
import logging
import logging.handlers
import os
@@ -11,14 +10,13 @@ from typing import Any, Optional, Dict
import voluptuous as vol
import homeassistant.components as core_components
from homeassistant import (
core, config as conf_util, config_entries, components as core_components)
from homeassistant.components import persistent_notification
import homeassistant.config as conf_util
import homeassistant.core as core
from homeassistant.const import EVENT_HOMEASSISTANT_CLOSE
from homeassistant.setup import async_setup_component
import homeassistant.loader as loader
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.signal import async_register_signal_handling
@@ -26,19 +24,26 @@ from homeassistant.helpers.signal import async_register_signal_handling
_LOGGER = logging.getLogger(__name__)
ERROR_LOG_FILENAME = 'home-assistant.log'
# hass.data key for logging information.
DATA_LOGGING = 'logging'
FIRST_INIT_COMPONENT = set((
'recorder', 'mqtt', 'mqtt_eventstream', 'logger', 'introduction'))
'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) \
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 config dict.
"""Try to configure Home Assistant from a configuration dictionary.
Dynamically loads required components and its dependencies.
"""
@@ -47,84 +52,86 @@ def from_config_dict(config: Dict[str, Any],
if config_dir is not None:
config_dir = os.path.abspath(config_dir)
hass.config.config_dir = config_dir
mount_local_lib_path(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_rotate_days, log_file, log_no_color)
)
return hass
@asyncio.coroutine
def async_from_config_dict(config: Dict[str, Any],
hass: core.HomeAssistant,
config_dir: Optional[str]=None,
enable_log: bool=True,
verbose: bool=False,
skip_pip: bool=False,
log_rotate_days: Any=None) \
async def async_from_config_dict(config: Dict[str, Any],
hass: core.HomeAssistant,
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 config dict.
"""Try to configure Home Assistant from a configuration dictionary.
Dynamically loads required components and its dependencies.
This method is a coroutine.
"""
start = time()
hass.async_track_tasks()
if enable_log:
async_enable_logging(hass, verbose, log_rotate_days, log_file,
log_no_color)
core_config = config.get(core.DOMAIN, {})
try:
yield from conf_util.async_process_ha_core_config(hass, core_config)
await conf_util.async_process_ha_core_config(hass, core_config)
except vol.Invalid as ex:
conf_util.async_log_exception(ex, 'homeassistant', core_config, hass)
return None
yield from hass.loop.run_in_executor(
None, conf_util.process_ha_config_upgrade, hass)
if enable_log:
async_enable_logging(hass, verbose, log_rotate_days)
await hass.async_add_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.')
_LOGGER.warning("Skipping pip installation of required modules. "
"This may cause issues")
if not loader.PREPARED:
yield from hass.loop.run_in_executor(None, loader.prepare, hass)
# Make a copy because we are mutating it.
config = OrderedDict(config)
# Merge packages
conf_util.merge_packages_config(
config, core_config.get(conf_util.CONF_PACKAGES, {}))
hass, config, core_config.get(conf_util.CONF_PACKAGES, {}))
# Make a copy because we are mutating it.
# Use OrderedDict in case original one was one.
# Convert values to dictionaries if they are None
new_config = OrderedDict()
# Ensure we have no None values after merge
for key, value in config.items():
new_config[key] = value or {}
config = new_config
if not value:
config[key] = {}
hass.config_entries = config_entries.ConfigEntries(hass, config)
await hass.config_entries.async_load()
# 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
# pylint: disable=not-an-iterable
res = yield from core_components.async_setup(hass, config)
res = await core_components.async_setup(hass, config)
if not res:
_LOGGER.error('Home Assistant core failed to initialize. '
'Further initialization aborted.')
_LOGGER.error("Home Assistant core failed to initialize. "
"further initialization aborted")
return hass
yield from persistent_notification.async_setup(hass, config)
await persistent_notification.async_setup(hass, config)
_LOGGER.info('Home Assistant core initialized')
_LOGGER.info("Home Assistant core initialized")
# stage 1
for component in components:
@@ -132,7 +139,7 @@ def async_from_config_dict(config: Dict[str, Any],
continue
hass.async_add_job(async_setup_component(hass, component, config))
yield from hass.async_block_till_done()
await hass.async_block_till_done()
# stage 2
for component in components:
@@ -140,20 +147,22 @@ def async_from_config_dict(config: Dict[str, Any],
continue
hass.async_add_job(async_setup_component(hass, component, config))
yield from hass.async_stop_track_tasks()
await hass.async_block_till_done()
stop = time()
_LOGGER.info('Home Assistant initialized in %ss', round(stop-start, 2))
_LOGGER.info("Home Assistant initialized in %.2fs", stop-start)
async_register_signal_handling(hass)
return hass
def from_config_file(config_path: str,
hass: Optional[core.HomeAssistant]=None,
verbose: bool=False,
skip_pip: bool=True,
log_rotate_days: Any=None):
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):
"""Read the configuration file and try to start all the functionality.
Will add functionality to 'hass' parameter if given,
@@ -165,18 +174,20 @@ def from_config_file(config_path: str,
# run task
hass = hass.loop.run_until_complete(
async_from_config_file(
config_path, hass, verbose, skip_pip, log_rotate_days)
config_path, hass, verbose, skip_pip,
log_rotate_days, log_file, log_no_color)
)
return hass
@asyncio.coroutine
def async_from_config_file(config_path: str,
hass: core.HomeAssistant,
verbose: bool=False,
skip_pip: bool=True,
log_rotate_days: Any=None):
async def async_from_config_file(config_path: str,
hass: core.HomeAssistant,
verbose: bool = False,
skip_pip: bool = True,
log_rotate_days: Any = None,
log_file: Any = None,
log_no_color: bool = False):
"""Read the configuration file and try to start all the functionality.
Will add functionality to 'hass' parameter.
@@ -185,72 +196,90 @@ def async_from_config_file(config_path: str,
# Set config dir to directory holding config file
config_dir = os.path.abspath(os.path.dirname(config_path))
hass.config.config_dir = config_dir
yield from hass.loop.run_in_executor(
None, mount_local_lib_path, config_dir)
async_enable_logging(hass, verbose, log_rotate_days)
if not is_virtual_env():
await async_mount_local_lib_path(config_dir)
async_enable_logging(hass, verbose, log_rotate_days, log_file,
log_no_color)
try:
config_dict = yield from hass.loop.run_in_executor(
None, conf_util.load_yaml_config_file, config_path)
config_dict = await hass.async_add_job(
conf_util.load_yaml_config_file, config_path)
except HomeAssistantError as err:
_LOGGER.error('Error loading %s: %s', config_path, err)
_LOGGER.error("Error loading %s: %s", config_path, err)
return None
finally:
clear_secret_cache()
hass = yield from async_from_config_dict(
return await async_from_config_dict(
config_dict, hass, enable_log=False, skip_pip=skip_pip)
return hass
@core.callback
def async_enable_logging(hass: core.HomeAssistant, verbose: bool=False,
log_rotate_days=None) -> None:
"""Setup the logging.
def async_enable_logging(hass: core.HomeAssistant,
verbose: bool = False,
log_rotate_days=None,
log_file=None,
log_no_color: bool = False) -> None:
"""Set up the logging.
This method must be run in the event loop.
"""
logging.basicConfig(level=logging.INFO)
fmt = ("%(asctime)s %(levelname)s (%(threadName)s) "
"[%(name)s] %(message)s")
colorfmt = "%(log_color)s{}%(reset)s".format(fmt)
datefmt = '%y-%m-%d %H:%M:%S'
datefmt = '%Y-%m-%d %H:%M:%S'
# suppress overly verbose logs from libraries that aren't helpful
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("aiohttp.access").setLevel(logging.WARNING)
if not log_no_color:
try:
from colorlog import ColoredFormatter
# basicConfig must be called after importing colorlog in order to
# ensure that the handlers it sets up wraps the correct streams.
logging.basicConfig(level=logging.INFO)
try:
from colorlog import ColoredFormatter
logging.getLogger().handlers[0].setFormatter(ColoredFormatter(
colorfmt,
datefmt=datefmt,
reset=True,
log_colors={
'DEBUG': 'cyan',
'INFO': 'green',
'WARNING': 'yellow',
'ERROR': 'red',
'CRITICAL': 'red',
}
))
except ImportError:
pass
colorfmt = "%(log_color)s{}%(reset)s".format(fmt)
logging.getLogger().handlers[0].setFormatter(ColoredFormatter(
colorfmt,
datefmt=datefmt,
reset=True,
log_colors={
'DEBUG': 'cyan',
'INFO': 'green',
'WARNING': 'yellow',
'ERROR': 'red',
'CRITICAL': 'red',
}
))
except ImportError:
pass
# If the above initialization failed for any reason, setup the default
# formatting. If the above succeeds, this wil result in a no-op.
logging.basicConfig(format=fmt, datefmt=datefmt, level=logging.INFO)
# Suppress overly verbose logs from libraries that aren't helpful
logging.getLogger('requests').setLevel(logging.WARNING)
logging.getLogger('urllib3').setLevel(logging.WARNING)
logging.getLogger('aiohttp.access').setLevel(logging.WARNING)
# Log errors to a file if we have write access to file or config dir
err_log_path = hass.config.path(ERROR_LOG_FILENAME)
if log_file is None:
err_log_path = hass.config.path(ERROR_LOG_FILENAME)
else:
err_log_path = os.path.abspath(log_file)
err_path_exists = os.path.isfile(err_log_path)
err_dir = os.path.dirname(err_log_path)
# Check if we can write to the error log if it exists or that
# we can create files in the containing directory if not.
if (err_path_exists and os.access(err_log_path, os.W_OK)) or \
(not err_path_exists and os.access(hass.config.config_dir, os.W_OK)):
(not err_path_exists and os.access(err_dir, os.W_OK)):
if log_rotate_days:
err_handler = logging.handlers.TimedRotatingFileHandler(
err_log_path, when='midnight', backupCount=log_rotate_days)
err_log_path, when='midnight',
backupCount=log_rotate_days) # type: logging.FileHandler
else:
err_handler = logging.FileHandler(
err_log_path, mode='w', delay=True)
@@ -260,30 +289,32 @@ def async_enable_logging(hass: core.HomeAssistant, verbose: bool=False,
async_handler = AsyncHandler(hass.loop, err_handler)
@asyncio.coroutine
def async_stop_async_handler(event):
async def async_stop_async_handler(event):
"""Cleanup async handler."""
logging.getLogger('').removeHandler(async_handler)
yield from async_handler.async_close(blocking=True)
await async_handler.async_close(blocking=True)
hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_CLOSE, async_stop_async_handler)
logger = logging.getLogger('')
logger.addHandler(async_handler)
logger.addHandler(async_handler) # type: ignore
logger.setLevel(logging.INFO)
# Save the log file location for access by other components.
hass.data[DATA_LOGGING] = err_log_path
else:
_LOGGER.error(
'Unable to setup error log %s (access denied)', err_log_path)
"Unable to setup error log %s (access denied)", err_log_path)
def mount_local_lib_path(config_dir: str) -> str:
async def async_mount_local_lib_path(config_dir: str) -> str:
"""Add local library to Python Path.
Async friendly.
This function is a coroutine.
"""
deps_dir = os.path.join(config_dir, 'deps')
if deps_dir not in sys.path:
sys.path.insert(0, os.path.join(config_dir, 'deps'))
lib_dir = await async_get_user_site(deps_dir)
if lib_dir not in sys.path:
sys.path.insert(0, lib_dir)
return deps_dir

View File

@@ -15,7 +15,7 @@ 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.loader import get_component
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,
@@ -33,25 +33,27 @@ def is_on(hass, entity_id=None):
If there is no entity id given we will check all.
"""
if entity_id:
group = get_component('group')
entity_ids = group.expand_entity_ids(hass, [entity_id])
entity_ids = hass.components.group.expand_entity_ids([entity_id])
else:
entity_ids = hass.states.entity_ids()
for entity_id in entity_ids:
domain = ha.split_entity_id(entity_id)[0]
module = get_component(domain)
for ent_id in entity_ids:
domain = ha.split_entity_id(ent_id)[0]
try:
if module.is_on(hass, entity_id):
return True
component = getattr(hass.components, domain)
except AttributeError:
# module is None or method is_on does not exist
_LOGGER.exception("Failed to call %s.is_on for %s",
module, entity_id)
except ImportError:
_LOGGER.error('Failed to call %s.is_on: component not found',
domain)
continue
if not hasattr(component, 'is_on'):
_LOGGER.warning("Component %s has no is_on method.", domain)
continue
if component.is_on(ent_id):
return True
return False
@@ -100,12 +102,18 @@ def reload_core_config(hass):
hass.services.call(ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG)
@asyncio.coroutine
def async_reload_core_config(hass):
"""Reload the core config."""
yield from hass.services.async_call(ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG)
@asyncio.coroutine
def async_setup(hass, config):
"""Setup general services related to Home Assistant."""
"""Set up general services related to Home Assistant."""
@asyncio.coroutine
def async_handle_turn_service(service):
"""Method to handle calls to homeassistant.turn_on/off."""
"""Handle calls to homeassistant.turn_on/off."""
entity_ids = extract_entity_ids(hass, service)
# Generic turn on/off method requires entity id
@@ -126,7 +134,7 @@ def async_setup(hass, config):
# 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 a in between solution, we'll
# 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)
@@ -147,6 +155,13 @@ def async_setup(hass, config):
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 {}"))
@asyncio.coroutine
def async_handle_core_service(call):
@@ -161,10 +176,9 @@ def async_setup(hass, config):
return
if errors:
notif = get_component('persistent_notification')
_LOGGER.error(errors)
notif.async_create(
hass, "Config error. See dev-info panel for details.",
hass.components.persistent_notification.async_create(
"Config error. See dev-info panel for details.",
"Config validating", "{0}.check_config".format(ha.DOMAIN))
return

View File

@@ -0,0 +1,347 @@
"""
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 asyncio
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.13.1']
_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(object):
"""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
@asyncio.coroutine
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
@asyncio.coroutine
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,196 @@
"""
Support for Automation Device Specification (ADS).
For more details about this component, please refer to the documentation.
https://home-assistant.io/components/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
REQUIREMENTS = ['pyads==2.2.6']
_LOGGER = logging.getLogger(__name__)
DATA_ADS = 'data_ads'
# Supported Types
ADSTYPE_INT = 'int'
ADSTYPE_UINT = 'uint'
ADSTYPE_BYTE = 'byte'
ADSTYPE_BOOL = 'bool'
DOMAIN = 'ads'
CONF_ADS_VAR = 'adsvar'
CONF_ADS_VAR_BRIGHTNESS = 'adsvar_brightness'
CONF_ADS_TYPE = 'adstype'
CONF_ADS_FACTOR = 'factor'
CONF_ADS_VALUE = 'value'
SERVICE_WRITE_DATA_BY_NAME = 'write_data_by_name'
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_DEVICE): cv.string,
vol.Required(CONF_PORT): cv.port,
vol.Optional(CONF_IP_ADDRESS): cv.string,
})
}, extra=vol.ALLOW_EXTRA)
SCHEMA_SERVICE_WRITE_DATA_BY_NAME = vol.Schema({
vol.Required(CONF_ADS_TYPE):
vol.In([ADSTYPE_INT, ADSTYPE_UINT, ADSTYPE_BYTE]),
vol.Required(CONF_ADS_VALUE): cv.match_all,
vol.Required(CONF_ADS_VAR): cv.string,
})
def setup(hass, config):
"""Set up the ADS component."""
import pyads
conf = config[DOMAIN]
net_id = conf.get(CONF_DEVICE)
ip_address = conf.get(CONF_IP_ADDRESS)
port = conf.get(CONF_PORT)
client = pyads.Connection(net_id, port, ip_address)
AdsHub.ADS_TYPEMAP = {
ADSTYPE_BOOL: pyads.PLCTYPE_BOOL,
ADSTYPE_BYTE: pyads.PLCTYPE_BYTE,
ADSTYPE_INT: pyads.PLCTYPE_INT,
ADSTYPE_UINT: pyads.PLCTYPE_UINT,
}
AdsHub.PLCTYPE_BOOL = pyads.PLCTYPE_BOOL
AdsHub.PLCTYPE_BYTE = pyads.PLCTYPE_BYTE
AdsHub.PLCTYPE_INT = pyads.PLCTYPE_INT
AdsHub.PLCTYPE_UINT = pyads.PLCTYPE_UINT
AdsHub.ADSError = pyads.ADSError
try:
ads = AdsHub(client)
except pyads.pyads.ADSError:
_LOGGER.error(
"Could not connect to ADS host (netid=%s, port=%s)", net_id, port)
return False
hass.data[DATA_ADS] = ads
hass.bus.listen(EVENT_HOMEASSISTANT_STOP, ads.shutdown)
def handle_write_data_by_name(call):
"""Write a value to the connected ADS device."""
ads_var = call.data.get(CONF_ADS_VAR)
ads_type = call.data.get(CONF_ADS_TYPE)
value = call.data.get(CONF_ADS_VALUE)
try:
ads.write_by_name(ads_var, value, ads.ADS_TYPEMAP[ads_type])
except pyads.ADSError as err:
_LOGGER.error(err)
hass.services.register(
DOMAIN, SERVICE_WRITE_DATA_BY_NAME, handle_write_data_by_name,
schema=SCHEMA_SERVICE_WRITE_DATA_BY_NAME)
return True
# Tuple to hold data needed for notification
NotificationItem = namedtuple(
'NotificationItem', 'hnotify huser name plc_datatype callback'
)
class AdsHub(object):
"""Representation of an ADS connection."""
def __init__(self, ads_client):
"""Initialize the ADS hub."""
self._client = ads_client
self._client.open()
# All ADS devices are registered here
self._devices = []
self._notification_items = {}
self._lock = threading.Lock()
def shutdown(self, *args, **kwargs):
"""Shutdown ADS connection."""
_LOGGER.debug("Shutting down ADS")
for notification_item in self._notification_items.values():
self._client.del_device_notification(
notification_item.hnotify,
notification_item.huser
)
_LOGGER.debug(
"Deleting device notification %d, %d",
notification_item.hnotify, notification_item.huser)
self._client.close()
def register_device(self, device):
"""Register a new device."""
self._devices.append(device)
def write_by_name(self, name, value, plc_datatype):
"""Write a value to the device."""
with self._lock:
return self._client.write_by_name(name, value, plc_datatype)
def read_by_name(self, name, plc_datatype):
"""Read a value from the device."""
with self._lock:
return self._client.read_by_name(name, plc_datatype)
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))
with self._lock:
hnotify, huser = self._client.add_device_notification(
name, attr, self._device_notification_callback)
hnotify = int(hnotify)
_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):
"""Handle device notifications."""
contents = notification.contents
hnotify = int(contents.hNotification)
_LOGGER.debug("Received notification %d", hnotify)
data = contents.data
try:
notification_item = self._notification_items[hnotify]
except KeyError:
_LOGGER.debug("Unknown device notification handle: %d", hnotify)
return
# Parse data to desired datatype
if notification_item.plc_datatype == self.PLCTYPE_BOOL:
value = bool(struct.unpack('<?', bytearray(data)[:1])[0])
elif notification_item.plc_datatype == self.PLCTYPE_INT:
value = struct.unpack('<h', bytearray(data)[:2])[0]
elif notification_item.plc_datatype == self.PLCTYPE_BYTE:
value = struct.unpack('<B', bytearray(data)[:1])[0]
elif notification_item.plc_datatype == self.PLCTYPE_UINT:
value = struct.unpack('<H', bytearray(data)[:2])[0]
else:
value = bytearray(data)
_LOGGER.warning("No callback available for this datatype")
notification_item.callback(notification_item.name, value)

View File

@@ -0,0 +1,15 @@
# Describes the format for available ADS services
write_data_by_name:
description: Write a value to the connected ADS device.
fields:
adsvar:
description: The name of the variable to write to.
example: '.global_var'
adstype:
description: The data type of the variable to write to.
example: 'int'
value:
description: The value to write to the variable.
example: 1

View File

@@ -7,14 +7,14 @@ https://home-assistant.io/components/alarm_control_panel/
import asyncio
from datetime import timedelta
import logging
import os
import voluptuous as vol
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)
from homeassistant.config import load_yaml_config_file
SERVICE_ALARM_DISARM, SERVICE_ALARM_ARM_HOME, SERVICE_ALARM_ARM_AWAY,
SERVICE_ALARM_ARM_NIGHT, SERVICE_ALARM_ARM_CUSTOM_BYPASS)
from homeassistant.loader import bind_hass
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -30,6 +30,8 @@ SERVICE_TO_METHOD = {
SERVICE_ALARM_DISARM: 'alarm_disarm',
SERVICE_ALARM_ARM_HOME: 'alarm_arm_home',
SERVICE_ALARM_ARM_AWAY: 'alarm_arm_away',
SERVICE_ALARM_ARM_NIGHT: 'alarm_arm_night',
SERVICE_ALARM_ARM_CUSTOM_BYPASS: 'alarm_arm_custom_bypass',
SERVICE_ALARM_TRIGGER: 'alarm_trigger'
}
@@ -44,6 +46,7 @@ ALARM_SERVICE_SCHEMA = vol.Schema({
})
@bind_hass
def alarm_disarm(hass, code=None, entity_id=None):
"""Send the alarm the command for disarm."""
data = {}
@@ -55,6 +58,7 @@ def alarm_disarm(hass, code=None, entity_id=None):
hass.services.call(DOMAIN, SERVICE_ALARM_DISARM, data)
@bind_hass
def alarm_arm_home(hass, code=None, entity_id=None):
"""Send the alarm the command for arm home."""
data = {}
@@ -66,6 +70,7 @@ def alarm_arm_home(hass, code=None, entity_id=None):
hass.services.call(DOMAIN, SERVICE_ALARM_ARM_HOME, data)
@bind_hass
def alarm_arm_away(hass, code=None, entity_id=None):
"""Send the alarm the command for arm away."""
data = {}
@@ -77,6 +82,19 @@ def alarm_arm_away(hass, code=None, entity_id=None):
hass.services.call(DOMAIN, SERVICE_ALARM_ARM_AWAY, data)
@bind_hass
def alarm_arm_night(hass, code=None, entity_id=None):
"""Send the alarm the command for arm night."""
data = {}
if code:
data[ATTR_CODE] = code
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
hass.services.call(DOMAIN, SERVICE_ALARM_ARM_NIGHT, data)
@bind_hass
def alarm_trigger(hass, code=None, entity_id=None):
"""Send the alarm the command for trigger."""
data = {}
@@ -88,6 +106,18 @@ def alarm_trigger(hass, code=None, entity_id=None):
hass.services.call(DOMAIN, SERVICE_ALARM_TRIGGER, data)
@bind_hass
def alarm_arm_custom_bypass(hass, code=None, entity_id=None):
"""Send the alarm the command for arm custom bypass."""
data = {}
if code:
data[ATTR_CODE] = code
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
hass.services.call(DOMAIN, SERVICE_ALARM_ARM_CUSTOM_BYPASS, data)
@asyncio.coroutine
def async_setup(hass, config):
"""Track states and offer events for sensors."""
@@ -105,37 +135,25 @@ def async_setup(hass, config):
method = "async_{}".format(SERVICE_TO_METHOD[service.service])
update_tasks = []
for alarm in target_alarms:
yield from getattr(alarm, method)(code)
update_tasks = []
for alarm in target_alarms:
if not alarm.should_poll:
continue
update_coro = hass.async_add_job(
alarm.async_update_ha_state(True))
if hasattr(alarm, 'async_update'):
update_tasks.append(update_coro)
else:
yield from update_coro
update_tasks.append(alarm.async_update_ha_state(True))
if update_tasks:
yield from asyncio.wait(update_tasks, loop=hass.loop)
descriptions = yield from hass.loop.run_in_executor(
None, load_yaml_config_file, os.path.join(
os.path.dirname(__file__), 'services.yaml'))
for service in SERVICE_TO_METHOD:
hass.services.async_register(
DOMAIN, service, async_alarm_service_handler,
descriptions.get(service), schema=ALARM_SERVICE_SCHEMA)
schema=ALARM_SERVICE_SCHEMA)
return True
# pylint: disable=no-self-use
class AlarmControlPanel(Entity):
"""An abstract class for alarm control devices."""
@@ -158,8 +176,7 @@ class AlarmControlPanel(Entity):
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, self.alarm_disarm, code)
return self.hass.async_add_job(self.alarm_disarm, code)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
@@ -170,8 +187,7 @@ class AlarmControlPanel(Entity):
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, self.alarm_arm_home, code)
return self.hass.async_add_job(self.alarm_arm_home, code)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
@@ -182,8 +198,18 @@ class AlarmControlPanel(Entity):
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, self.alarm_arm_away, code)
return self.hass.async_add_job(self.alarm_arm_away, code)
def alarm_arm_night(self, code=None):
"""Send arm night command."""
raise NotImplementedError()
def async_alarm_arm_night(self, code=None):
"""Send arm night command.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.async_add_job(self.alarm_arm_night, code)
def alarm_trigger(self, code=None):
"""Send alarm trigger command."""
@@ -194,8 +220,18 @@ class AlarmControlPanel(Entity):
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.loop.run_in_executor(
None, self.alarm_trigger, code)
return self.hass.async_add_job(self.alarm_trigger, code)
def alarm_arm_custom_bypass(self, code=None):
"""Send arm custom bypass command."""
raise NotImplementedError()
def async_alarm_arm_custom_bypass(self, code=None):
"""Send arm custom bypass command.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.async_add_job(self.alarm_arm_custom_bypass, code)
@property
def state_attributes(self):

View File

@@ -0,0 +1,85 @@
"""
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_devices, 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_devices(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

@@ -0,0 +1,144 @@
"""
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 asyncio
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_devices, discovery_info=None):
"""Set up for AlarmDecoder alarm panels."""
device = AlarmDecoderAlarmPanel()
add_devices([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
@asyncio.coroutine
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 '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

@@ -4,21 +4,21 @@ 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 asyncio
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_PASSWORD, CONF_USERNAME, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED, STATE_UNKNOWN, CONF_CODE,
CONF_NAME)
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 = ['https://github.com/Xorso/pyalarmdotcom'
'/archive/0.1.1.zip'
'#pyalarmdotcom==0.1.1']
REQUIREMENTS = ['pyalarmdotcom==0.3.2']
_LOGGER = logging.getLogger(__name__)
@@ -32,33 +32,46 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
})
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup an Alarm.com control panel."""
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, 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)
add_devices([AlarmDotCom(hass, name, code, username, password)], True)
alarmdotcom = AlarmDotCom(hass, name, code, username, password)
yield from alarmdotcom.async_login()
async_add_devices([alarmdotcom])
class AlarmDotCom(alarm.AlarmControlPanel):
"""Represent an Alarm.com status."""
"""Representation of an Alarm.com status."""
def __init__(self, hass, name, code, username, password):
"""Initialize the Alarm.com status."""
from pyalarmdotcom.pyalarmdotcom import Alarmdotcom
self._alarm = Alarmdotcom(username, password, timeout=10)
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)
def update(self):
@asyncio.coroutine
def async_login(self):
"""Login to Alarm.com."""
yield from self._alarm.async_login()
@asyncio.coroutine
def async_update(self):
"""Fetch the latest state."""
self._state = self._alarm.state
yield from self._alarm.async_update()
return self._alarm.state
@property
def name(self):
@@ -67,51 +80,52 @@ class AlarmDotCom(alarm.AlarmControlPanel):
@property
def code_format(self):
"""One or more characters if code is defined."""
return None if self._code is None else '.+'
"""Return one or more digits/characters."""
if self._code is None:
return None
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
return 'Number'
return 'Any'
@property
def state(self):
"""Return the state of the device."""
if self._state == 'Disarmed':
if self._alarm.state.lower() == 'disarmed':
return STATE_ALARM_DISARMED
elif self._state == 'Armed Stay':
elif self._alarm.state.lower() == 'armed stay':
return STATE_ALARM_ARMED_HOME
elif self._state == 'Armed Away':
elif self._alarm.state.lower() == 'armed away':
return STATE_ALARM_ARMED_AWAY
else:
return STATE_UNKNOWN
return STATE_UNKNOWN
def alarm_disarm(self, code=None):
@property
def device_state_attributes(self):
"""Return the state attributes."""
return {
'sensor_status': self._alarm.sensor_status
}
@asyncio.coroutine
def async_alarm_disarm(self, code=None):
"""Send disarm command."""
if not self._validate_code(code, 'disarming home'):
return
from pyalarmdotcom.pyalarmdotcom import Alarmdotcom
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.disarm()
if self._validate_code(code):
yield from self._alarm.async_alarm_disarm()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if not self._validate_code(code, 'arming home'):
return
from pyalarmdotcom.pyalarmdotcom import Alarmdotcom
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.arm_stay()
@asyncio.coroutine
def async_alarm_arm_home(self, code=None):
"""Send arm hom command."""
if self._validate_code(code):
yield from self._alarm.async_alarm_arm_home()
def alarm_arm_away(self, code=None):
@asyncio.coroutine
def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
if not self._validate_code(code, 'arming home'):
return
from pyalarmdotcom.pyalarmdotcom import Alarmdotcom
# Open another session to alarm.com to fire off the command
_alarm = Alarmdotcom(self._username, self._password, timeout=10)
_alarm.arm_away()
if self._validate_code(code):
yield from self._alarm.async_alarm_arm_away()
def _validate_code(self, code, state):
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 for %s', state)
_LOGGER.warning("Wrong code entered")
return check

View File

@@ -0,0 +1,131 @@
"""
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)
_LOGGER = logging.getLogger(__name__)
ARMED = 'armed'
CONF_HOME_MODE_NAME = 'home_mode_name'
CONF_AWAY_MODE_NAME = 'away_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,
})
def setup_platform(hass, config, add_devices, 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)
base_stations = []
for base_station in arlo.base_stations:
base_stations.append(ArloBaseStation(base_station, home_mode_name,
away_mode_name))
add_devices(base_stations, True)
class ArloBaseStation(AlarmControlPanel):
"""Representation of an Arlo Alarm Control Panel."""
def __init__(self, data, home_mode_name, away_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._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
@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
elif mode == DISARMED:
return STATE_ALARM_DISARMED
elif mode == self._home_mode_name:
return STATE_ALARM_ARMED_HOME
elif mode == self._away_mode_name:
return STATE_ALARM_ARMED_AWAY
return mode

View File

@@ -0,0 +1,91 @@
"""
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_devices, 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_devices(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
elif mode.name == LOCATION_MODE_HOME:
return STATE_ALARM_ARMED_HOME
elif 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

@@ -18,7 +18,7 @@ from homeassistant.const import (
STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED, STATE_UNKNOWN)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['concord232==0.14']
REQUIREMENTS = ['concord232==0.15']
_LOGGER = logging.getLogger(__name__)
@@ -26,12 +26,12 @@ DEFAULT_HOST = 'localhost'
DEFAULT_NAME = 'CONCORD232'
DEFAULT_PORT = 5007
SCAN_INTERVAL = timedelta(seconds=1)
SCAN_INTERVAL = timedelta(seconds=10)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
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,
})
@@ -47,11 +47,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
add_devices([Concord232Alarm(hass, url, name)])
except requests.exceptions.ConnectionError as ex:
_LOGGER.error("Unable to connect to Concord232: %s", str(ex))
return False
return
class Concord232Alarm(alarm.AlarmControlPanel):
"""Represents the Concord232-based alarm panel."""
"""Representation of the Concord232-based alarm panel."""
def __init__(self, hass, url, name):
"""Initialize the Concord232 alarm panel."""
@@ -79,8 +79,8 @@ class Concord232Alarm(alarm.AlarmControlPanel):
@property
def code_format(self):
"""The characters if code is defined."""
return '[0-9]{4}([0-9]{2})?'
"""Return the characters if code is defined."""
return 'Number'
@property
def state(self):
@@ -107,7 +107,7 @@ class Concord232Alarm(alarm.AlarmControlPanel):
newstate = STATE_ALARM_ARMED_AWAY
if not newstate == self._state:
_LOGGER.info("State Chnage from %s to %s", self._state, newstate)
_LOGGER.info("State change from %s to %s", self._state, newstate)
self._state = newstate
return self._state
@@ -117,8 +117,8 @@ class Concord232Alarm(alarm.AlarmControlPanel):
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._alarm.arm('home')
self._alarm.arm('stay')
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._alarm.arm('auto')
self._alarm.arm('away')

View File

@@ -4,11 +4,45 @@ 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
import homeassistant.components.alarm_control_panel.manual as 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)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the Demo alarm control panel platform."""
"""Set up the Demo alarm control panel platform."""
add_devices([
manual.ManualAlarm(hass, 'Alarm', '1234', 5, 10, False),
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

@@ -0,0 +1,144 @@
"""
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 asyncio
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_devices, 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_devices([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
@asyncio.coroutine
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

@@ -6,7 +6,6 @@ https://home-assistant.io/components/alarm_control_panel.envisalink/
"""
import asyncio
import logging
import os
import voluptuous as vol
@@ -14,7 +13,6 @@ 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.config import load_yaml_config_file
from homeassistant.components.envisalink import (
DATA_EVL, EnvisalinkDevice, PARTITION_SCHEMA, CONF_CODE, CONF_PANIC,
CONF_PARTITIONNAME, SIGNAL_KEYPAD_UPDATE, SIGNAL_PARTITION_UPDATE)
@@ -69,14 +67,9 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
for device in target_devices:
device.async_alarm_keypress(keypress)
# Register Envisalink specific services
descriptions = yield from hass.loop.run_in_executor(
None, load_yaml_config_file, os.path.join(
os.path.dirname(__file__), 'services.yaml'))
hass.services.async_register(
alarm.DOMAIN, SERVICE_ALARM_KEYPRESS, alarm_keypress_handler,
descriptions.get(SERVICE_ALARM_KEYPRESS), schema=ALARM_KEYPRESS_SCHEMA)
schema=ALARM_KEYPRESS_SCHEMA)
return True
@@ -104,17 +97,16 @@ class EnvisalinkAlarm(EnvisalinkDevice, alarm.AlarmControlPanel):
@callback
def _update_callback(self, partition):
"""Update HA state, if needed."""
"""Update Home Assistant state, if needed."""
if partition is None or int(partition) == self._partition_number:
self.hass.async_add_job(self.async_update_ha_state())
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
else:
return '^\\d{4,6}$'
return 'Number'
@property
def state(self):

View File

@@ -0,0 +1,107 @@
"""
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 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_PASSWORD, CONF_USERNAME, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pyialarm==0.2']
_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_NAME, default=DEFAULT_NAME): cv.string,
})
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up an iAlarm control panel."""
name = config.get(CONF_NAME)
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
host = config.get(CONF_HOST)
url = 'http://{}'.format(host)
ialarm = IAlarmPanel(name, username, password, url)
add_devices([ialarm], True)
class IAlarmPanel(alarm.AlarmControlPanel):
"""Representation of an iAlarm status."""
def __init__(self, name, username, password, url):
"""Initialize the iAlarm status."""
from pyialarm import IAlarm
self._name = name
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 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
else:
state = None
self._state = state
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._client.disarm()
def alarm_arm_away(self, code=None):
"""Send arm away command."""
self._client.arm_away()
def alarm_arm_home(self, code=None):
"""Send arm home command."""
self._client.arm_stay()

View File

@@ -0,0 +1,175 @@
"""
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_devices, 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_devices([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
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
return 'Number'
return 'Any'
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

@@ -4,78 +4,157 @@ 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
import homeassistant.util.dt as dt_util
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED, CONF_PLATFORM, CONF_NAME,
CONF_CODE, CONF_PENDING_TIME, CONF_TRIGGER_TIME, CONF_DISARM_AFTER_TRIGGER)
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
DEFAULT_ALARM_NAME = 'HA Alarm'
DEFAULT_PENDING_TIME = 60
DEFAULT_TRIGGER_TIME = 120
DEFAULT_DISARM_AFTER_TRIGGER = False
PLATFORM_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): 'manual',
vol.Optional(CONF_NAME, default=DEFAULT_ALARM_NAME): cv.string,
vol.Optional(CONF_CODE): cv.string,
vol.Optional(CONF_PENDING_TIME, default=DEFAULT_PENDING_TIME):
vol.All(vol.Coerce(int), vol.Range(min=0)),
vol.Optional(CONF_TRIGGER_TIME, default=DEFAULT_TRIGGER_TIME):
vol.All(vol.Coerce(int), vol.Range(min=1)),
vol.Optional(CONF_DISARM_AFTER_TRIGGER,
default=DEFAULT_DISARM_AFTER_TRIGGER): cv.boolean,
})
import homeassistant.util.dt as dt_util
_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_devices, discovery_info=None):
"""Setup the manual alarm platform."""
"""Set up the manual alarm platform."""
add_devices([ManualAlarm(
hass,
config[CONF_NAME],
config.get(CONF_CODE),
config.get(CONF_PENDING_TIME, DEFAULT_PENDING_TIME),
config.get(CONF_TRIGGER_TIME, DEFAULT_TRIGGER_TIME),
config.get(CONF_DISARM_AFTER_TRIGGER, DEFAULT_DISARM_AFTER_TRIGGER)
config.get(CONF_CODE_TEMPLATE),
config.get(CONF_DISARM_AFTER_TRIGGER, DEFAULT_DISARM_AFTER_TRIGGER),
config
)])
class ManualAlarm(alarm.AlarmControlPanel):
"""
Represents an alarm status.
Representation of an alarm status.
When armed, will be pending for 'pending_time', after that armed.
When triggered, will be pending for 'trigger_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.
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, pending_time,
trigger_time, disarm_after_trigger):
"""Initalize the manual alarm panel."""
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
self._code = str(code) if code else None
self._pending_time = datetime.timedelta(seconds=pending_time)
self._trigger_time = datetime.timedelta(seconds=trigger_time)
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._pre_trigger_state = self._state
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):
"""No polling needed."""
"""Return the polling state."""
return False
@property
@@ -86,28 +165,49 @@ class ManualAlarm(alarm.AlarmControlPanel):
@property
def state(self):
"""Return the state of the device."""
if self._state in (STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY) and \
self._pending_time and self._state_ts + self._pending_time > \
dt_util.utcnow():
return STATE_ALARM_PENDING
if self._state == STATE_ALARM_TRIGGERED and self._trigger_time:
if self._state_ts + self._pending_time > dt_util.utcnow():
if self._state == STATE_ALARM_TRIGGERED:
if self._within_pending_time(self._state):
return STATE_ALARM_PENDING
elif (self._state_ts + self._pending_time +
self._trigger_time) < dt_util.utcnow():
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
else:
return self._pre_trigger_state
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):
"""One or more characters."""
return None if self._code is None else '.+'
"""Return one or more digits/characters."""
if self._code is None:
return None
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
return 'Number'
return 'Any'
def alarm_disarm(self, code=None):
"""Send disarm command."""
@@ -123,48 +223,86 @@ class ManualAlarm(alarm.AlarmControlPanel):
if not self._validate_code(code, STATE_ALARM_ARMED_HOME):
return
self._state = STATE_ALARM_ARMED_HOME
self._state_ts = dt_util.utcnow()
self.schedule_update_ha_state()
if self._pending_time:
track_point_in_time(
self._hass, self.async_update_ha_state,
self._state_ts + self._pending_time)
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._state = STATE_ALARM_ARMED_AWAY
self._state_ts = dt_util.utcnow()
self.schedule_update_ha_state()
self._update_state(STATE_ALARM_ARMED_AWAY)
if self._pending_time:
track_point_in_time(
self._hass, self.async_update_ha_state,
self._state_ts + self._pending_time)
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."""
self._pre_trigger_state = self._state
self._state = STATE_ALARM_TRIGGERED
"""
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()
if self._trigger_time:
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 + self._pending_time)
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 + self._pending_time + self._trigger_time)
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."""
check = self._code is None or code == self._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)
_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

View File

@@ -0,0 +1,370 @@
"""
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 asyncio
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)
import homeassistant.components.mqtt as 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_devices, discovery_info=None):
"""Set up the manual MQTT alarm platform."""
add_devices([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
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
return 'Number'
return 'Any'
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
def async_added_to_hass(self):
"""Subscribe to MQTT events.
This method must be run in the event loop and returns a coroutine.
"""
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
return mqtt.async_subscribe(
self.hass, self._command_topic, message_received, self._qos)
@asyncio.coroutine
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

@@ -6,6 +6,7 @@ https://home-assistant.io/components/alarm_control_panel.mqtt/
"""
import asyncio
import logging
import re
import voluptuous as vol
@@ -17,7 +18,9 @@ from homeassistant.const import (
STATE_ALARM_PENDING, STATE_ALARM_TRIGGERED, STATE_UNKNOWN,
CONF_NAME, CONF_CODE)
from homeassistant.components.mqtt import (
CONF_STATE_TOPIC, CONF_COMMAND_TOPIC, CONF_QOS)
CONF_AVAILABILITY_TOPIC, CONF_STATE_TOPIC, CONF_COMMAND_TOPIC,
CONF_PAYLOAD_AVAILABLE, CONF_PAYLOAD_NOT_AVAILABLE, CONF_QOS,
CONF_RETAIN, MqttAvailability)
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
@@ -40,56 +43,64 @@ PLATFORM_SCHEMA = mqtt.MQTT_BASE_PLATFORM_SCHEMA.extend({
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_DISARM, default=DEFAULT_DISARM): cv.string,
})
}).extend(mqtt.MQTT_AVAILABILITY_SCHEMA.schema)
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Setup the MQTT platform."""
"""Set up the MQTT Alarm Control Panel platform."""
async_add_devices([MqttAlarm(
config.get(CONF_NAME),
config.get(CONF_STATE_TOPIC),
config.get(CONF_COMMAND_TOPIC),
config.get(CONF_QOS),
config.get(CONF_RETAIN),
config.get(CONF_PAYLOAD_DISARM),
config.get(CONF_PAYLOAD_ARM_HOME),
config.get(CONF_PAYLOAD_ARM_AWAY),
config.get(CONF_CODE))])
config.get(CONF_CODE),
config.get(CONF_AVAILABILITY_TOPIC),
config.get(CONF_PAYLOAD_AVAILABLE),
config.get(CONF_PAYLOAD_NOT_AVAILABLE))])
class MqttAlarm(alarm.AlarmControlPanel):
class MqttAlarm(MqttAvailability, alarm.AlarmControlPanel):
"""Representation of a MQTT alarm status."""
def __init__(self, name, state_topic, command_topic, qos, payload_disarm,
payload_arm_home, payload_arm_away, code):
"""Initalize the MQTT alarm panel."""
def __init__(self, name, state_topic, command_topic, qos, retain,
payload_disarm, payload_arm_home, payload_arm_away, code,
availability_topic, payload_available, payload_not_available):
"""Init the MQTT Alarm Control Panel."""
super().__init__(availability_topic, qos, payload_available,
payload_not_available)
self._state = STATE_UNKNOWN
self._name = name
self._state_topic = state_topic
self._command_topic = command_topic
self._qos = qos
self._retain = retain
self._payload_disarm = payload_disarm
self._payload_arm_home = payload_arm_home
self._payload_arm_away = payload_arm_away
self._code = code
@asyncio.coroutine
def async_added_to_hass(self):
"""Subscribe mqtt events.
"""Subscribe mqtt events."""
yield from super().async_added_to_hass()
This method must be run in the event loop and returns a coroutine.
"""
@callback
def message_received(topic, payload, qos):
"""A new MQTT message has been received."""
"""Run when new MQTT message has been received."""
if payload not in (STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY, STATE_ALARM_PENDING,
STATE_ALARM_TRIGGERED):
_LOGGER.warning('Received unexpected payload: %s', payload)
_LOGGER.warning("Received unexpected payload: %s", payload)
return
self._state = payload
self.hass.async_add_job(self.async_update_ha_state())
self.async_schedule_update_ha_state()
return mqtt.async_subscribe(
yield from mqtt.async_subscribe(
self.hass, self._state_topic, message_received, self._qos)
@property
@@ -109,8 +120,12 @@ class MqttAlarm(alarm.AlarmControlPanel):
@property
def code_format(self):
"""One or more characters if code is defined."""
return None if self._code is None else '.+'
"""Return one or more digits/characters."""
if self._code is None:
return None
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
return 'Number'
return 'Any'
@asyncio.coroutine
def async_alarm_disarm(self, code=None):
@@ -121,7 +136,8 @@ class MqttAlarm(alarm.AlarmControlPanel):
if not self._validate_code(code, 'disarming'):
return
mqtt.async_publish(
self.hass, self._command_topic, self._payload_disarm, self._qos)
self.hass, self._command_topic, self._payload_disarm, self._qos,
self._retain)
@asyncio.coroutine
def async_alarm_arm_home(self, code=None):
@@ -132,7 +148,8 @@ class MqttAlarm(alarm.AlarmControlPanel):
if not self._validate_code(code, 'arming home'):
return
mqtt.async_publish(
self.hass, self._command_topic, self._payload_arm_home, self._qos)
self.hass, self._command_topic, self._payload_arm_home, self._qos,
self._retain)
@asyncio.coroutine
def async_alarm_arm_away(self, code=None):
@@ -143,7 +160,8 @@ class MqttAlarm(alarm.AlarmControlPanel):
if not self._validate_code(code, 'arming away'):
return
mqtt.async_publish(
self.hass, self._command_topic, self._payload_arm_away, self._qos)
self.hass, self._command_topic, self._payload_arm_away, self._qos,
self._retain)
def _validate_code(self, code, state):
"""Validate given code."""

View File

@@ -12,8 +12,8 @@ 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 (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN, CONF_NAME, CONF_HOST, CONF_PORT)
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 = ['pynx584==0.4']
@@ -25,14 +25,14 @@ DEFAULT_NAME = 'NX584'
DEFAULT_PORT = 5007
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
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_devices, discovery_info=None):
"""Setup nx584 platform."""
"""Set up the NX584 platform."""
name = config.get(CONF_NAME)
host = config.get(CONF_HOST)
port = config.get(CONF_PORT)
@@ -42,15 +42,15 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
try:
add_devices([NX584Alarm(hass, url, name)])
except requests.exceptions.ConnectionError as ex:
_LOGGER.error('Unable to connect to NX584: %s', str(ex))
_LOGGER.error("Unable to connect to NX584: %s", str(ex))
return False
class NX584Alarm(alarm.AlarmControlPanel):
"""Represents the NX584-based alarm panel."""
"""Representation of a NX584-based alarm panel."""
def __init__(self, hass, url, name):
"""Initalize the nx584 alarm panel."""
"""Init the nx584 alarm panel."""
from nx584 import client
self._hass = hass
self._name = name
@@ -69,8 +69,8 @@ class NX584Alarm(alarm.AlarmControlPanel):
@property
def code_format(self):
"""The characters if code is defined."""
return '[0-9]{4}([0-9]{2})?'
"""Return one or more digits/characters."""
return 'Number'
@property
def state(self):
@@ -83,20 +83,19 @@ class NX584Alarm(alarm.AlarmControlPanel):
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',
_LOGGER.error("Unable to connect to %(host)s: %(reason)s",
dict(host=self._url, reason=ex))
self._state = STATE_UNKNOWN
zones = []
except IndexError:
_LOGGER.error('nx584 reports no partitions')
_LOGGER.error("NX584 reports no partitions")
self._state = STATE_UNKNOWN
zones = []
bypassed = False
for zone in zones:
if zone['bypassed']:
_LOGGER.debug('Zone %(zone)s is bypassed, '
'assuming HOME',
_LOGGER.debug("Zone %(zone)s is bypassed, assuming HOME",
dict(zone=zone['number']))
bypassed = True
break

View File

@@ -0,0 +1,93 @@
"""
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 asyncio
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']
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, 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_devices([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
@asyncio.coroutine
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 'Number'
@property
def state(self):
"""Return the state of the device."""
return self._state
@asyncio.coroutine
def async_alarm_disarm(self, code=None):
"""Send disarm command."""
if code:
yield from self.hass.data[DATA_SATEL].disarm(code)
@asyncio.coroutine
def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
if code:
yield from self.hass.data[DATA_SATEL].arm(code)
@asyncio.coroutine
def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
if code:
yield from self.hass.data[DATA_SATEL].arm(
code, self._arm_home_mode)

View File

@@ -1,54 +1,81 @@
alarm_disarm:
description: Send the alarm the command for disarm
fields:
entity_id:
description: Name of alarm control panel to disarm
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to disarm the alarm control panel with
example: 1234
alarm_arm_home:
description: Send the alarm the command for arm home
fields:
entity_id:
description: Name of alarm control panel to arm home
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to arm home the alarm control panel with
example: 1234
alarm_arm_away:
description: Send the alarm the command for arm away
fields:
entity_id:
description: Name of alarm control panel to arm away
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to arm away the alarm control panel with
example: 1234
alarm_trigger:
description: Send the alarm the command for trigger
fields:
entity_id:
description: Name of alarm control panel to trigger
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to trigger the alarm control panel with
example: 1234
envisalink_alarm_keypress:
description: Send custom keypresses to the alarm
fields:
entity_id:
description: Name of the alarm control panel to trigger
example: 'alarm_control_panel.downstairs'
keypress:
description: 'String to send to the alarm panel (1-6 characters)'
example: '*71'
# Describes the format for available alarm control panel services
alarm_disarm:
description: Send the alarm the command for disarm.
fields:
entity_id:
description: Name of alarm control panel to disarm.
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to disarm the alarm control panel with.
example: 1234
alarm_arm_home:
description: Send the alarm the command for arm home.
fields:
entity_id:
description: Name of alarm control panel to arm home.
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to arm home the alarm control panel with.
example: 1234
alarm_arm_away:
description: Send the alarm the command for arm away.
fields:
entity_id:
description: Name of alarm control panel to arm away.
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to arm away the alarm control panel with.
example: 1234
alarm_arm_night:
description: Send the alarm the command for arm night.
fields:
entity_id:
description: Name of alarm control panel to arm night.
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to arm night the alarm control panel with.
example: 1234
alarm_trigger:
description: Send the alarm the command for trigger.
fields:
entity_id:
description: Name of alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to trigger the alarm control panel with.
example: 1234
envisalink_alarm_keypress:
description: Send custom keypresses to the alarm.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
keypress:
description: 'String to send to the alarm panel (1-6 characters).'
example: '*71'
alarmdecoder_alarm_toggle_chime:
description: Send the alarm the toggle chime command.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
code:
description: A required code to toggle the alarm control panel chime with.
example: 1234
ifttt_push_alarm_state:
description: Update the alarm state to the specified value.
fields:
entity_id:
description: Name of the alarm control panel which state has to be updated.
example: 'alarm_control_panel.downstairs'
state:
description: The state to which the alarm control panel has to be set.
example: 'armed_night'

View File

@@ -5,24 +5,25 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.simplisafe/
"""
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_PASSWORD, CONF_USERNAME, STATE_UNKNOWN, CONF_CODE, CONF_NAME,
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY,
EVENT_HOMEASSISTANT_STOP)
CONF_CODE, CONF_NAME, CONF_PASSWORD, CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED, STATE_UNKNOWN)
import homeassistant.helpers.config_validation as cv
import homeassistant.loader as loader
REQUIREMENTS = ['simplisafe-python==1.0.2']
REQUIREMENTS = ['simplisafe-python==1.0.5']
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'SimpliSafe'
DOMAIN = 'simplisafe'
NOTIFICATION_ID = 'simplisafe_notification'
NOTIFICATION_TITLE = 'SimpliSafe Setup'
@@ -42,7 +43,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)
persistent_notification = loader.get_component('persistent_notification')
simplisafe = SimpliSafeApiInterface()
status = simplisafe.set_credentials(username, password)
if status:
@@ -53,8 +53,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
else:
message = 'Failed to log into SimpliSafe. Check credentials.'
_LOGGER.error(message)
persistent_notification.create(
hass, message,
hass.components.persistent_notification.create(
message,
title=NOTIFICATION_TITLE,
notification_id=NOTIFICATION_ID)
return False
@@ -67,7 +67,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class SimpliSafeAlarm(alarm.AlarmControlPanel):
"""Representation a SimpliSafe alarm."""
"""Representation of a SimpliSafe alarm."""
def __init__(self, simplisafe, name, code):
"""Initialize the SimpliSafe alarm."""
@@ -80,23 +80,26 @@ class SimpliSafeAlarm(alarm.AlarmControlPanel):
"""Return the name of the device."""
if self._name is not None:
return self._name
else:
return 'Alarm {}'.format(self.simplisafe.location_id())
return 'Alarm {}'.format(self.simplisafe.location_id())
@property
def code_format(self):
"""One or more characters if code is defined."""
return None if self._code is None else '.+'
"""Return one or more digits/characters."""
if self._code is None:
return None
elif isinstance(self._code, str) and re.search('^\\d+$', self._code):
return 'Number'
return 'Any'
@property
def state(self):
"""Return the state of the device."""
status = self.simplisafe.state()
if status == 'Off':
if status == 'off':
state = STATE_ALARM_DISARMED
elif status == 'Home':
elif status == 'home':
state = STATE_ALARM_ARMED_HOME
elif status == 'Away':
elif status == 'away':
state = STATE_ALARM_ARMED_AWAY
else:
state = STATE_UNKNOWN
@@ -106,12 +109,12 @@ class SimpliSafeAlarm(alarm.AlarmControlPanel):
def device_state_attributes(self):
"""Return the state attributes."""
return {
'temperature': self.simplisafe.temperature(),
'alarm': self.simplisafe.alarm(),
'co': self.simplisafe.carbon_monoxide(),
'fire': self.simplisafe.fire(),
'alarm': self.simplisafe.alarm(),
'flood': self.simplisafe.flood(),
'last_event': self.simplisafe.last_event(),
'flood': self.simplisafe.flood()
'temperature': self.simplisafe.temperature(),
}
def update(self):
@@ -123,25 +126,25 @@ class SimpliSafeAlarm(alarm.AlarmControlPanel):
if not self._validate_code(code, 'disarming'):
return
self.simplisafe.set_state('off')
_LOGGER.info('SimpliSafe alarm disarming')
_LOGGER.info("SimpliSafe alarm disarming")
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if not self._validate_code(code, 'arming home'):
return
self.simplisafe.set_state('home')
_LOGGER.info('SimpliSafe alarm arming home')
_LOGGER.info("SimpliSafe alarm arming home")
def alarm_arm_away(self, code=None):
"""Send arm away command."""
if not self._validate_code(code, 'arming away'):
return
self.simplisafe.set_state('away')
_LOGGER.info('SimpliSafe alarm arming away')
_LOGGER.info("SimpliSafe alarm arming away")
def _validate_code(self, code, state):
"""Validate given code."""
check = self._code is None or code == self._code
if not check:
_LOGGER.warning('Wrong code entered for %s', state)
_LOGGER.warning("Wrong code entered for %s", state)
return check

View File

@@ -0,0 +1,108 @@
"""
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 asyncio
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.spc import (
ATTR_DISCOVER_AREAS, DATA_API, DATA_REGISTRY, SpcWebGateway)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN)
_LOGGER = logging.getLogger(__name__)
SPC_AREA_MODE_TO_STATE = {
'0': STATE_ALARM_DISARMED,
'1': STATE_ALARM_ARMED_HOME,
'3': STATE_ALARM_ARMED_AWAY,
}
def _get_alarm_state(spc_mode):
"""Get the alarm state."""
return SPC_AREA_MODE_TO_STATE.get(spc_mode, STATE_UNKNOWN)
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Set up the SPC alarm control panel platform."""
if (discovery_info is None or
discovery_info[ATTR_DISCOVER_AREAS] is None):
return
api = hass.data[DATA_API]
devices = [SpcAlarm(api, area)
for area in discovery_info[ATTR_DISCOVER_AREAS]]
async_add_devices(devices)
class SpcAlarm(alarm.AlarmControlPanel):
"""Representation of the SPC alarm panel."""
def __init__(self, api, area):
"""Initialize the SPC alarm panel."""
self._area_id = area['id']
self._name = area['name']
self._state = _get_alarm_state(area['mode'])
if self._state == STATE_ALARM_DISARMED:
self._changed_by = area.get('last_unset_user_name', 'unknown')
else:
self._changed_by = area.get('last_set_user_name', 'unknown')
self._api = api
@asyncio.coroutine
def async_added_to_hass(self):
"""Call for adding new entities."""
self.hass.data[DATA_REGISTRY].register_alarm_device(
self._area_id, self)
@asyncio.coroutine
def async_update_from_spc(self, state, extra):
"""Update the alarm panel with a new state."""
self._state = state
self._changed_by = extra.get('changed_by', 'unknown')
self.async_schedule_update_ha_state()
@property
def should_poll(self):
"""No polling needed."""
return False
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def changed_by(self):
"""Return the user the last change was triggered by."""
return self._changed_by
@property
def state(self):
"""Return the state of the device."""
return self._state
@asyncio.coroutine
def async_alarm_disarm(self, code=None):
"""Send disarm command."""
yield from self._api.send_area_command(
self._area_id, SpcWebGateway.AREA_COMMAND_UNSET)
@asyncio.coroutine
def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
yield from self._api.send_area_command(
self._area_id, SpcWebGateway.AREA_COMMAND_PART_SET)
@asyncio.coroutine
def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
yield from self._api.send_area_command(
self._area_id, SpcWebGateway.AREA_COMMAND_SET)

View File

@@ -0,0 +1,106 @@
"""
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.18']
_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_devices, 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_devices([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

@@ -5,10 +5,11 @@ 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.components.verisure import (CONF_ALARM, CONF_CODE_DIGITS)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_DISARMED,
STATE_UNKNOWN)
@@ -17,23 +18,32 @@ _LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the Verisure platform."""
"""Set up the Verisure platform."""
alarms = []
if int(hub.config.get(CONF_ALARM, 1)):
hub.update_alarms()
alarms.extend([
VerisureAlarm(value.id)
for value in hub.alarm_status.values()
])
hub.update_overview()
alarms.append(VerisureAlarm())
add_devices(alarms)
class VerisureAlarm(alarm.AlarmControlPanel):
"""Represent a Verisure alarm status."""
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)
def __init__(self, device_id):
"""Initalize the Verisure alarm panel."""
self._id = device_id
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
@@ -41,58 +51,45 @@ class VerisureAlarm(alarm.AlarmControlPanel):
@property
def name(self):
"""Return the name of the device."""
return 'Alarm {}'.format(self._id)
return '{} alarm'.format(hub.session.installations[0]['alias'])
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def available(self):
"""Return True if entity is available."""
return hub.available
@property
def code_format(self):
"""The code format as regex."""
return '^\\d{%s}$' % self._digits
"""Return one or more digits/characters."""
return 'Number'
@property
def changed_by(self):
"""Last change triggered by."""
"""Return the last change triggered by."""
return self._changed_by
def update(self):
"""Update alarm status."""
hub.update_alarms()
if hub.alarm_status[self._id].status == 'unarmed':
hub.update_overview()
status = hub.get_first("$.armState.statusType")
if status == 'DISARMED':
self._state = STATE_ALARM_DISARMED
elif hub.alarm_status[self._id].status == 'armedhome':
elif status == 'ARMED_HOME':
self._state = STATE_ALARM_ARMED_HOME
elif hub.alarm_status[self._id].status == 'armed':
elif status == 'ARMED_AWAY':
self._state = STATE_ALARM_ARMED_AWAY
elif hub.alarm_status[self._id].status != 'pending':
_LOGGER.error(
'Unknown alarm state %s',
hub.alarm_status[self._id].status)
self._changed_by = hub.alarm_status[self._id].name
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."""
hub.my_pages.alarm.set(code, 'DISARMED')
_LOGGER.info('verisure alarm disarming')
hub.my_pages.alarm.wait_while_pending()
set_arm_state('DISARMED', code)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
hub.my_pages.alarm.set(code, 'ARMED_HOME')
_LOGGER.info('verisure alarm arming home')
hub.my_pages.alarm.wait_while_pending()
set_arm_state('ARMED_HOME', code)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
hub.my_pages.alarm.set(code, 'ARMED_AWAY')
_LOGGER.info('verisure alarm arming away')
hub.my_pages.alarm.wait_while_pending()
set_arm_state('ARMED_AWAY', code)

View File

@@ -4,23 +4,24 @@ 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 asyncio
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (STATE_UNKNOWN,
STATE_ALARM_DISARMED,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_AWAY)
from homeassistant.components.wink import WinkDevice, DOMAIN
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_devices, discovery_info=None):
"""Setup the Wink platform."""
"""Set up the Wink platform."""
import pywink
for camera in pywink.get_cameras():
@@ -37,9 +38,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class WinkCameraDevice(WinkDevice, alarm.AlarmControlPanel):
"""Representation a Wink camera alarm."""
def __init__(self, wink, hass):
"""Initialize the Wink alarm."""
super().__init__(wink, hass)
@asyncio.coroutine
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):

View File

@@ -0,0 +1,190 @@
"""
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_RFID = 'rfid'
CONF_ZONES = 'zones'
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'
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})
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)
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
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

View File

@@ -7,12 +7,10 @@ https://home-assistant.io/components/alert/
import asyncio
from datetime import datetime, timedelta
import logging
import os
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.config import load_yaml_config_file
from homeassistant.const import (
CONF_ENTITY_ID, STATE_IDLE, CONF_NAME, CONF_STATE, STATE_ON, STATE_OFF,
SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE, ATTR_ENTITY_ID)
@@ -25,6 +23,7 @@ _LOGGER = logging.getLogger(__name__)
DOMAIN = 'alert'
ENTITY_ID_FORMAT = DOMAIN + '.{}'
CONF_DONE_MESSAGE = 'done_message'
CONF_CAN_ACK = 'can_acknowledge'
CONF_NOTIFIERS = 'notifiers'
CONF_REPEAT = 'repeat'
@@ -35,6 +34,7 @@ DEFAULT_SKIP_FIRST = False
ALERT_SCHEMA = vol.Schema({
vol.Required(CONF_NAME): cv.string,
vol.Optional(CONF_DONE_MESSAGE): cv.string,
vol.Required(CONF_ENTITY_ID): cv.entity_id,
vol.Required(CONF_STATE, default=STATE_ON): cv.string,
vol.Required(CONF_REPEAT): vol.All(cv.ensure_list, [vol.Coerce(float)]),
@@ -121,28 +121,22 @@ def async_setup(hass, config):
# Setup alerts
for entity_id, alert in alerts.items():
entity = Alert(hass, entity_id,
alert[CONF_NAME], alert[CONF_ENTITY_ID],
alert[CONF_STATE], alert[CONF_REPEAT],
alert[CONF_SKIP_FIRST], alert[CONF_NOTIFIERS],
alert[CONF_CAN_ACK])
alert[CONF_NAME], alert.get(CONF_DONE_MESSAGE),
alert[CONF_ENTITY_ID], alert[CONF_STATE],
alert[CONF_REPEAT], alert[CONF_SKIP_FIRST],
alert[CONF_NOTIFIERS], alert[CONF_CAN_ACK])
all_alerts[entity.entity_id] = entity
# Read descriptions
descriptions = yield from hass.loop.run_in_executor(
None, load_yaml_config_file, os.path.join(
os.path.dirname(__file__), 'services.yaml'))
descriptions = descriptions.get(DOMAIN, {})
# Setup service calls
hass.services.async_register(
DOMAIN, SERVICE_TURN_OFF, async_handle_alert_service,
descriptions.get(SERVICE_TURN_OFF), schema=ALERT_SERVICE_SCHEMA)
schema=ALERT_SERVICE_SCHEMA)
hass.services.async_register(
DOMAIN, SERVICE_TURN_ON, async_handle_alert_service,
descriptions.get(SERVICE_TURN_ON), schema=ALERT_SERVICE_SCHEMA)
schema=ALERT_SERVICE_SCHEMA)
hass.services.async_register(
DOMAIN, SERVICE_TOGGLE, async_handle_alert_service,
descriptions.get(SERVICE_TOGGLE), schema=ALERT_SERVICE_SCHEMA)
schema=ALERT_SERVICE_SCHEMA)
tasks = [alert.async_update_ha_state() for alert in all_alerts.values()]
if tasks:
@@ -154,8 +148,8 @@ def async_setup(hass, config):
class Alert(ToggleEntity):
"""Representation of an alert."""
def __init__(self, hass, entity_id, name, watched_entity_id, state,
repeat, skip_first, notifiers, can_ack):
def __init__(self, hass, entity_id, name, done_message, watched_entity_id,
state, repeat, skip_first, notifiers, can_ack):
"""Initialize the alert."""
self.hass = hass
self._name = name
@@ -163,6 +157,7 @@ class Alert(ToggleEntity):
self._skip_first = skip_first
self._notifiers = notifiers
self._can_ack = can_ack
self._done_message = done_message
self._delay = [timedelta(minutes=val) for val in repeat]
self._next_delay = 0
@@ -170,6 +165,7 @@ class Alert(ToggleEntity):
self._firing = False
self._ack = False
self._cancel = None
self._send_done_message = False
self.entity_id = ENTITY_ID_FORMAT.format(entity_id)
event.async_track_state_change(
@@ -230,6 +226,8 @@ class Alert(ToggleEntity):
self._cancel()
self._ack = False
self._firing = False
if self._done_message and self._send_done_message:
yield from self._notify_done_message()
self.hass.async_add_job(self.async_update_ha_state)
@asyncio.coroutine
@@ -249,27 +247,37 @@ class Alert(ToggleEntity):
if not self._ack:
_LOGGER.info("Alerting: %s", self._name)
self._send_done_message = True
for target in self._notifiers:
yield from self.hass.services.async_call(
'notify', target, {'message': self._name})
yield from self._schedule_notify()
@asyncio.coroutine
def async_turn_on(self):
def _notify_done_message(self, *args):
"""Send notification of complete alert."""
_LOGGER.info("Alerting: %s", self._done_message)
self._send_done_message = False
for target in self._notifiers:
yield from self.hass.services.async_call(
'notify', target, {'message': self._done_message})
@asyncio.coroutine
def async_turn_on(self, **kwargs):
"""Async Unacknowledge alert."""
_LOGGER.debug("Reset Alert: %s", self._name)
self._ack = False
yield from self.async_update_ha_state()
@asyncio.coroutine
def async_turn_off(self):
def async_turn_off(self, **kwargs):
"""Async Acknowledge alert."""
_LOGGER.debug("Acknowledged Alert: %s", self._name)
self._ack = True
yield from self.async_update_ha_state()
@asyncio.coroutine
def async_toggle(self):
def async_toggle(self, **kwargs):
"""Async toggle alert."""
if self._ack:
return self.async_turn_on()

View File

@@ -1,341 +0,0 @@
"""
Support for Alexa skill service end point.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alexa/
"""
import asyncio
import copy
import enum
import logging
import uuid
from datetime import datetime
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import HTTP_BAD_REQUEST
from homeassistant.helpers import template, script, config_validation as cv
from homeassistant.components.http import HomeAssistantView
import homeassistant.util.dt as dt_util
_LOGGER = logging.getLogger(__name__)
INTENTS_API_ENDPOINT = '/api/alexa'
FLASH_BRIEFINGS_API_ENDPOINT = '/api/alexa/flash_briefings/{briefing_id}'
CONF_ACTION = 'action'
CONF_CARD = 'card'
CONF_INTENTS = 'intents'
CONF_SPEECH = 'speech'
CONF_TYPE = 'type'
CONF_TITLE = 'title'
CONF_CONTENT = 'content'
CONF_TEXT = 'text'
CONF_FLASH_BRIEFINGS = 'flash_briefings'
CONF_UID = 'uid'
CONF_DATE = 'date'
CONF_TITLE = 'title'
CONF_AUDIO = 'audio'
CONF_TEXT = 'text'
CONF_DISPLAY_URL = 'display_url'
ATTR_UID = 'uid'
ATTR_UPDATE_DATE = 'updateDate'
ATTR_TITLE_TEXT = 'titleText'
ATTR_STREAM_URL = 'streamUrl'
ATTR_MAIN_TEXT = 'mainText'
ATTR_REDIRECTION_URL = 'redirectionURL'
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.0Z'
DOMAIN = 'alexa'
DEPENDENCIES = ['http']
class SpeechType(enum.Enum):
"""The Alexa speech types."""
plaintext = "PlainText"
ssml = "SSML"
class CardType(enum.Enum):
"""The Alexa card types."""
simple = "Simple"
link_account = "LinkAccount"
CONFIG_SCHEMA = vol.Schema({
DOMAIN: {
CONF_INTENTS: {
cv.string: {
vol.Optional(CONF_ACTION): cv.SCRIPT_SCHEMA,
vol.Optional(CONF_CARD): {
vol.Required(CONF_TYPE): cv.enum(CardType),
vol.Required(CONF_TITLE): cv.template,
vol.Required(CONF_CONTENT): cv.template,
},
vol.Optional(CONF_SPEECH): {
vol.Required(CONF_TYPE): cv.enum(SpeechType),
vol.Required(CONF_TEXT): cv.template,
}
}
},
CONF_FLASH_BRIEFINGS: {
cv.string: vol.All(cv.ensure_list, [{
vol.Required(CONF_UID, default=str(uuid.uuid4())): cv.string,
vol.Optional(CONF_DATE, default=datetime.utcnow()): cv.string,
vol.Required(CONF_TITLE): cv.template,
vol.Optional(CONF_AUDIO): cv.template,
vol.Required(CONF_TEXT, default=""): cv.template,
vol.Optional(CONF_DISPLAY_URL): cv.template,
}]),
}
}
}, extra=vol.ALLOW_EXTRA)
def setup(hass, config):
"""Activate Alexa component."""
intents = config[DOMAIN].get(CONF_INTENTS, {})
flash_briefings = config[DOMAIN].get(CONF_FLASH_BRIEFINGS, {})
hass.http.register_view(AlexaIntentsView(hass, intents))
hass.http.register_view(AlexaFlashBriefingView(hass, flash_briefings))
return True
class AlexaIntentsView(HomeAssistantView):
"""Handle Alexa requests."""
url = INTENTS_API_ENDPOINT
name = 'api:alexa'
def __init__(self, hass, intents):
"""Initialize Alexa view."""
super().__init__()
intents = copy.deepcopy(intents)
template.attach(hass, intents)
for name, intent in intents.items():
if CONF_ACTION in intent:
intent[CONF_ACTION] = script.Script(
hass, intent[CONF_ACTION], "Alexa intent {}".format(name))
self.intents = intents
@asyncio.coroutine
def post(self, request):
"""Handle Alexa."""
data = yield from request.json()
_LOGGER.debug('Received Alexa request: %s', data)
req = data.get('request')
if req is None:
_LOGGER.error('Received invalid data from Alexa: %s', data)
return self.json_message('Expected request value not received',
HTTP_BAD_REQUEST)
req_type = req['type']
if req_type == 'SessionEndedRequest':
return None
intent = req.get('intent')
response = AlexaResponse(request.app['hass'], intent)
if req_type == 'LaunchRequest':
response.add_speech(
SpeechType.plaintext,
"Hello, and welcome to the future. How may I help?")
return self.json(response)
if req_type != 'IntentRequest':
_LOGGER.warning('Received unsupported request: %s', req_type)
return self.json_message(
'Received unsupported request: {}'.format(req_type),
HTTP_BAD_REQUEST)
intent_name = intent['name']
config = self.intents.get(intent_name)
if config is None:
_LOGGER.warning('Received unknown intent %s', intent_name)
response.add_speech(
SpeechType.plaintext,
"This intent is not yet configured within Home Assistant.")
return self.json(response)
speech = config.get(CONF_SPEECH)
card = config.get(CONF_CARD)
action = config.get(CONF_ACTION)
if action is not None:
yield from action.async_run(response.variables)
# pylint: disable=unsubscriptable-object
if speech is not None:
response.add_speech(speech[CONF_TYPE], speech[CONF_TEXT])
if card is not None:
response.add_card(card[CONF_TYPE], card[CONF_TITLE],
card[CONF_CONTENT])
return self.json(response)
class AlexaResponse(object):
"""Help generating the response for Alexa."""
def __init__(self, hass, intent=None):
"""Initialize the response."""
self.hass = hass
self.speech = None
self.card = None
self.reprompt = None
self.session_attributes = {}
self.should_end_session = True
self.variables = {}
if intent is not None and 'slots' in intent:
for key, value in intent['slots'].items():
if 'value' in value:
underscored_key = key.replace('.', '_')
self.variables[underscored_key] = value['value']
def add_card(self, card_type, title, content):
"""Add a card to the response."""
assert self.card is None
card = {
"type": card_type.value
}
if card_type == CardType.link_account:
self.card = card
return
card["title"] = title.async_render(self.variables)
card["content"] = content.async_render(self.variables)
self.card = card
def add_speech(self, speech_type, text):
"""Add speech to the response."""
assert self.speech is None
key = 'ssml' if speech_type == SpeechType.ssml else 'text'
if isinstance(text, template.Template):
text = text.async_render(self.variables)
self.speech = {
'type': speech_type.value,
key: text
}
def add_reprompt(self, speech_type, text):
"""Add reprompt if user does not answer."""
assert self.reprompt is None
key = 'ssml' if speech_type == SpeechType.ssml else 'text'
self.reprompt = {
'type': speech_type.value,
key: text.async_render(self.variables)
}
def as_dict(self):
"""Return response in an Alexa valid dict."""
response = {
'shouldEndSession': self.should_end_session
}
if self.card is not None:
response['card'] = self.card
if self.speech is not None:
response['outputSpeech'] = self.speech
if self.reprompt is not None:
response['reprompt'] = {
'outputSpeech': self.reprompt
}
return {
'version': '1.0',
'sessionAttributes': self.session_attributes,
'response': response,
}
class AlexaFlashBriefingView(HomeAssistantView):
"""Handle Alexa Flash Briefing skill requests."""
url = FLASH_BRIEFINGS_API_ENDPOINT
name = 'api:alexa:flash_briefings'
def __init__(self, hass, flash_briefings):
"""Initialize Alexa view."""
super().__init__()
self.flash_briefings = copy.deepcopy(flash_briefings)
template.attach(hass, self.flash_briefings)
@callback
def get(self, request, briefing_id):
"""Handle Alexa Flash Briefing request."""
_LOGGER.debug('Received Alexa flash briefing request for: %s',
briefing_id)
if self.flash_briefings.get(briefing_id) is None:
err = 'No configured Alexa flash briefing was found for: %s'
_LOGGER.error(err, briefing_id)
return b'', 404
briefing = []
for item in self.flash_briefings.get(briefing_id, []):
output = {}
if item.get(CONF_TITLE) is not None:
if isinstance(item.get(CONF_TITLE), template.Template):
output[ATTR_TITLE_TEXT] = item[CONF_TITLE].async_render()
else:
output[ATTR_TITLE_TEXT] = item.get(CONF_TITLE)
if item.get(CONF_TEXT) is not None:
if isinstance(item.get(CONF_TEXT), template.Template):
output[ATTR_MAIN_TEXT] = item[CONF_TEXT].async_render()
else:
output[ATTR_MAIN_TEXT] = item.get(CONF_TEXT)
if item.get(CONF_UID) is not None:
output[ATTR_UID] = item.get(CONF_UID)
if item.get(CONF_AUDIO) is not None:
if isinstance(item.get(CONF_AUDIO), template.Template):
output[ATTR_STREAM_URL] = item[CONF_AUDIO].async_render()
else:
output[ATTR_STREAM_URL] = item.get(CONF_AUDIO)
if item.get(CONF_DISPLAY_URL) is not None:
if isinstance(item.get(CONF_DISPLAY_URL),
template.Template):
output[ATTR_REDIRECTION_URL] = \
item[CONF_DISPLAY_URL].async_render()
else:
output[ATTR_REDIRECTION_URL] = item.get(CONF_DISPLAY_URL)
if isinstance(item[CONF_DATE], str):
item[CONF_DATE] = dt_util.parse_datetime(item[CONF_DATE])
output[ATTR_UPDATE_DATE] = item[CONF_DATE].strftime(DATE_FORMAT)
briefing.append(output)
return self.json(briefing)

View File

@@ -0,0 +1,75 @@
"""
Support for Alexa skill service end point.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alexa/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import entityfilter
from . import flash_briefings, intent, smart_home
from .const import (
CONF_AUDIO, CONF_DISPLAY_URL, CONF_TEXT, CONF_TITLE, CONF_UID, DOMAIN,
CONF_FILTER, CONF_ENTITY_CONFIG)
_LOGGER = logging.getLogger(__name__)
CONF_FLASH_BRIEFINGS = 'flash_briefings'
CONF_SMART_HOME = 'smart_home'
DEPENDENCIES = ['http']
ALEXA_ENTITY_SCHEMA = vol.Schema({
vol.Optional(smart_home.CONF_DESCRIPTION): cv.string,
vol.Optional(smart_home.CONF_DISPLAY_CATEGORIES): cv.string,
vol.Optional(smart_home.CONF_NAME): cv.string,
})
SMART_HOME_SCHEMA = vol.Schema({
vol.Optional(CONF_FILTER, default={}): entityfilter.FILTER_SCHEMA,
vol.Optional(CONF_ENTITY_CONFIG): {cv.entity_id: ALEXA_ENTITY_SCHEMA}
})
CONFIG_SCHEMA = vol.Schema({
DOMAIN: {
CONF_FLASH_BRIEFINGS: {
cv.string: vol.All(cv.ensure_list, [{
vol.Optional(CONF_UID): cv.string,
vol.Required(CONF_TITLE): cv.template,
vol.Optional(CONF_AUDIO): cv.template,
vol.Required(CONF_TEXT, default=""): cv.template,
vol.Optional(CONF_DISPLAY_URL): cv.template,
}]),
},
# vol.Optional here would mean we couldn't distinguish between an empty
# smart_home: and none at all.
CONF_SMART_HOME: vol.Any(SMART_HOME_SCHEMA, None),
}
}, extra=vol.ALLOW_EXTRA)
@asyncio.coroutine
def async_setup(hass, config):
"""Activate Alexa component."""
config = config.get(DOMAIN, {})
flash_briefings_config = config.get(CONF_FLASH_BRIEFINGS)
intent.async_setup(hass)
if flash_briefings_config:
flash_briefings.async_setup(hass, flash_briefings_config)
try:
smart_home_config = config[CONF_SMART_HOME]
except KeyError:
pass
else:
smart_home_config = smart_home_config or SMART_HOME_SCHEMA({})
smart_home.async_setup(hass, smart_home_config)
return True

View File

@@ -0,0 +1,23 @@
"""Constants for the Alexa integration."""
DOMAIN = 'alexa'
# Flash briefing constants
CONF_UID = 'uid'
CONF_TITLE = 'title'
CONF_AUDIO = 'audio'
CONF_TEXT = 'text'
CONF_DISPLAY_URL = 'display_url'
CONF_FILTER = 'filter'
CONF_ENTITY_CONFIG = 'entity_config'
ATTR_UID = 'uid'
ATTR_UPDATE_DATE = 'updateDate'
ATTR_TITLE_TEXT = 'titleText'
ATTR_STREAM_URL = 'streamUrl'
ATTR_MAIN_TEXT = 'mainText'
ATTR_REDIRECTION_URL = 'redirectionURL'
SYN_RESOLUTION_MATCH = 'ER_SUCCESS_MATCH'
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.0Z'

View File

@@ -0,0 +1,95 @@
"""
Support for Alexa skill service end point.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alexa/
"""
import copy
from datetime import datetime
import logging
import uuid
from homeassistant.components import http
from homeassistant.core import callback
from homeassistant.helpers import template
from .const import (
ATTR_MAIN_TEXT, ATTR_REDIRECTION_URL, ATTR_STREAM_URL, ATTR_TITLE_TEXT,
ATTR_UID, ATTR_UPDATE_DATE, CONF_AUDIO, CONF_DISPLAY_URL, CONF_TEXT,
CONF_TITLE, CONF_UID, DATE_FORMAT)
_LOGGER = logging.getLogger(__name__)
FLASH_BRIEFINGS_API_ENDPOINT = '/api/alexa/flash_briefings/{briefing_id}'
@callback
def async_setup(hass, flash_briefing_config):
"""Activate Alexa component."""
hass.http.register_view(
AlexaFlashBriefingView(hass, flash_briefing_config))
class AlexaFlashBriefingView(http.HomeAssistantView):
"""Handle Alexa Flash Briefing skill requests."""
url = FLASH_BRIEFINGS_API_ENDPOINT
name = 'api:alexa:flash_briefings'
def __init__(self, hass, flash_briefings):
"""Initialize Alexa view."""
super().__init__()
self.flash_briefings = copy.deepcopy(flash_briefings)
template.attach(hass, self.flash_briefings)
@callback
def get(self, request, briefing_id):
"""Handle Alexa Flash Briefing request."""
_LOGGER.debug("Received Alexa flash briefing request for: %s",
briefing_id)
if self.flash_briefings.get(briefing_id) is None:
err = "No configured Alexa flash briefing was found for: %s"
_LOGGER.error(err, briefing_id)
return b'', 404
briefing = []
for item in self.flash_briefings.get(briefing_id, []):
output = {}
if item.get(CONF_TITLE) is not None:
if isinstance(item.get(CONF_TITLE), template.Template):
output[ATTR_TITLE_TEXT] = item[CONF_TITLE].async_render()
else:
output[ATTR_TITLE_TEXT] = item.get(CONF_TITLE)
if item.get(CONF_TEXT) is not None:
if isinstance(item.get(CONF_TEXT), template.Template):
output[ATTR_MAIN_TEXT] = item[CONF_TEXT].async_render()
else:
output[ATTR_MAIN_TEXT] = item.get(CONF_TEXT)
uid = item.get(CONF_UID)
if uid is None:
uid = str(uuid.uuid4())
output[ATTR_UID] = uid
if item.get(CONF_AUDIO) is not None:
if isinstance(item.get(CONF_AUDIO), template.Template):
output[ATTR_STREAM_URL] = item[CONF_AUDIO].async_render()
else:
output[ATTR_STREAM_URL] = item.get(CONF_AUDIO)
if item.get(CONF_DISPLAY_URL) is not None:
if isinstance(item.get(CONF_DISPLAY_URL),
template.Template):
output[ATTR_REDIRECTION_URL] = \
item[CONF_DISPLAY_URL].async_render()
else:
output[ATTR_REDIRECTION_URL] = item.get(CONF_DISPLAY_URL)
output[ATTR_UPDATE_DATE] = datetime.now().strftime(DATE_FORMAT)
briefing.append(output)
return self.json(briefing)

View File

@@ -0,0 +1,296 @@
"""
Support for Alexa skill service end point.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/alexa/
"""
import asyncio
import enum
import logging
from homeassistant.components import http
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import intent
from homeassistant.util.decorator import Registry
from .const import DOMAIN, SYN_RESOLUTION_MATCH
_LOGGER = logging.getLogger(__name__)
HANDLERS = Registry()
INTENTS_API_ENDPOINT = '/api/alexa'
class SpeechType(enum.Enum):
"""The Alexa speech types."""
plaintext = 'PlainText'
ssml = 'SSML'
SPEECH_MAPPINGS = {
'plain': SpeechType.plaintext,
'ssml': SpeechType.ssml,
}
class CardType(enum.Enum):
"""The Alexa card types."""
simple = 'Simple'
link_account = 'LinkAccount'
@callback
def async_setup(hass):
"""Activate Alexa component."""
hass.http.register_view(AlexaIntentsView)
class UnknownRequest(HomeAssistantError):
"""When an unknown Alexa request is passed in."""
class AlexaIntentsView(http.HomeAssistantView):
"""Handle Alexa requests."""
url = INTENTS_API_ENDPOINT
name = 'api:alexa'
@asyncio.coroutine
def post(self, request):
"""Handle Alexa."""
hass = request.app['hass']
message = yield from request.json()
_LOGGER.debug("Received Alexa request: %s", message)
try:
response = yield from async_handle_message(hass, message)
return b'' if response is None else self.json(response)
except UnknownRequest as err:
_LOGGER.warning(str(err))
return self.json(intent_error_response(
hass, message, str(err)))
except intent.UnknownIntent as err:
_LOGGER.warning(str(err))
return self.json(intent_error_response(
hass, message,
"This intent is not yet configured within Home Assistant."))
except intent.InvalidSlotInfo as err:
_LOGGER.error("Received invalid slot data from Alexa: %s", err)
return self.json(intent_error_response(
hass, message,
"Invalid slot information received for this intent."))
except intent.IntentError as err:
_LOGGER.exception(str(err))
return self.json(intent_error_response(
hass, message, "Error handling intent."))
def intent_error_response(hass, message, error):
"""Return an Alexa response that will speak the error message."""
alexa_intent_info = message.get('request').get('intent')
alexa_response = AlexaResponse(hass, alexa_intent_info)
alexa_response.add_speech(SpeechType.plaintext, error)
return alexa_response.as_dict()
@asyncio.coroutine
def async_handle_message(hass, message):
"""Handle an Alexa intent.
Raises:
- UnknownRequest
- intent.UnknownIntent
- intent.InvalidSlotInfo
- intent.IntentError
"""
req = message.get('request')
req_type = req['type']
handler = HANDLERS.get(req_type)
if not handler:
raise UnknownRequest('Received unknown request {}'.format(req_type))
return (yield from handler(hass, message))
@HANDLERS.register('SessionEndedRequest')
@asyncio.coroutine
def async_handle_session_end(hass, message):
"""Handle a session end request."""
return None
@HANDLERS.register('IntentRequest')
@HANDLERS.register('LaunchRequest')
@asyncio.coroutine
def async_handle_intent(hass, message):
"""Handle an intent request.
Raises:
- intent.UnknownIntent
- intent.InvalidSlotInfo
- intent.IntentError
"""
req = message.get('request')
alexa_intent_info = req.get('intent')
alexa_response = AlexaResponse(hass, alexa_intent_info)
if req['type'] == 'LaunchRequest':
intent_name = message.get('session', {}) \
.get('application', {}) \
.get('applicationId')
else:
intent_name = alexa_intent_info['name']
intent_response = yield from intent.async_handle(
hass, DOMAIN, intent_name,
{key: {'value': value} for key, value
in alexa_response.variables.items()})
for intent_speech, alexa_speech in SPEECH_MAPPINGS.items():
if intent_speech in intent_response.speech:
alexa_response.add_speech(
alexa_speech,
intent_response.speech[intent_speech]['speech'])
break
if 'simple' in intent_response.card:
alexa_response.add_card(
CardType.simple, intent_response.card['simple']['title'],
intent_response.card['simple']['content'])
return alexa_response.as_dict()
def resolve_slot_synonyms(key, request):
"""Check slot request for synonym resolutions."""
# Default to the spoken slot value if more than one or none are found. For
# reference to the request object structure, see the Alexa docs:
# https://tinyurl.com/ybvm7jhs
resolved_value = request['value']
if ('resolutions' in request and
'resolutionsPerAuthority' in request['resolutions'] and
len(request['resolutions']['resolutionsPerAuthority']) >= 1):
# Extract all of the possible values from each authority with a
# successful match
possible_values = []
for entry in request['resolutions']['resolutionsPerAuthority']:
if entry['status']['code'] != SYN_RESOLUTION_MATCH:
continue
possible_values.extend([item['value']['name']
for item
in entry['values']])
# If there is only one match use the resolved value, otherwise the
# resolution cannot be determined, so use the spoken slot value
if len(possible_values) == 1:
resolved_value = possible_values[0]
else:
_LOGGER.debug(
'Found multiple synonym resolutions for slot value: {%s: %s}',
key,
request['value']
)
return resolved_value
class AlexaResponse(object):
"""Help generating the response for Alexa."""
def __init__(self, hass, intent_info):
"""Initialize the response."""
self.hass = hass
self.speech = None
self.card = None
self.reprompt = None
self.session_attributes = {}
self.should_end_session = True
self.variables = {}
# Intent is None if request was a LaunchRequest or SessionEndedRequest
if intent_info is not None:
for key, value in intent_info.get('slots', {}).items():
# Only include slots with values
if 'value' not in value:
continue
_key = key.replace('.', '_')
self.variables[_key] = resolve_slot_synonyms(key, value)
def add_card(self, card_type, title, content):
"""Add a card to the response."""
assert self.card is None
card = {
"type": card_type.value
}
if card_type == CardType.link_account:
self.card = card
return
card["title"] = title
card["content"] = content
self.card = card
def add_speech(self, speech_type, text):
"""Add speech to the response."""
assert self.speech is None
key = 'ssml' if speech_type == SpeechType.ssml else 'text'
self.speech = {
'type': speech_type.value,
key: text
}
def add_reprompt(self, speech_type, text):
"""Add reprompt if user does not answer."""
assert self.reprompt is None
key = 'ssml' if speech_type == SpeechType.ssml else 'text'
self.reprompt = {
'type': speech_type.value,
key: text.async_render(self.variables)
}
def as_dict(self):
"""Return response in an Alexa valid dict."""
response = {
'shouldEndSession': self.should_end_session
}
if self.card is not None:
response['card'] = self.card
if self.speech is not None:
response['outputSpeech'] = self.speech
if self.reprompt is not None:
response['reprompt'] = {
'outputSpeech': self.reprompt
}
return {
'version': '1.0',
'sessionAttributes': self.session_attributes,
'response': response,
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,178 @@
"""
This component provides basic support for Amcrest IP cameras.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/amcrest/
"""
import logging
from datetime import timedelta
import aiohttp
import voluptuous as vol
from requests.exceptions import HTTPError, ConnectTimeout
from requests.exceptions import ConnectionError as ConnectError
from homeassistant.const import (
CONF_NAME, CONF_HOST, CONF_PORT, CONF_USERNAME, CONF_PASSWORD,
CONF_SENSORS, CONF_SWITCHES, CONF_SCAN_INTERVAL, HTTP_BASIC_AUTHENTICATION)
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['amcrest==1.2.3']
DEPENDENCIES = ['ffmpeg']
_LOGGER = logging.getLogger(__name__)
CONF_AUTHENTICATION = 'authentication'
CONF_RESOLUTION = 'resolution'
CONF_STREAM_SOURCE = 'stream_source'
CONF_FFMPEG_ARGUMENTS = 'ffmpeg_arguments'
DEFAULT_NAME = 'Amcrest Camera'
DEFAULT_PORT = 80
DEFAULT_RESOLUTION = 'high'
DEFAULT_STREAM_SOURCE = 'snapshot'
TIMEOUT = 10
DATA_AMCREST = 'amcrest'
DOMAIN = 'amcrest'
NOTIFICATION_ID = 'amcrest_notification'
NOTIFICATION_TITLE = 'Amcrest Camera Setup'
RESOLUTION_LIST = {
'high': 0,
'low': 1,
}
SCAN_INTERVAL = timedelta(seconds=10)
AUTHENTICATION_LIST = {
'basic': 'basic'
}
STREAM_SOURCE_LIST = {
'mjpeg': 0,
'snapshot': 1,
'rtsp': 2,
}
# Sensor types are defined like: Name, units, icon
SENSORS = {
'motion_detector': ['Motion Detected', None, 'mdi:run'],
'sdcard': ['SD Used', '%', 'mdi:sd'],
'ptz_preset': ['PTZ Preset', None, 'mdi:camera-iris'],
}
# Switch types are defined like: Name, icon
SWITCHES = {
'motion_detection': ['Motion Detection', 'mdi:run-fast'],
'motion_recording': ['Motion Recording', 'mdi:record-rec']
}
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.All(cv.ensure_list, [vol.Schema({
vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Optional(CONF_AUTHENTICATION, default=HTTP_BASIC_AUTHENTICATION):
vol.All(vol.In(AUTHENTICATION_LIST)),
vol.Optional(CONF_RESOLUTION, default=DEFAULT_RESOLUTION):
vol.All(vol.In(RESOLUTION_LIST)),
vol.Optional(CONF_STREAM_SOURCE, default=DEFAULT_STREAM_SOURCE):
vol.All(vol.In(STREAM_SOURCE_LIST)),
vol.Optional(CONF_FFMPEG_ARGUMENTS): cv.string,
vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL):
cv.time_period,
vol.Optional(CONF_SENSORS):
vol.All(cv.ensure_list, [vol.In(SENSORS)]),
vol.Optional(CONF_SWITCHES):
vol.All(cv.ensure_list, [vol.In(SWITCHES)]),
})])
}, extra=vol.ALLOW_EXTRA)
def setup(hass, config):
"""Set up the Amcrest IP Camera component."""
from amcrest import AmcrestCamera
hass.data[DATA_AMCREST] = {}
amcrest_cams = config[DOMAIN]
for device in amcrest_cams:
try:
camera = AmcrestCamera(device.get(CONF_HOST),
device.get(CONF_PORT),
device.get(CONF_USERNAME),
device.get(CONF_PASSWORD)).camera
# pylint: disable=pointless-statement
camera.current_time
except (ConnectError, ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Amcrest camera: %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)
continue
ffmpeg_arguments = device.get(CONF_FFMPEG_ARGUMENTS)
name = device.get(CONF_NAME)
resolution = RESOLUTION_LIST[device.get(CONF_RESOLUTION)]
sensors = device.get(CONF_SENSORS)
switches = device.get(CONF_SWITCHES)
stream_source = STREAM_SOURCE_LIST[device.get(CONF_STREAM_SOURCE)]
username = device.get(CONF_USERNAME)
password = device.get(CONF_PASSWORD)
# currently aiohttp only works with basic authentication
# only valid for mjpeg streaming
if username is not None and password is not None:
if device.get(CONF_AUTHENTICATION) == HTTP_BASIC_AUTHENTICATION:
authentication = aiohttp.BasicAuth(username, password)
else:
authentication = None
hass.data[DATA_AMCREST][name] = AmcrestDevice(
camera, name, authentication, ffmpeg_arguments, stream_source,
resolution)
discovery.load_platform(
hass, 'camera', DOMAIN, {
CONF_NAME: name,
}, config)
if sensors:
discovery.load_platform(
hass, 'sensor', DOMAIN, {
CONF_NAME: name,
CONF_SENSORS: sensors,
}, config)
if switches:
discovery.load_platform(
hass, 'switch', DOMAIN, {
CONF_NAME: name,
CONF_SWITCHES: switches
}, config)
return True
class AmcrestDevice(object):
"""Representation of a base Amcrest discovery device."""
def __init__(self, camera, name, authentication, ffmpeg_arguments,
stream_source, resolution):
"""Initialize the entity."""
self.device = camera
self.name = name
self.authentication = authentication
self.ffmpeg_arguments = ffmpeg_arguments
self.stream_source = stream_source
self.resolution = resolution

View File

@@ -26,17 +26,24 @@ from homeassistant.util.dt import utcnow
from homeassistant.components.camera.mjpeg import (
CONF_MJPEG_URL, CONF_STILL_IMAGE_URL)
DOMAIN = 'android_ip_webcam'
REQUIREMENTS = ["pydroid-ipcam==0.6"]
REQUIREMENTS = ['pydroid-ipcam==0.8']
_LOGGER = logging.getLogger(__name__)
SCAN_INTERVAL = timedelta(seconds=10)
DATA_IP_WEBCAM = 'android_ip_webcam'
ATTR_AUD_CONNS = 'Audio Connections'
ATTR_HOST = 'host'
ATTR_VID_CONNS = 'Video Connections'
ATTR_AUD_CONNS = 'Audio Connections'
CONF_MOTION_SENSOR = 'motion_sensor'
DATA_IP_WEBCAM = 'android_ip_webcam'
DEFAULT_NAME = 'IP Webcam'
DEFAULT_PORT = 8080
DEFAULT_TIMEOUT = 10
DOMAIN = 'android_ip_webcam'
SCAN_INTERVAL = timedelta(seconds=10)
SIGNAL_UPDATE_DATA = 'android_ip_webcam_update'
KEY_MAP = {
'audio_connections': 'Audio Connections',
@@ -123,15 +130,6 @@ SENSORS = ['audio_connections', 'battery_level', 'battery_temp',
'battery_voltage', 'light', 'motion', 'pressure', 'proximity',
'sound', 'video_connections']
SIGNAL_UPDATE_DATA = 'android_ip_webcam_update'
CONF_MOTION_SENSOR = 'motion_sensor'
DEFAULT_NAME = 'IP Webcam'
DEFAULT_PORT = 8080
DEFAULT_TIMEOUT = 10
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.All(cv.ensure_list, [vol.Schema({
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
@@ -142,18 +140,18 @@ CONFIG_SCHEMA = vol.Schema({
cv.time_period,
vol.Inclusive(CONF_USERNAME, 'authentication'): cv.string,
vol.Inclusive(CONF_PASSWORD, 'authentication'): cv.string,
vol.Optional(CONF_SWITCHES, default=None):
vol.Optional(CONF_SWITCHES):
vol.All(cv.ensure_list, [vol.In(SWITCHES)]),
vol.Optional(CONF_SENSORS, default=None):
vol.Optional(CONF_SENSORS):
vol.All(cv.ensure_list, [vol.In(SENSORS)]),
vol.Optional(CONF_MOTION_SENSOR, default=None): cv.boolean,
vol.Optional(CONF_MOTION_SENSOR): cv.boolean,
})])
}, extra=vol.ALLOW_EXTRA)
@asyncio.coroutine
def async_setup(hass, config):
"""Setup the IP Webcam component."""
"""Set up the IP Webcam component."""
from pydroid_ipcam import PyDroidIPCam
webcams = hass.data[DATA_IP_WEBCAM] = {}
@@ -161,17 +159,17 @@ def async_setup(hass, config):
@asyncio.coroutine
def async_setup_ipcamera(cam_config):
"""Setup a ip camera."""
"""Set up an IP camera."""
host = cam_config[CONF_HOST]
username = cam_config.get(CONF_USERNAME)
password = cam_config.get(CONF_PASSWORD)
name = cam_config[CONF_NAME]
interval = cam_config[CONF_SCAN_INTERVAL]
switches = cam_config[CONF_SWITCHES]
sensors = cam_config[CONF_SENSORS]
motion = cam_config[CONF_MOTION_SENSOR]
switches = cam_config.get(CONF_SWITCHES)
sensors = cam_config.get(CONF_SENSORS)
motion = cam_config.get(CONF_MOTION_SENSOR)
# init ip webcam
# Init ip webcam
cam = PyDroidIPCam(
hass.loop, websession, host, cam_config[CONF_PORT],
username=username, password=password,
@@ -192,7 +190,7 @@ def async_setup(hass, config):
@asyncio.coroutine
def async_update_data(now):
"""Update data from ipcam in SCAN_INTERVAL."""
"""Update data from IP camera in SCAN_INTERVAL."""
yield from cam.update()
async_dispatcher_send(hass, SIGNAL_UPDATE_DATA, host)
@@ -201,7 +199,7 @@ def async_setup(hass, config):
yield from async_update_data(None)
# load platforms
# Load platforms
webcams[host] = cam
mjpeg_camera = {
@@ -253,7 +251,7 @@ class AndroidIPCamEntity(Entity):
"""The Android device running IP Webcam."""
def __init__(self, host, ipcam):
"""Initialize the data oject."""
"""Initialize the data object."""
self._host = host
self._ipcam = ipcam
@@ -265,7 +263,7 @@ class AndroidIPCamEntity(Entity):
"""Update callback."""
if self._host != host:
return
self.hass.async_add_job(self.async_update_ha_state(True))
self.async_schedule_update_ha_state(True)
async_dispatcher_connect(
self.hass, SIGNAL_UPDATE_DATA, async_ipcam_update)

View File

@@ -13,7 +13,7 @@ from homeassistant.const import (CONF_HOST, CONF_PORT)
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
REQUIREMENTS = ['apcaccess==0.0.4']
REQUIREMENTS = ['apcaccess==0.0.13']
_LOGGER = logging.getLogger(__name__)
@@ -66,7 +66,7 @@ class APCUPSdData(object):
"""
def __init__(self, host, port):
"""Initialize the data oject."""
"""Initialize the data object."""
from apcaccess import status
self._host = host
self._port = port

View File

@@ -2,7 +2,7 @@
Rest API for Home Assistant.
For more details about the RESTful API, please refer to the documentation at
https://home-assistant.io/developers/api/
https://developers.home-assistant.io/docs/en/external_api_rest.html
"""
import asyncio
import json
@@ -11,30 +11,34 @@ import logging
from aiohttp import web
import async_timeout
import homeassistant.core as ha
import homeassistant.remote as rem
from homeassistant.bootstrap import ERROR_LOG_FILENAME
from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP, EVENT_TIME_CHANGED,
HTTP_BAD_REQUEST, HTTP_CREATED, HTTP_NOT_FOUND,
HTTP_UNPROCESSABLE_ENTITY, MATCH_ALL, URL_API, URL_API_COMPONENTS,
URL_API_CONFIG, URL_API_DISCOVERY_INFO, URL_API_ERROR_LOG,
URL_API_EVENT_FORWARD, URL_API_EVENTS, URL_API_SERVICES,
URL_API_STATES, URL_API_STATES_ENTITY, URL_API_STREAM, URL_API_TEMPLATE,
__version__)
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.state import AsyncTrackStates
from homeassistant.helpers import template
from homeassistant.bootstrap import DATA_LOGGING
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP, EVENT_TIME_CHANGED, HTTP_BAD_REQUEST,
HTTP_CREATED, HTTP_NOT_FOUND, MATCH_ALL, URL_API, URL_API_COMPONENTS,
URL_API_CONFIG, URL_API_DISCOVERY_INFO, URL_API_ERROR_LOG, URL_API_EVENTS,
URL_API_SERVICES, URL_API_STATES, URL_API_STATES_ENTITY, URL_API_STREAM,
URL_API_TEMPLATE, __version__)
import homeassistant.core as ha
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import template
from homeassistant.helpers.service import async_get_all_descriptions
from homeassistant.helpers.state import AsyncTrackStates
import homeassistant.remote as rem
_LOGGER = logging.getLogger(__name__)
ATTR_BASE_URL = 'base_url'
ATTR_LOCATION_NAME = 'location_name'
ATTR_REQUIRES_API_PASSWORD = 'requires_api_password'
ATTR_VERSION = 'version'
DOMAIN = 'api'
DEPENDENCIES = ['http']
STREAM_PING_PAYLOAD = "ping"
STREAM_PING_PAYLOAD = 'ping'
STREAM_PING_INTERVAL = 50 # seconds
_LOGGER = logging.getLogger(__name__)
def setup(hass, config):
"""Register the API with the HTTP interface."""
@@ -48,11 +52,12 @@ def setup(hass, config):
hass.http.register_view(APIEventView)
hass.http.register_view(APIServicesView)
hass.http.register_view(APIDomainServicesView)
hass.http.register_view(APIEventForwardingView)
hass.http.register_view(APIComponentsView)
hass.http.register_view(APIErrorLogView)
hass.http.register_view(APITemplateView)
if DATA_LOGGING in hass.data:
hass.http.register_view(APIErrorLog)
return True
@@ -60,34 +65,31 @@ class APIStatusView(HomeAssistantView):
"""View to handle Status requests."""
url = URL_API
name = "api:status"
name = 'api:status'
@ha.callback
def get(self, request):
"""Retrieve if API is running."""
return self.json_message('API running.')
return self.json_message("API running.")
class APIEventStream(HomeAssistantView):
"""View to handle EventStream requests."""
url = URL_API_STREAM
name = "api:stream"
name = 'api:stream'
@asyncio.coroutine
def get(self, request):
async def get(self, request):
"""Provide a streaming interface for the event bus."""
# pylint: disable=no-self-use
hass = request.app['hass']
stop_obj = object()
to_write = asyncio.Queue(loop=hass.loop)
restrict = request.GET.get('restrict')
restrict = request.query.get('restrict')
if restrict:
restrict = restrict.split(',') + [EVENT_HOMEASSISTANT_STOP]
@asyncio.coroutine
def forward_events(event):
async def forward_events(event):
"""Forward events to the open request."""
if event.event_type == EVENT_TIME_CHANGED:
return
@@ -95,57 +97,56 @@ class APIEventStream(HomeAssistantView):
if restrict and event.event_type not in restrict:
return
_LOGGER.debug('STREAM %s FORWARDING %s', id(stop_obj), event)
_LOGGER.debug("STREAM %s FORWARDING %s", id(stop_obj), event)
if event.event_type == EVENT_HOMEASSISTANT_STOP:
data = stop_obj
else:
data = json.dumps(event, cls=rem.JSONEncoder)
yield from to_write.put(data)
await to_write.put(data)
response = web.StreamResponse()
response.content_type = 'text/event-stream'
yield from response.prepare(request)
await response.prepare(request)
unsub_stream = hass.bus.async_listen(MATCH_ALL, forward_events)
try:
_LOGGER.debug('STREAM %s ATTACHED', id(stop_obj))
_LOGGER.debug("STREAM %s ATTACHED", id(stop_obj))
# Fire off one message so browsers fire open event right away
yield from to_write.put(STREAM_PING_PAYLOAD)
await to_write.put(STREAM_PING_PAYLOAD)
while True:
try:
with async_timeout.timeout(STREAM_PING_INTERVAL,
loop=hass.loop):
payload = yield from to_write.get()
payload = await to_write.get()
if payload is stop_obj:
break
msg = "data: {}\n\n".format(payload)
_LOGGER.debug('STREAM %s WRITING %s', id(stop_obj),
msg.strip())
response.write(msg.encode("UTF-8"))
yield from response.drain()
_LOGGER.debug(
"STREAM %s WRITING %s", id(stop_obj), msg.strip())
await response.write(msg.encode('UTF-8'))
except asyncio.TimeoutError:
yield from to_write.put(STREAM_PING_PAYLOAD)
await to_write.put(STREAM_PING_PAYLOAD)
except asyncio.CancelledError:
_LOGGER.debug('STREAM %s ABORT', id(stop_obj))
_LOGGER.debug("STREAM %s ABORT", id(stop_obj))
finally:
_LOGGER.debug('STREAM %s RESPONSE CLOSED', id(stop_obj))
_LOGGER.debug("STREAM %s RESPONSE CLOSED", id(stop_obj))
unsub_stream()
class APIConfigView(HomeAssistantView):
"""View to handle Config requests."""
"""View to handle Configuration requests."""
url = URL_API_CONFIG
name = "api:config"
name = 'api:config'
@ha.callback
def get(self, request):
@@ -154,22 +155,22 @@ class APIConfigView(HomeAssistantView):
class APIDiscoveryView(HomeAssistantView):
"""View to provide discovery info."""
"""View to provide Discovery information."""
requires_auth = False
url = URL_API_DISCOVERY_INFO
name = "api:discovery"
name = 'api:discovery'
@ha.callback
def get(self, request):
"""Get discovery info."""
"""Get discovery information."""
hass = request.app['hass']
needs_auth = hass.config.api.api_password is not None
return self.json({
'base_url': hass.config.api.base_url,
'location_name': hass.config.location_name,
'requires_api_password': needs_auth,
'version': __version__
ATTR_BASE_URL: hass.config.api.base_url,
ATTR_LOCATION_NAME: hass.config.location_name,
ATTR_REQUIRES_API_PASSWORD: needs_auth,
ATTR_VERSION: __version__,
})
@@ -188,8 +189,8 @@ class APIStatesView(HomeAssistantView):
class APIEntityStateView(HomeAssistantView):
"""View to handle EntityState requests."""
url = "/api/states/{entity_id}"
name = "api:entity-state"
url = '/api/states/{entity_id}'
name = 'api:entity-state'
@ha.callback
def get(self, request, entity_id):
@@ -197,23 +198,21 @@ class APIEntityStateView(HomeAssistantView):
state = request.app['hass'].states.get(entity_id)
if state:
return self.json(state)
else:
return self.json_message('Entity not found', HTTP_NOT_FOUND)
return self.json_message("Entity not found.", HTTP_NOT_FOUND)
@asyncio.coroutine
def post(self, request, entity_id):
async def post(self, request, entity_id):
"""Update state of entity."""
hass = request.app['hass']
try:
data = yield from request.json()
data = await request.json()
except ValueError:
return self.json_message('Invalid JSON specified',
HTTP_BAD_REQUEST)
return self.json_message(
"Invalid JSON specified.", HTTP_BAD_REQUEST)
new_state = data.get('state')
if not new_state:
return self.json_message('No state specified', HTTP_BAD_REQUEST)
if new_state is None:
return self.json_message("No state specified.", HTTP_BAD_REQUEST)
attributes = data.get('attributes')
force_update = data.get('force_update', False)
@@ -235,16 +234,15 @@ class APIEntityStateView(HomeAssistantView):
def delete(self, request, entity_id):
"""Remove entity."""
if request.app['hass'].states.async_remove(entity_id):
return self.json_message('Entity removed')
else:
return self.json_message('Entity not found', HTTP_NOT_FOUND)
return self.json_message("Entity removed.")
return self.json_message("Entity not found.", HTTP_NOT_FOUND)
class APIEventListenersView(HomeAssistantView):
"""View to handle EventListeners requests."""
url = URL_API_EVENTS
name = "api:event-listeners"
name = 'api:event-listeners'
@ha.callback
def get(self, request):
@@ -256,17 +254,20 @@ class APIEventView(HomeAssistantView):
"""View to handle Event requests."""
url = '/api/events/{event_type}'
name = "api:event"
name = 'api:event'
@asyncio.coroutine
def post(self, request, event_type):
async def post(self, request, event_type):
"""Fire events."""
body = yield from request.text()
event_data = json.loads(body) if body else None
body = await request.text()
try:
event_data = json.loads(body) if body else None
except ValueError:
return self.json_message(
"Event data should be valid JSON.", HTTP_BAD_REQUEST)
if event_data is not None and not isinstance(event_data, dict):
return self.json_message('Event data should be a JSON object',
HTTP_BAD_REQUEST)
return self.json_message(
"Event data should be a JSON object", HTTP_BAD_REQUEST)
# Special case handling for event STATE_CHANGED
# We will try to convert state dicts back to State objects
@@ -277,8 +278,8 @@ class APIEventView(HomeAssistantView):
if state:
event_data[key] = state
request.app['hass'].bus.async_fire(event_type, event_data,
ha.EventOrigin.remote)
request.app['hass'].bus.async_fire(
event_type, event_data, ha.EventOrigin.remote)
return self.json_message("Event {} fired.".format(event_type))
@@ -287,114 +288,44 @@ class APIServicesView(HomeAssistantView):
"""View to handle Services requests."""
url = URL_API_SERVICES
name = "api:services"
name = 'api:services'
@ha.callback
def get(self, request):
async def get(self, request):
"""Get registered services."""
return self.json(async_services_json(request.app['hass']))
services = await async_services_json(request.app['hass'])
return self.json(services)
class APIDomainServicesView(HomeAssistantView):
"""View to handle DomainServices requests."""
url = "/api/services/{domain}/{service}"
name = "api:domain-services"
url = '/api/services/{domain}/{service}'
name = 'api:domain-services'
@asyncio.coroutine
def post(self, request, domain, service):
async def post(self, request, domain, service):
"""Call a service.
Returns a list of changed states.
"""
hass = request.app['hass']
body = yield from request.text()
data = json.loads(body) if body else None
body = await request.text()
try:
data = json.loads(body) if body else None
except ValueError:
return self.json_message(
"Data should be valid JSON.", HTTP_BAD_REQUEST)
with AsyncTrackStates(hass) as changed_states:
yield from hass.services.async_call(domain, service, data, True)
await hass.services.async_call(domain, service, data, True)
return self.json(changed_states)
class APIEventForwardingView(HomeAssistantView):
"""View to handle EventForwarding requests."""
url = URL_API_EVENT_FORWARD
name = "api:event-forward"
event_forwarder = None
@asyncio.coroutine
def post(self, request):
"""Setup an event forwarder."""
_LOGGER.warning('Event forwarding is deprecated. '
'Will be removed by 0.43')
hass = request.app['hass']
try:
data = yield from request.json()
except ValueError:
return self.json_message("No data received.", HTTP_BAD_REQUEST)
try:
host = data['host']
api_password = data['api_password']
except KeyError:
return self.json_message("No host or api_password received.",
HTTP_BAD_REQUEST)
try:
port = int(data['port']) if 'port' in data else None
except ValueError:
return self.json_message("Invalid value received for port.",
HTTP_UNPROCESSABLE_ENTITY)
api = rem.API(host, api_password, port)
valid = yield from hass.loop.run_in_executor(
None, api.validate_api)
if not valid:
return self.json_message("Unable to validate API.",
HTTP_UNPROCESSABLE_ENTITY)
if self.event_forwarder is None:
self.event_forwarder = rem.EventForwarder(hass)
self.event_forwarder.async_connect(api)
return self.json_message("Event forwarding setup.")
@asyncio.coroutine
def delete(self, request):
"""Remove event forwarder."""
try:
data = yield from request.json()
except ValueError:
return self.json_message("No data received.", HTTP_BAD_REQUEST)
try:
host = data['host']
except KeyError:
return self.json_message("No host received.", HTTP_BAD_REQUEST)
try:
port = int(data['port']) if 'port' in data else None
except ValueError:
return self.json_message("Invalid value received for port.",
HTTP_UNPROCESSABLE_ENTITY)
if self.event_forwarder is not None:
api = rem.API(host, None, port)
self.event_forwarder.async_disconnect(api)
return self.json_message("Event forwarding cancelled.")
class APIComponentsView(HomeAssistantView):
"""View to handle Components requests."""
url = URL_API_COMPONENTS
name = "api:components"
name = 'api:components'
@ha.callback
def get(self, request):
@@ -402,45 +333,42 @@ class APIComponentsView(HomeAssistantView):
return self.json(request.app['hass'].config.components)
class APIErrorLogView(HomeAssistantView):
"""View to handle ErrorLog requests."""
url = URL_API_ERROR_LOG
name = "api:error-log"
@asyncio.coroutine
def get(self, request):
"""Serve error log."""
resp = yield from self.file(
request, request.app['hass'].config.path(ERROR_LOG_FILENAME))
return resp
class APITemplateView(HomeAssistantView):
"""View to handle requests."""
"""View to handle Template requests."""
url = URL_API_TEMPLATE
name = "api:template"
name = 'api:template'
@asyncio.coroutine
def post(self, request):
async def post(self, request):
"""Render a template."""
try:
data = yield from request.json()
data = await request.json()
tpl = template.Template(data['template'], request.app['hass'])
return tpl.async_render(data.get('variables'))
except (ValueError, TemplateError) as ex:
return self.json_message('Error rendering template: {}'.format(ex),
HTTP_BAD_REQUEST)
return self.json_message(
"Error rendering template: {}".format(ex), HTTP_BAD_REQUEST)
def async_services_json(hass):
class APIErrorLog(HomeAssistantView):
"""View to fetch the API error log."""
url = URL_API_ERROR_LOG
name = 'api:error_log'
async def get(self, request):
"""Retrieve API error log."""
return web.FileResponse(request.app['hass'].data[DATA_LOGGING])
async def async_services_json(hass):
"""Generate services data to JSONify."""
return [{"domain": key, "services": value}
for key, value in hass.services.async_services().items()]
descriptions = await async_get_all_descriptions(hass)
return [{'domain': key, 'services': value}
for key, value in descriptions.items()]
def async_events_json(hass):
"""Generate event data to JSONify."""
return [{"event": key, "listener_count": value}
return [{'event': key, 'listener_count': value}
for key, value in hass.bus.async_listeners().items()]

View File

@@ -1,172 +0,0 @@
"""
Support for API.AI webhook.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/apiai/
"""
import asyncio
import copy
import logging
import voluptuous as vol
from homeassistant.const import PROJECT_NAME, HTTP_BAD_REQUEST
from homeassistant.helpers import template, script, config_validation as cv
from homeassistant.components.http import HomeAssistantView
_LOGGER = logging.getLogger(__name__)
INTENTS_API_ENDPOINT = '/api/apiai'
CONF_INTENTS = 'intents'
CONF_SPEECH = 'speech'
CONF_ACTION = 'action'
CONF_ASYNC_ACTION = 'async_action'
DEFAULT_CONF_ASYNC_ACTION = False
DOMAIN = 'apiai'
DEPENDENCIES = ['http']
CONFIG_SCHEMA = vol.Schema({
DOMAIN: {
CONF_INTENTS: {
cv.string: {
vol.Optional(CONF_SPEECH): cv.template,
vol.Optional(CONF_ACTION): cv.SCRIPT_SCHEMA,
vol.Optional(CONF_ASYNC_ACTION,
default=DEFAULT_CONF_ASYNC_ACTION): cv.boolean
}
}
}
}, extra=vol.ALLOW_EXTRA)
def setup(hass, config):
"""Activate API.AI component."""
intents = config[DOMAIN].get(CONF_INTENTS, {})
hass.http.register_view(ApiaiIntentsView(hass, intents))
return True
class ApiaiIntentsView(HomeAssistantView):
"""Handle API.AI requests."""
url = INTENTS_API_ENDPOINT
name = 'api:apiai'
def __init__(self, hass, intents):
"""Initialize API.AI view."""
super().__init__()
self.hass = hass
intents = copy.deepcopy(intents)
template.attach(hass, intents)
for name, intent in intents.items():
if CONF_ACTION in intent:
intent[CONF_ACTION] = script.Script(
hass, intent[CONF_ACTION], "Apiai intent {}".format(name))
self.intents = intents
@asyncio.coroutine
def post(self, request):
"""Handle API.AI."""
data = yield from request.json()
_LOGGER.debug("Received api.ai request: %s", data)
req = data.get('result')
if req is None:
_LOGGER.error("Received invalid data from api.ai: %s", data)
return self.json_message(
"Expected result value not received", HTTP_BAD_REQUEST)
action_incomplete = req['actionIncomplete']
if action_incomplete:
return None
# use intent to no mix HASS actions with this parameter
intent = req.get('action')
parameters = req.get('parameters')
# contexts = req.get('contexts')
response = ApiaiResponse(parameters)
# Default Welcome Intent
# Maybe is better to handle this in api.ai directly?
#
# if intent == 'input.welcome':
# response.add_speech(
# "Hello, and welcome to the future. How may I help?")
# return self.json(response)
if intent == "":
_LOGGER.warning("Received intent with empty action")
response.add_speech(
"You have not defined an action in your api.ai intent.")
return self.json(response)
config = self.intents.get(intent)
if config is None:
_LOGGER.warning("Received unknown intent %s", intent)
response.add_speech(
"Intent '%s' is not yet configured within Home Assistant." %
intent)
return self.json(response)
speech = config.get(CONF_SPEECH)
action = config.get(CONF_ACTION)
async_action = config.get(CONF_ASYNC_ACTION)
if action is not None:
# API.AI expects a response in less than 5s
if async_action:
# Do not wait for the action to be executed.
# Needed if the action will take longer than 5s to execute
self.hass.async_add_job(action.async_run(response.parameters))
else:
# Wait for the action to be executed so we can use results to
# render the answer
yield from action.async_run(response.parameters)
# pylint: disable=unsubscriptable-object
if speech is not None:
response.add_speech(speech)
return self.json(response)
class ApiaiResponse(object):
"""Help generating the response for API.AI."""
def __init__(self, parameters):
"""Initialize the response."""
self.speech = None
self.parameters = {}
# Parameter names replace '.' and '-' for '_'
for key, value in parameters.items():
underscored_key = key.replace('.', '_').replace('-', '_')
self.parameters[underscored_key] = value
def add_speech(self, text):
"""Add speech to the response."""
assert self.speech is None
if isinstance(text, template.Template):
text = text.async_render(self.parameters)
self.speech = text
def as_dict(self):
"""Return response in an API.AI valid dict."""
return {
'speech': self.speech,
'displayText': self.speech,
'source': PROJECT_NAME,
}

View File

@@ -0,0 +1,262 @@
"""
Support for Apple TV.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/apple_tv/
"""
import asyncio
import logging
from typing import Sequence, TypeVar, Union
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_APPLE_TV
from homeassistant.const import ATTR_ENTITY_ID, CONF_HOST, CONF_NAME
from homeassistant.helpers import discovery
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pyatv==0.3.10']
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'apple_tv'
SERVICE_SCAN = 'apple_tv_scan'
SERVICE_AUTHENTICATE = 'apple_tv_authenticate'
ATTR_ATV = 'atv'
ATTR_POWER = 'power'
CONF_LOGIN_ID = 'login_id'
CONF_START_OFF = 'start_off'
CONF_CREDENTIALS = 'credentials'
DEFAULT_NAME = 'Apple TV'
DATA_APPLE_TV = 'data_apple_tv'
DATA_ENTITIES = 'data_apple_tv_entities'
KEY_CONFIG = 'apple_tv_configuring'
NOTIFICATION_AUTH_ID = 'apple_tv_auth_notification'
NOTIFICATION_AUTH_TITLE = 'Apple TV Authentication'
NOTIFICATION_SCAN_ID = 'apple_tv_scan_notification'
NOTIFICATION_SCAN_TITLE = 'Apple TV Scan'
T = TypeVar('T')
# This version of ensure_list interprets an empty dict as no value
def ensure_list(value: Union[T, Sequence[T]]) -> Sequence[T]:
"""Wrap value in list if it is not one."""
if value is None or (isinstance(value, dict) and not value):
return []
return value if isinstance(value, list) else [value]
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.All(ensure_list, [vol.Schema({
vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_LOGIN_ID): cv.string,
vol.Optional(CONF_CREDENTIALS): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_START_OFF, default=False): cv.boolean,
})])
}, extra=vol.ALLOW_EXTRA)
# Currently no attributes but it might change later
APPLE_TV_SCAN_SCHEMA = vol.Schema({})
APPLE_TV_AUTHENTICATE_SCHEMA = vol.Schema({
ATTR_ENTITY_ID: cv.entity_ids,
})
def request_configuration(hass, config, atv, credentials):
"""Request configuration steps from the user."""
configurator = hass.components.configurator
@asyncio.coroutine
def configuration_callback(callback_data):
"""Handle the submitted configuration."""
from pyatv import exceptions
pin = callback_data.get('pin')
try:
yield from atv.airplay.finish_authentication(pin)
hass.components.persistent_notification.async_create(
'Authentication succeeded!<br /><br />Add the following '
'to credentials: in your apple_tv configuration:<br /><br />'
'{0}'.format(credentials),
title=NOTIFICATION_AUTH_TITLE,
notification_id=NOTIFICATION_AUTH_ID)
except exceptions.DeviceAuthenticationError as ex:
hass.components.persistent_notification.async_create(
'Authentication failed! Did you enter correct PIN?<br /><br />'
'Details: {0}'.format(ex),
title=NOTIFICATION_AUTH_TITLE,
notification_id=NOTIFICATION_AUTH_ID)
hass.async_add_job(configurator.request_done, instance)
instance = configurator.request_config(
'Apple TV Authentication', configuration_callback,
description='Please enter PIN code shown on screen.',
submit_caption='Confirm',
fields=[{'id': 'pin', 'name': 'PIN Code', 'type': 'password'}]
)
@asyncio.coroutine
def scan_for_apple_tvs(hass):
"""Scan for devices and present a notification of the ones found."""
import pyatv
atvs = yield from pyatv.scan_for_apple_tvs(hass.loop, timeout=3)
devices = []
for atv in atvs:
login_id = atv.login_id
if login_id is None:
login_id = 'Home Sharing disabled'
devices.append('Name: {0}<br />Host: {1}<br />Login ID: {2}'.format(
atv.name, atv.address, login_id))
if not devices:
devices = ['No device(s) found']
hass.components.persistent_notification.async_create(
'The following devices were found:<br /><br />' +
'<br /><br />'.join(devices),
title=NOTIFICATION_SCAN_TITLE,
notification_id=NOTIFICATION_SCAN_ID)
@asyncio.coroutine
def async_setup(hass, config):
"""Set up the Apple TV component."""
if DATA_APPLE_TV not in hass.data:
hass.data[DATA_APPLE_TV] = {}
@asyncio.coroutine
def async_service_handler(service):
"""Handle service calls."""
entity_ids = service.data.get(ATTR_ENTITY_ID)
if service.service == SERVICE_SCAN:
hass.async_add_job(scan_for_apple_tvs, hass)
return
if entity_ids:
devices = [device for device in hass.data[DATA_ENTITIES]
if device.entity_id in entity_ids]
else:
devices = hass.data[DATA_ENTITIES]
for device in devices:
if service.service != SERVICE_AUTHENTICATE:
continue
atv = device.atv
credentials = yield from atv.airplay.generate_credentials()
yield from atv.airplay.load_credentials(credentials)
_LOGGER.debug('Generated new credentials: %s', credentials)
yield from atv.airplay.start_authentication()
hass.async_add_job(request_configuration,
hass, config, atv, credentials)
@asyncio.coroutine
def atv_discovered(service, info):
"""Set up an Apple TV that was auto discovered."""
yield from _setup_atv(hass, {
CONF_NAME: info['name'],
CONF_HOST: info['host'],
CONF_LOGIN_ID: info['properties']['hG'],
CONF_START_OFF: False
})
discovery.async_listen(hass, SERVICE_APPLE_TV, atv_discovered)
tasks = [_setup_atv(hass, conf) for conf in config.get(DOMAIN, [])]
if tasks:
yield from asyncio.wait(tasks, loop=hass.loop)
hass.services.async_register(
DOMAIN, SERVICE_SCAN, async_service_handler,
schema=APPLE_TV_SCAN_SCHEMA)
hass.services.async_register(
DOMAIN, SERVICE_AUTHENTICATE, async_service_handler,
schema=APPLE_TV_AUTHENTICATE_SCHEMA)
return True
@asyncio.coroutine
def _setup_atv(hass, atv_config):
"""Set up an Apple TV."""
import pyatv
name = atv_config.get(CONF_NAME)
host = atv_config.get(CONF_HOST)
login_id = atv_config.get(CONF_LOGIN_ID)
start_off = atv_config.get(CONF_START_OFF)
credentials = atv_config.get(CONF_CREDENTIALS)
if host in hass.data[DATA_APPLE_TV]:
return
details = pyatv.AppleTVDevice(name, host, login_id)
session = async_get_clientsession(hass)
atv = pyatv.connect_to_apple_tv(details, hass.loop, session=session)
if credentials:
yield from atv.airplay.load_credentials(credentials)
power = AppleTVPowerManager(hass, atv, start_off)
hass.data[DATA_APPLE_TV][host] = {
ATTR_ATV: atv,
ATTR_POWER: power
}
hass.async_add_job(discovery.async_load_platform(
hass, 'media_player', DOMAIN, atv_config))
hass.async_add_job(discovery.async_load_platform(
hass, 'remote', DOMAIN, atv_config))
class AppleTVPowerManager:
"""Manager for global power management of an Apple TV.
An instance is used per device to share the same power state between
several platforms.
"""
def __init__(self, hass, atv, is_off):
"""Initialize power manager."""
self.hass = hass
self.atv = atv
self.listeners = []
self._is_on = not is_off
def init(self):
"""Initialize power management."""
if self._is_on:
self.atv.push_updater.start()
@property
def turned_on(self):
"""Return true if device is on or off."""
return self._is_on
def set_power_on(self, value):
"""Change if a device is on or off."""
if value != self._is_on:
self._is_on = value
if not self._is_on:
self.atv.push_updater.stop()
else:
self.atv.push_updater.start()
for listener in self.listeners:
self.hass.async_add_job(listener.async_update_ha_state())

View File

@@ -13,7 +13,7 @@ from homeassistant.const import (
from homeassistant.const import CONF_PORT
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['PyMata==2.13']
REQUIREMENTS = ['PyMata==2.14']
_LOGGER = logging.getLogger(__name__)
@@ -29,18 +29,25 @@ CONFIG_SCHEMA = vol.Schema({
def setup(hass, config):
"""Setup the Arduino component."""
"""Set up the Arduino component."""
import serial
port = config[DOMAIN][CONF_PORT]
global BOARD
try:
BOARD = ArduinoBoard(config[DOMAIN][CONF_PORT])
BOARD = ArduinoBoard(port)
except (serial.serialutil.SerialException, FileNotFoundError):
_LOGGER.exception("Your port is not accessible.")
_LOGGER.error("Your port %s is not accessible", port)
return False
if BOARD.get_firmata()[1] <= 2:
_LOGGER.error("The StandardFirmata sketch should be 2.2 or newer.")
return False
try:
if BOARD.get_firmata()[1] <= 2:
_LOGGER.error("The StandardFirmata sketch should be 2.2 or newer")
return False
except IndexError:
_LOGGER.warning("The version of the StandardFirmata sketch was not"
"detected. This may lead to side effects")
def stop_arduino(event):
"""Stop the Arduino service."""
@@ -67,25 +74,20 @@ class ArduinoBoard(object):
def set_mode(self, pin, direction, mode):
"""Set the mode and the direction of a given pin."""
if mode == 'analog' and direction == 'in':
self._board.set_pin_mode(pin,
self._board.INPUT,
self._board.ANALOG)
self._board.set_pin_mode(
pin, self._board.INPUT, self._board.ANALOG)
elif mode == 'analog' and direction == 'out':
self._board.set_pin_mode(pin,
self._board.OUTPUT,
self._board.ANALOG)
self._board.set_pin_mode(
pin, self._board.OUTPUT, self._board.ANALOG)
elif mode == 'digital' and direction == 'in':
self._board.set_pin_mode(pin,
self._board.INPUT,
self._board.DIGITAL)
self._board.set_pin_mode(
pin, self._board.INPUT, self._board.DIGITAL)
elif mode == 'digital' and direction == 'out':
self._board.set_pin_mode(pin,
self._board.OUTPUT,
self._board.DIGITAL)
self._board.set_pin_mode(
pin, self._board.OUTPUT, self._board.DIGITAL)
elif mode == 'pwm':
self._board.set_pin_mode(pin,
self._board.OUTPUT,
self._board.PWM)
self._board.set_pin_mode(
pin, self._board.OUTPUT, self._board.PWM)
def get_analog_inputs(self):
"""Get the values from the pins."""

View File

@@ -0,0 +1,92 @@
"""
This component provides support for Netgear Arlo IP cameras.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/arlo/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from requests.exceptions import HTTPError, ConnectTimeout
from homeassistant.helpers import config_validation as cv
from homeassistant.const import (
CONF_USERNAME, CONF_PASSWORD, CONF_SCAN_INTERVAL)
from homeassistant.helpers.event import track_time_interval
from homeassistant.helpers.dispatcher import dispatcher_send
REQUIREMENTS = ['pyarlo==0.1.8']
_LOGGER = logging.getLogger(__name__)
CONF_ATTRIBUTION = "Data provided by arlo.netgear.com"
DATA_ARLO = 'data_arlo'
DEFAULT_BRAND = 'Netgear Arlo'
DOMAIN = 'arlo'
NOTIFICATION_ID = 'arlo_notification'
NOTIFICATION_TITLE = 'Arlo Component Setup'
SCAN_INTERVAL = timedelta(seconds=60)
SIGNAL_UPDATE_ARLO = "arlo_update"
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL):
cv.time_period,
}),
}, extra=vol.ALLOW_EXTRA)
def setup(hass, config):
"""Set up an Arlo component."""
conf = config[DOMAIN]
username = conf.get(CONF_USERNAME)
password = conf.get(CONF_PASSWORD)
scan_interval = conf.get(CONF_SCAN_INTERVAL)
try:
from pyarlo import PyArlo
arlo = PyArlo(username, password, preload=False)
if not arlo.is_connected:
return False
# assign refresh period to base station thread
arlo_base_station = next((
station for station in arlo.base_stations), None)
if arlo_base_station is None:
return False
arlo_base_station.refresh_rate = scan_interval.total_seconds()
hass.data[DATA_ARLO] = arlo
except (ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Netgear Arlo: %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
def hub_refresh(event_time):
"""Call ArloHub to refresh information."""
_LOGGER.info("Updating Arlo Hub component")
hass.data[DATA_ARLO].update(update_cameras=True,
update_base_station=True)
dispatcher_send(hass, SIGNAL_UPDATE_ARLO)
# register service
hass.services.register(DOMAIN, 'update', hub_refresh)
# register scan interval for ArloHub
track_time_interval(hass, hub_refresh, scan_interval)
return True

View File

@@ -0,0 +1,81 @@
"""
Support for Asterisk Voicemail interface.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/asterisk_mbox/
"""
import logging
import voluptuous as vol
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT
from homeassistant.core import callback
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect, async_dispatcher_send)
REQUIREMENTS = ['asterisk_mbox==0.4.0']
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'asterisk_mbox'
SIGNAL_MESSAGE_REQUEST = 'asterisk_mbox.message_request'
SIGNAL_MESSAGE_UPDATE = 'asterisk_mbox.message_updated'
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_HOST): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Required(CONF_PORT): int,
}),
}, extra=vol.ALLOW_EXTRA)
def setup(hass, config):
"""Set up for the Asterisk Voicemail box."""
conf = config.get(DOMAIN)
host = conf.get(CONF_HOST)
port = conf.get(CONF_PORT)
password = conf.get(CONF_PASSWORD)
hass.data[DOMAIN] = AsteriskData(hass, host, port, password)
discovery.load_platform(hass, 'mailbox', DOMAIN, {}, config)
return True
class AsteriskData(object):
"""Store Asterisk mailbox data."""
def __init__(self, hass, host, port, password):
"""Init the Asterisk data object."""
from asterisk_mbox import Client as asteriskClient
self.hass = hass
self.client = asteriskClient(host, port, password, self.handle_data)
self.messages = []
async_dispatcher_connect(
self.hass, SIGNAL_MESSAGE_REQUEST, self._request_messages)
@callback
def handle_data(self, command, msg):
"""Handle changes to the mailbox."""
from asterisk_mbox.commands import CMD_MESSAGE_LIST
if command == CMD_MESSAGE_LIST:
_LOGGER.debug("AsteriskVM sent updated message list")
self.messages = sorted(
msg, key=lambda item: item['info']['origtime'], reverse=True)
async_dispatcher_send(
self.hass, SIGNAL_MESSAGE_UPDATE, self.messages)
@callback
def _request_messages(self):
"""Handle changes to the mailbox."""
_LOGGER.debug("Requesting message list")
self.client.messages()

View File

@@ -0,0 +1,257 @@
"""
Support for August devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/august/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from requests import RequestException
import homeassistant.helpers.config_validation as cv
from homeassistant.const import (
CONF_PASSWORD, CONF_USERNAME, CONF_TIMEOUT)
from homeassistant.helpers import discovery
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)
_CONFIGURING = {}
REQUIREMENTS = ['py-august==0.4.0']
DEFAULT_TIMEOUT = 10
ACTIVITY_FETCH_LIMIT = 10
ACTIVITY_INITIAL_FETCH_LIMIT = 20
CONF_LOGIN_METHOD = 'login_method'
CONF_INSTALL_ID = 'install_id'
NOTIFICATION_ID = 'august_notification'
NOTIFICATION_TITLE = "August Setup"
AUGUST_CONFIG_FILE = '.august.conf'
DATA_AUGUST = 'august'
DOMAIN = 'august'
DEFAULT_ENTITY_NAMESPACE = 'august'
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=5)
DEFAULT_SCAN_INTERVAL = timedelta(seconds=5)
LOGIN_METHODS = ['phone', 'email']
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_LOGIN_METHOD): vol.In(LOGIN_METHODS),
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_INSTALL_ID): cv.string,
vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
})
}, extra=vol.ALLOW_EXTRA)
AUGUST_COMPONENTS = [
'camera', 'binary_sensor', 'lock'
]
def request_configuration(hass, config, api, authenticator):
"""Request configuration steps from the user."""
configurator = hass.components.configurator
def august_configuration_callback(data):
"""Run when the configuration callback is called."""
from august.authenticator import ValidationResult
result = authenticator.validate_verification_code(
data.get('verification_code'))
if result == ValidationResult.INVALID_VERIFICATION_CODE:
configurator.notify_errors(_CONFIGURING[DOMAIN],
"Invalid verification code")
elif result == ValidationResult.VALIDATED:
setup_august(hass, config, api, authenticator)
if DOMAIN not in _CONFIGURING:
authenticator.send_verification_code()
conf = config[DOMAIN]
username = conf.get(CONF_USERNAME)
login_method = conf.get(CONF_LOGIN_METHOD)
_CONFIGURING[DOMAIN] = configurator.request_config(
NOTIFICATION_TITLE,
august_configuration_callback,
description="Please check your {} ({}) and enter the verification "
"code below".format(login_method, username),
submit_caption='Verify',
fields=[{
'id': 'verification_code',
'name': "Verification code",
'type': 'string'}]
)
def setup_august(hass, config, api, authenticator):
"""Set up the August component."""
from august.authenticator import AuthenticationState
authentication = None
try:
authentication = authenticator.authenticate()
except RequestException as ex:
_LOGGER.error("Unable to connect to August service: %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)
state = authentication.state
if state == AuthenticationState.AUTHENTICATED:
if DOMAIN in _CONFIGURING:
hass.components.configurator.request_done(_CONFIGURING.pop(DOMAIN))
hass.data[DATA_AUGUST] = AugustData(api, authentication.access_token)
for component in AUGUST_COMPONENTS:
discovery.load_platform(hass, component, DOMAIN, {}, config)
return True
elif state == AuthenticationState.BAD_PASSWORD:
return False
elif state == AuthenticationState.REQUIRES_VALIDATION:
request_configuration(hass, config, api, authenticator)
return True
return False
def setup(hass, config):
"""Set up the August component."""
from august.api import Api
from august.authenticator import Authenticator
conf = config[DOMAIN]
api = Api(timeout=conf.get(CONF_TIMEOUT))
authenticator = Authenticator(
api,
conf.get(CONF_LOGIN_METHOD),
conf.get(CONF_USERNAME),
conf.get(CONF_PASSWORD),
install_id=conf.get(CONF_INSTALL_ID),
access_token_cache_file=hass.config.path(AUGUST_CONFIG_FILE))
return setup_august(hass, config, api, authenticator)
class AugustData:
"""August data object."""
def __init__(self, api, access_token):
"""Init August data object."""
self._api = api
self._access_token = access_token
self._doorbells = self._api.get_doorbells(self._access_token) or []
self._locks = self._api.get_operable_locks(self._access_token) or []
self._house_ids = [d.house_id for d in self._doorbells + self._locks]
self._doorbell_detail_by_id = {}
self._lock_status_by_id = {}
self._lock_detail_by_id = {}
self._activities_by_id = {}
@property
def house_ids(self):
"""Return a list of house_ids."""
return self._house_ids
@property
def doorbells(self):
"""Return a list of doorbells."""
return self._doorbells
@property
def locks(self):
"""Return a list of locks."""
return self._locks
def get_device_activities(self, device_id, *activity_types):
"""Return a list of activities."""
self._update_device_activities()
activities = self._activities_by_id.get(device_id, [])
if activity_types:
return [a for a in activities if a.activity_type in activity_types]
return activities
def get_latest_device_activity(self, device_id, *activity_types):
"""Return latest activity."""
activities = self.get_device_activities(device_id, *activity_types)
return next(iter(activities or []), None)
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def _update_device_activities(self, limit=ACTIVITY_FETCH_LIMIT):
"""Update data object with latest from August API."""
for house_id in self.house_ids:
activities = self._api.get_house_activities(self._access_token,
house_id,
limit=limit)
device_ids = {a.device_id for a in activities}
for device_id in device_ids:
self._activities_by_id[device_id] = [a for a in activities if
a.device_id == device_id]
def get_doorbell_detail(self, doorbell_id):
"""Return doorbell detail."""
self._update_doorbells()
return self._doorbell_detail_by_id.get(doorbell_id)
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def _update_doorbells(self):
detail_by_id = {}
for doorbell in self._doorbells:
detail_by_id[doorbell.device_id] = self._api.get_doorbell_detail(
self._access_token, doorbell.device_id)
self._doorbell_detail_by_id = detail_by_id
def get_lock_status(self, lock_id):
"""Return lock status."""
self._update_locks()
return self._lock_status_by_id.get(lock_id)
def get_lock_detail(self, lock_id):
"""Return lock detail."""
self._update_locks()
return self._lock_detail_by_id.get(lock_id)
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def _update_locks(self):
status_by_id = {}
detail_by_id = {}
for lock in self._locks:
status_by_id[lock.device_id] = self._api.get_lock_status(
self._access_token, lock.device_id)
detail_by_id[lock.device_id] = self._api.get_lock_detail(
self._access_token, lock.device_id)
self._lock_status_by_id = status_by_id
self._lock_detail_by_id = detail_by_id
def lock(self, device_id):
"""Lock the device."""
return self._api.lock(self._access_token, device_id)
def unlock(self, device_id):
"""Unlock the device."""
return self._api.unlock(self._access_token, device_id)

View File

@@ -0,0 +1,351 @@
"""Component to allow users to login and get tokens.
All requests will require passing in a valid client ID and secret via HTTP
Basic Auth.
# GET /auth/providers
Return a list of auth providers. Example:
[
{
"name": "Local",
"id": null,
"type": "local_provider",
}
]
# POST /auth/login_flow
Create a login flow. Will return the first step of the flow.
Pass in parameter 'handler' to specify the auth provider to use. Auth providers
are identified by type and id.
{
"handler": ["local_provider", null]
}
Return value will be a step in a data entry flow. See the docs for data entry
flow for details.
{
"data_schema": [
{"name": "username", "type": "string"},
{"name": "password", "type": "string"}
],
"errors": {},
"flow_id": "8f7e42faab604bcab7ac43c44ca34d58",
"handler": ["insecure_example", null],
"step_id": "init",
"type": "form"
}
# POST /auth/login_flow/{flow_id}
Progress the flow. Most flows will be 1 page, but could optionally add extra
login challenges, like TFA. Once the flow has finished, the returned step will
have type "create_entry" and "result" key will contain an authorization code.
{
"flow_id": "8f7e42faab604bcab7ac43c44ca34d58",
"handler": ["insecure_example", null],
"result": "411ee2f916e648d691e937ae9344681e",
"source": "user",
"title": "Example",
"type": "create_entry",
"version": 1
}
# POST /auth/token
This is an OAuth2 endpoint for granting tokens. We currently support the grant
types "authorization_code" and "refresh_token". Because we follow the OAuth2
spec, data should be send in formatted as x-www-form-urlencoded. Examples will
be in JSON as it's more readable.
## Grant type authorization_code
Exchange the authorization code retrieved from the login flow for tokens.
{
"grant_type": "authorization_code",
"code": "411ee2f916e648d691e937ae9344681e"
}
Return value will be the access and refresh tokens. The access token will have
a limited expiration. New access tokens can be requested using the refresh
token.
{
"access_token": "ABCDEFGH",
"expires_in": 1800,
"refresh_token": "IJKLMNOPQRST",
"token_type": "Bearer"
}
## Grant type refresh_token
Request a new access token using a refresh token.
{
"grant_type": "refresh_token",
"refresh_token": "IJKLMNOPQRST"
}
Return value will be a new access token. The access token will have
a limited expiration.
{
"access_token": "ABCDEFGH",
"expires_in": 1800,
"token_type": "Bearer"
}
"""
import logging
import uuid
import aiohttp.web
import voluptuous as vol
from homeassistant import data_entry_flow
from homeassistant.core import callback
from homeassistant.helpers.data_entry_flow import (
FlowManagerIndexView, FlowManagerResourceView)
from homeassistant.components.http.view import HomeAssistantView
from homeassistant.components.http.data_validator import RequestDataValidator
from .client import verify_client
DOMAIN = 'auth'
DEPENDENCIES = ['http']
_LOGGER = logging.getLogger(__name__)
async def async_setup(hass, config):
"""Component to allow users to login."""
store_credentials, retrieve_credentials = _create_cred_store()
hass.http.register_view(AuthProvidersView)
hass.http.register_view(LoginFlowIndexView(hass.auth.login_flow))
hass.http.register_view(
LoginFlowResourceView(hass.auth.login_flow, store_credentials))
hass.http.register_view(GrantTokenView(retrieve_credentials))
hass.http.register_view(LinkUserView(retrieve_credentials))
return True
class AuthProvidersView(HomeAssistantView):
"""View to get available auth providers."""
url = '/auth/providers'
name = 'api:auth:providers'
requires_auth = False
@verify_client
async def get(self, request, client):
"""Get available auth providers."""
return self.json([{
'name': provider.name,
'id': provider.id,
'type': provider.type,
} for provider in request.app['hass'].auth.async_auth_providers])
class LoginFlowIndexView(FlowManagerIndexView):
"""View to create a config flow."""
url = '/auth/login_flow'
name = 'api:auth:login_flow'
requires_auth = False
async def get(self, request):
"""Do not allow index of flows in progress."""
return aiohttp.web.Response(status=405)
# pylint: disable=arguments-differ
@verify_client
@RequestDataValidator(vol.Schema({
vol.Required('handler'): vol.Any(str, list),
vol.Required('redirect_uri'): str,
}))
async def post(self, request, client, data):
"""Create a new login flow."""
if data['redirect_uri'] not in client.redirect_uris:
return self.json_message('invalid redirect uri', )
# pylint: disable=no-value-for-parameter
return await super().post(request)
class LoginFlowResourceView(FlowManagerResourceView):
"""View to interact with the flow manager."""
url = '/auth/login_flow/{flow_id}'
name = 'api:auth:login_flow:resource'
requires_auth = False
def __init__(self, flow_mgr, store_credentials):
"""Initialize the login flow resource view."""
super().__init__(flow_mgr)
self._store_credentials = store_credentials
# pylint: disable=arguments-differ
async def get(self, request):
"""Do not allow getting status of a flow in progress."""
return self.json_message('Invalid flow specified', 404)
# pylint: disable=arguments-differ
@verify_client
@RequestDataValidator(vol.Schema(dict), allow_empty=True)
async def post(self, request, client, flow_id, data):
"""Handle progressing a login flow request."""
try:
result = await self._flow_mgr.async_configure(flow_id, data)
except data_entry_flow.UnknownFlow:
return self.json_message('Invalid flow specified', 404)
except vol.Invalid:
return self.json_message('User input malformed', 400)
if result['type'] != data_entry_flow.RESULT_TYPE_CREATE_ENTRY:
return self.json(self._prepare_result_json(result))
result.pop('data')
result['result'] = self._store_credentials(client.id, result['result'])
return self.json(result)
class GrantTokenView(HomeAssistantView):
"""View to grant tokens."""
url = '/auth/token'
name = 'api:auth:token'
requires_auth = False
def __init__(self, retrieve_credentials):
"""Initialize the grant token view."""
self._retrieve_credentials = retrieve_credentials
@verify_client
async def post(self, request, client):
"""Grant a token."""
hass = request.app['hass']
data = await request.post()
grant_type = data.get('grant_type')
if grant_type == 'authorization_code':
return await self._async_handle_auth_code(
hass, client.id, data)
elif grant_type == 'refresh_token':
return await self._async_handle_refresh_token(
hass, client.id, data)
return self.json({
'error': 'unsupported_grant_type',
}, status_code=400)
async def _async_handle_auth_code(self, hass, client_id, data):
"""Handle authorization code request."""
code = data.get('code')
if code is None:
return self.json({
'error': 'invalid_request',
}, status_code=400)
credentials = self._retrieve_credentials(client_id, code)
if credentials is None:
return self.json({
'error': 'invalid_request',
}, status_code=400)
user = await hass.auth.async_get_or_create_user(credentials)
refresh_token = await hass.auth.async_create_refresh_token(user,
client_id)
access_token = hass.auth.async_create_access_token(refresh_token)
return self.json({
'access_token': access_token.token,
'token_type': 'Bearer',
'refresh_token': refresh_token.token,
'expires_in':
int(refresh_token.access_token_expiration.total_seconds()),
})
async def _async_handle_refresh_token(self, hass, client_id, data):
"""Handle authorization code request."""
token = data.get('refresh_token')
if token is None:
return self.json({
'error': 'invalid_request',
}, status_code=400)
refresh_token = await hass.auth.async_get_refresh_token(token)
if refresh_token is None or refresh_token.client_id != client_id:
return self.json({
'error': 'invalid_grant',
}, status_code=400)
access_token = hass.auth.async_create_access_token(refresh_token)
return self.json({
'access_token': access_token.token,
'token_type': 'Bearer',
'expires_in':
int(refresh_token.access_token_expiration.total_seconds()),
})
class LinkUserView(HomeAssistantView):
"""View to link existing users to new credentials."""
url = '/auth/link_user'
name = 'api:auth:link_user'
def __init__(self, retrieve_credentials):
"""Initialize the link user view."""
self._retrieve_credentials = retrieve_credentials
@RequestDataValidator(vol.Schema({
'code': str,
'client_id': str,
}))
async def post(self, request, data):
"""Link a user."""
hass = request.app['hass']
user = request['hass_user']
credentials = self._retrieve_credentials(
data['client_id'], data['code'])
if credentials is None:
return self.json_message('Invalid code', status_code=400)
await hass.auth.async_link_user(user, credentials)
return self.json_message('User linked')
@callback
def _create_cred_store():
"""Create a credential store."""
temp_credentials = {}
@callback
def store_credentials(client_id, credentials):
"""Store credentials and return a code to retrieve it."""
code = uuid.uuid4().hex
temp_credentials[(client_id, code)] = credentials
return code
@callback
def retrieve_credentials(client_id, code):
"""Retrieve credentials."""
return temp_credentials.pop((client_id, code), None)
return store_credentials, retrieve_credentials

View File

@@ -0,0 +1,79 @@
"""Helpers to resolve client ID/secret."""
import base64
from functools import wraps
import hmac
import aiohttp.hdrs
def verify_client(method):
"""Decorator to verify client id/secret on requests."""
@wraps(method)
async def wrapper(view, request, *args, **kwargs):
"""Verify client id/secret before doing request."""
client = await _verify_client(request)
if client is None:
return view.json({
'error': 'invalid_client',
}, status_code=401)
return await method(
view, request, *args, **kwargs, client=client)
return wrapper
async def _verify_client(request):
"""Method to verify the client id/secret in consistent time.
By using a consistent time for looking up client id and comparing the
secret, we prevent attacks by malicious actors trying different client ids
and are able to derive from the time it takes to process the request if
they guessed the client id correctly.
"""
if aiohttp.hdrs.AUTHORIZATION not in request.headers:
return None
auth_type, auth_value = \
request.headers.get(aiohttp.hdrs.AUTHORIZATION).split(' ', 1)
if auth_type != 'Basic':
return None
decoded = base64.b64decode(auth_value).decode('utf-8')
try:
client_id, client_secret = decoded.split(':', 1)
except ValueError:
# If no ':' in decoded
client_id, client_secret = decoded, None
return await async_secure_get_client(
request.app['hass'], client_id, client_secret)
async def async_secure_get_client(hass, client_id, client_secret):
"""Get a client id/secret in consistent time."""
client = await hass.auth.async_get_client(client_id)
if client is None:
if client_secret is not None:
# Still do a compare so we run same time as if a client was found.
hmac.compare_digest(client_secret.encode('utf-8'),
client_secret.encode('utf-8'))
return None
if client.secret is None:
return client
elif client_secret is None:
# Still do a compare so we run same time as if a secret was passed.
hmac.compare_digest(client.secret.encode('utf-8'),
client.secret.encode('utf-8'))
return None
elif hmac.compare_digest(client_secret.encode('utf-8'),
client.secret.encode('utf-8')):
return client
return None

View File

@@ -6,27 +6,28 @@ https://home-assistant.io/components/automation/
"""
import asyncio
from functools import partial
import importlib
import logging
import os
import voluptuous as vol
from homeassistant.setup import async_prepare_setup_platform
from homeassistant import config as conf_util
from homeassistant.core import CoreState
from homeassistant.loader import bind_hass
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_PLATFORM, STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF,
SERVICE_TOGGLE, SERVICE_RELOAD)
SERVICE_TOGGLE, SERVICE_RELOAD, EVENT_HOMEASSISTANT_START, CONF_ID)
from homeassistant.components import logbook
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import extract_domain_configs, script, condition
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.restore_state import async_get_last_state
from homeassistant.loader import get_platform
from homeassistant.util.dt import utcnow
import homeassistant.helpers.config_validation as cv
DOMAIN = 'automation'
DEPENDENCIES = ['group']
ENTITY_ID_FORMAT = DOMAIN + '.{}'
GROUP_NAME_ALL_AUTOMATIONS = 'all automations'
@@ -57,12 +58,14 @@ _LOGGER = logging.getLogger(__name__)
def _platform_validator(config):
"""Validate it is a valid platform."""
platform = get_platform(DOMAIN, config[CONF_PLATFORM])
try:
platform = importlib.import_module(
'homeassistant.components.automation.{}'.format(
config[CONF_PLATFORM]))
except ImportError:
raise vol.Invalid('Invalid platform specified') from None
if not hasattr(platform, 'TRIGGER_SCHEMA'):
return config
return getattr(platform, 'TRIGGER_SCHEMA')(config)
return platform.TRIGGER_SCHEMA(config)
_TRIGGER_SCHEMA = vol.All(
@@ -70,7 +73,7 @@ _TRIGGER_SCHEMA = vol.All(
[
vol.All(
vol.Schema({
vol.Required(CONF_PLATFORM): cv.platform_validator(DOMAIN)
vol.Required(CONF_PLATFORM): str
}, extra=vol.ALLOW_EXTRA),
_platform_validator
),
@@ -80,9 +83,10 @@ _TRIGGER_SCHEMA = vol.All(
_CONDITION_SCHEMA = vol.All(cv.ensure_list, [cv.CONDITION_SCHEMA])
PLATFORM_SCHEMA = vol.Schema({
# str on purpose
CONF_ID: str,
CONF_ALIAS: cv.string,
vol.Optional(CONF_INITIAL_STATE,
default=DEFAULT_INITIAL_STATE): cv.boolean,
vol.Optional(CONF_INITIAL_STATE): cv.boolean,
vol.Optional(CONF_HIDE_ENTITY, default=DEFAULT_HIDE_ENTITY): cv.boolean,
vol.Required(CONF_TRIGGER): _TRIGGER_SCHEMA,
vol.Optional(CONF_CONDITION): _CONDITION_SCHEMA,
@@ -94,68 +98,73 @@ SERVICE_SCHEMA = vol.Schema({
})
TRIGGER_SERVICE_SCHEMA = vol.Schema({
vol.Optional(ATTR_ENTITY_ID): cv.entity_ids,
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
vol.Optional(ATTR_VARIABLES, default={}): dict,
})
RELOAD_SERVICE_SCHEMA = vol.Schema({})
def is_on(hass, entity_id=None):
@bind_hass
def is_on(hass, entity_id):
"""
Return true if specified automation entity_id is on.
Check all automation if no entity_id specified.
Async friendly.
"""
entity_ids = [entity_id] if entity_id else hass.states.entity_ids(DOMAIN)
return any(hass.states.is_state(entity_id, STATE_ON)
for entity_id in entity_ids)
return hass.states.is_state(entity_id, STATE_ON)
@bind_hass
def turn_on(hass, entity_id=None):
"""Turn on specified automation or all."""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.services.call(DOMAIN, SERVICE_TURN_ON, data)
@bind_hass
def turn_off(hass, entity_id=None):
"""Turn off specified automation or all."""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.services.call(DOMAIN, SERVICE_TURN_OFF, data)
@bind_hass
def toggle(hass, entity_id=None):
"""Toggle specified automation or all."""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.services.call(DOMAIN, SERVICE_TOGGLE, data)
@bind_hass
def trigger(hass, entity_id=None):
"""Trigger specified automation or all."""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.services.call(DOMAIN, SERVICE_TRIGGER, data)
@bind_hass
def reload(hass):
"""Reload the automation from config."""
hass.services.call(DOMAIN, SERVICE_RELOAD)
@bind_hass
def async_reload(hass):
"""Reload the automation from config.
Returns a coroutine object.
"""
return hass.services.async_call(DOMAIN, SERVICE_RELOAD)
@asyncio.coroutine
def async_setup(hass, config):
"""Setup the automation."""
"""Set up the automation."""
component = EntityComponent(_LOGGER, DOMAIN, hass,
group_name=GROUP_NAME_ALL_AUTOMATIONS)
success = yield from _async_process_config(hass, config, component)
if not success:
return False
descriptions = yield from hass.loop.run_in_executor(
None, conf_util.load_yaml_config_file, os.path.join(
os.path.dirname(__file__), 'services.yaml')
)
yield from _async_process_config(hass, config, component)
@asyncio.coroutine
def trigger_service_handler(service_call):
@@ -202,20 +211,20 @@ def async_setup(hass, config):
hass.services.async_register(
DOMAIN, SERVICE_TRIGGER, trigger_service_handler,
descriptions.get(SERVICE_TRIGGER), schema=TRIGGER_SERVICE_SCHEMA)
schema=TRIGGER_SERVICE_SCHEMA)
hass.services.async_register(
DOMAIN, SERVICE_RELOAD, reload_service_handler,
descriptions.get(SERVICE_RELOAD), schema=RELOAD_SERVICE_SCHEMA)
schema=RELOAD_SERVICE_SCHEMA)
hass.services.async_register(
DOMAIN, SERVICE_TOGGLE, toggle_service_handler,
descriptions.get(SERVICE_TOGGLE), schema=SERVICE_SCHEMA)
schema=SERVICE_SCHEMA)
for service in (SERVICE_TURN_ON, SERVICE_TURN_OFF):
hass.services.async_register(
DOMAIN, service, turn_onoff_service_handler,
descriptions.get(service), schema=SERVICE_SCHEMA)
schema=SERVICE_SCHEMA)
return True
@@ -223,15 +232,15 @@ def async_setup(hass, config):
class AutomationEntity(ToggleEntity):
"""Entity to show status of entity."""
def __init__(self, name, async_attach_triggers, cond_func, async_action,
hidden, initial_state):
def __init__(self, automation_id, name, async_attach_triggers, cond_func,
async_action, hidden, initial_state):
"""Initialize an automation entity."""
self._id = automation_id
self._name = name
self._async_attach_triggers = async_attach_triggers
self._async_detach_triggers = None
self._cond_func = cond_func
self._async_action = async_action
self._enabled = False
self._last_triggered = None
self._hidden = hidden
self._initial_state = initial_state
@@ -261,38 +270,62 @@ class AutomationEntity(ToggleEntity):
@property
def is_on(self) -> bool:
"""Return True if entity is on."""
return self._enabled
return self._async_detach_triggers is not None
@asyncio.coroutine
def async_added_to_hass(self) -> None:
"""Startup with initial state or previous state."""
state = yield from async_get_last_state(self.hass, self.entity_id)
if state is None:
if self._initial_state:
yield from self.async_enable()
if self._initial_state is not None:
enable_automation = self._initial_state
_LOGGER.debug("Automation %s initial state %s from config "
"initial_state", self.entity_id, enable_automation)
else:
self._last_triggered = state.attributes.get('last_triggered')
if state.state == STATE_ON:
state = yield from async_get_last_state(self.hass, self.entity_id)
if state:
enable_automation = state.state == STATE_ON
self._last_triggered = state.attributes.get('last_triggered')
_LOGGER.debug("Automation %s initial state %s from recorder "
"last state %s", self.entity_id,
enable_automation, state)
else:
enable_automation = DEFAULT_INITIAL_STATE
_LOGGER.debug("Automation %s initial state %s from default "
"initial state", self.entity_id,
enable_automation)
if not enable_automation:
return
# HomeAssistant is starting up
elif self.hass.state == CoreState.not_running:
@asyncio.coroutine
def async_enable_automation(event):
"""Start automation on startup."""
yield from self.async_enable()
self.hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_START, async_enable_automation)
# HomeAssistant is running
else:
yield from self.async_enable()
@asyncio.coroutine
def async_turn_on(self, **kwargs) -> None:
"""Turn the entity on and update the state."""
if self._enabled:
if self.is_on:
return
yield from self.async_enable()
yield from self.async_update_ha_state()
@asyncio.coroutine
def async_turn_off(self, **kwargs) -> None:
"""Turn the entity off."""
if not self._enabled:
if not self.is_on:
return
self._async_detach_triggers()
self._async_detach_triggers = None
self._enabled = False
yield from self.async_update_ha_state()
@asyncio.coroutine
@@ -307,10 +340,9 @@ class AutomationEntity(ToggleEntity):
yield from self.async_update_ha_state()
@asyncio.coroutine
def async_remove(self):
"""Remove automation from HASS."""
def async_will_remove_from_hass(self):
"""Remove listeners when removing automation from HASS."""
yield from self.async_turn_off()
yield from super().async_remove()
@asyncio.coroutine
def async_enable(self):
@@ -318,12 +350,22 @@ class AutomationEntity(ToggleEntity):
This method is a coroutine.
"""
if self._enabled:
if self.is_on:
return
self._async_detach_triggers = yield from self._async_attach_triggers(
self.async_trigger)
self._enabled = True
yield from self.async_update_ha_state()
@property
def device_state_attributes(self):
"""Return automation attributes."""
if self._id is None:
return None
return {
CONF_ID: self._id
}
@asyncio.coroutine
@@ -338,11 +380,12 @@ def _async_process_config(hass, config, component):
conf = config[config_key]
for list_no, config_block in enumerate(conf):
automation_id = config_block.get(CONF_ID)
name = config_block.get(CONF_ALIAS) or "{} {}".format(config_key,
list_no)
hidden = config_block[CONF_HIDE_ENTITY]
initial_state = config_block[CONF_INITIAL_STATE]
initial_state = config_block.get(CONF_INITIAL_STATE)
action = _async_get_action(hass, config_block.get(CONF_ACTION, {}),
name)
@@ -362,16 +405,14 @@ def _async_process_config(hass, config, component):
config_block.get(CONF_TRIGGER, []), name
)
entity = AutomationEntity(
name, async_attach_triggers, cond_func, action, hidden,
initial_state)
automation_id, name, async_attach_triggers, cond_func, action,
hidden, initial_state)
entities.append(entity)
if entities:
yield from component.async_add_entities(entities)
return len(entities) > 0
def _async_get_action(hass, config, name):
"""Return an action based on a configuration."""
@@ -379,7 +420,7 @@ def _async_get_action(hass, config, name):
@asyncio.coroutine
def action(entity_id, variables):
"""Action to be executed."""
"""Execute an action."""
_LOGGER.info('Executing %s', name)
logbook.async_log_entry(
hass, name, 'has been triggered', DOMAIN, entity_id)
@@ -409,7 +450,7 @@ def _async_process_if(hass, config, p_config):
@asyncio.coroutine
def _async_process_trigger(hass, config, trigger_configs, name, action):
"""Setup the triggers.
"""Set up the triggers.
This method is a coroutine.
"""

View File

@@ -2,7 +2,7 @@
Offer event listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#event-trigger
at https://home-assistant.io/docs/automation/trigger/#event-trigger
"""
import asyncio
import logging
@@ -13,8 +13,8 @@ from homeassistant.core import callback
from homeassistant.const import CONF_PLATFORM
from homeassistant.helpers import config_validation as cv
CONF_EVENT_TYPE = "event_type"
CONF_EVENT_DATA = "event_data"
CONF_EVENT_TYPE = 'event_type'
CONF_EVENT_DATA = 'event_data'
_LOGGER = logging.getLogger(__name__)
@@ -29,18 +29,27 @@ TRIGGER_SCHEMA = vol.Schema({
def async_trigger(hass, config, action):
"""Listen for events based on configuration."""
event_type = config.get(CONF_EVENT_TYPE)
event_data = config.get(CONF_EVENT_DATA)
event_data_schema = vol.Schema(
config.get(CONF_EVENT_DATA),
extra=vol.ALLOW_EXTRA) if config.get(CONF_EVENT_DATA) else None
@callback
def handle_event(event):
"""Listen for events and calls the action when data matches."""
if not event_data or all(val == event.data.get(key) for key, val
in event_data.items()):
hass.async_run_job(action, {
'trigger': {
'platform': 'event',
'event': event,
},
})
if event_data_schema:
# Check that the event data matches the configured
# schema if one was provided
try:
event_data_schema(event.data)
except vol.Invalid:
# If event data doesn't match requested schema, skip event
return
hass.async_run_job(action, {
'trigger': {
'platform': 'event',
'event': event,
},
})
return hass.bus.async_listen(event_type, handle_event)

View File

@@ -0,0 +1,55 @@
"""
Offer Home Assistant core automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#homeassistant-trigger
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback, CoreState
from homeassistant.const import (
CONF_PLATFORM, CONF_EVENT, EVENT_HOMEASSISTANT_STOP)
EVENT_START = 'start'
EVENT_SHUTDOWN = 'shutdown'
_LOGGER = logging.getLogger(__name__)
TRIGGER_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): 'homeassistant',
vol.Required(CONF_EVENT): vol.Any(EVENT_START, EVENT_SHUTDOWN),
})
@asyncio.coroutine
def async_trigger(hass, config, action):
"""Listen for events based on configuration."""
event = config.get(CONF_EVENT)
if event == EVENT_SHUTDOWN:
@callback
def hass_shutdown(event):
"""Execute when Home Assistant is shutting down."""
hass.async_run_job(action, {
'trigger': {
'platform': 'homeassistant',
'event': event,
},
})
return hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP,
hass_shutdown)
# Automation are enabled while hass is starting up, fire right away
# Check state because a config reload shouldn't trigger it.
elif hass.state == CoreState.starting:
hass.async_run_job(action, {
'trigger': {
'platform': 'homeassistant',
'event': event,
},
})
return lambda: None

View File

@@ -70,7 +70,7 @@ def async_trigger(hass, config, action):
nonlocal held_less_than, held_more_than
pressed_time = dt_util.utcnow()
if held_more_than is None and held_less_than is None:
call_action()
hass.add_job(call_action)
if held_more_than is not None and held_less_than is None:
cancel_pressed_more_than = track_point_in_utc_time(
hass,
@@ -88,7 +88,7 @@ def async_trigger(hass, config, action):
held_time = dt_util.utcnow() - pressed_time
if held_less_than is not None and held_time < held_less_than:
if held_more_than is None or held_time > held_more_than:
call_action()
hass.add_job(call_action)
hass.data['litejet_system'].on_switch_pressed(number, pressed)
hass.data['litejet_system'].on_switch_released(number, released)

View File

@@ -2,7 +2,7 @@
Offer MQTT listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#mqtt-trigger
at https://home-assistant.io/docs/automation/trigger/#mqtt-trigger
"""
import asyncio
import json

View File

@@ -2,7 +2,7 @@
Offer numeric state listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#numeric-state-trigger
at https://home-assistant.io/docs/automation/trigger/#numeric-state-trigger
"""
import asyncio
import logging
@@ -12,16 +12,18 @@ import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import (
CONF_VALUE_TEMPLATE, CONF_PLATFORM, CONF_ENTITY_ID,
CONF_BELOW, CONF_ABOVE)
from homeassistant.helpers.event import async_track_state_change
CONF_BELOW, CONF_ABOVE, CONF_FOR)
from homeassistant.helpers.event import (
async_track_state_change, async_track_same_state)
from homeassistant.helpers import condition, config_validation as cv
TRIGGER_SCHEMA = vol.All(vol.Schema({
vol.Required(CONF_PLATFORM): 'numeric_state',
vol.Required(CONF_ENTITY_ID): cv.entity_ids,
CONF_BELOW: vol.Coerce(float),
CONF_ABOVE: vol.Coerce(float),
vol.Optional(CONF_BELOW): vol.Coerce(float),
vol.Optional(CONF_ABOVE): vol.Coerce(float),
vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
vol.Optional(CONF_FOR): vol.All(cv.time_period, cv.positive_timedelta),
}), cv.has_at_least_one_key(CONF_BELOW, CONF_ABOVE))
_LOGGER = logging.getLogger(__name__)
@@ -33,15 +35,19 @@ def async_trigger(hass, config, action):
entity_id = config.get(CONF_ENTITY_ID)
below = config.get(CONF_BELOW)
above = config.get(CONF_ABOVE)
time_delta = config.get(CONF_FOR)
value_template = config.get(CONF_VALUE_TEMPLATE)
unsub_track_same = {}
entities_triggered = set()
if value_template is not None:
value_template.hass = hass
@callback
def state_automation_listener(entity, from_s, to_s):
"""Listen for state changes and calls action."""
def check_numeric_state(entity, from_s, to_s):
"""Return True if criteria are now met."""
if to_s is None:
return
return False
variables = {
'trigger': {
@@ -51,21 +57,49 @@ def async_trigger(hass, config, action):
'above': above,
}
}
return condition.async_numeric_state(
hass, to_s, below, above, value_template, variables)
# If new one doesn't match, nothing to do
if not condition.async_numeric_state(
hass, to_s, below, above, value_template, variables):
return
@callback
def state_automation_listener(entity, from_s, to_s):
"""Listen for state changes and calls action."""
@callback
def call_action():
"""Call action with right context."""
hass.async_run_job(action, {
'trigger': {
'platform': 'numeric_state',
'entity_id': entity,
'below': below,
'above': above,
'from_state': from_s,
'to_state': to_s,
}
})
# Only match if old didn't exist or existed but didn't match
# Written as: skip if old one did exist and matched
if from_s is not None and condition.async_numeric_state(
hass, from_s, below, above, value_template, variables):
return
matching = check_numeric_state(entity, from_s, to_s)
variables['trigger']['from_state'] = from_s
variables['trigger']['to_state'] = to_s
if not matching:
entities_triggered.discard(entity)
elif entity not in entities_triggered:
entities_triggered.add(entity)
hass.async_run_job(action, variables)
if time_delta:
unsub_track_same[entity] = async_track_same_state(
hass, time_delta, call_action, entity_ids=entity_id,
async_check_same_func=check_numeric_state)
else:
call_action()
return async_track_state_change(hass, entity_id, state_automation_listener)
unsub = async_track_state_change(
hass, entity_id, state_automation_listener)
@callback
def async_remove():
"""Remove state listeners async."""
unsub()
for async_remove in unsub_track_same.values():
async_remove()
unsub_track_same.clear()
return async_remove

View File

@@ -1,6 +1,7 @@
# Describes the format for available automation services
turn_on:
description: Enable an automation.
fields:
entity_id:
description: Name of the automation to turn on.
@@ -8,7 +9,6 @@ turn_on:
turn_off:
description: Disable an automation.
fields:
entity_id:
description: Name of the automation to turn off.
@@ -16,7 +16,6 @@ turn_off:
toggle:
description: Toggle an automation.
fields:
entity_id:
description: Name of the automation to toggle on/off.
@@ -24,7 +23,6 @@ toggle:
trigger:
description: Trigger the action of an automation.
fields:
entity_id:
description: Name of the automation to trigger.

View File

@@ -2,37 +2,29 @@
Offer state listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#state-trigger
at https://home-assistant.io/docs/automation/trigger/#state-trigger
"""
import asyncio
import voluptuous as vol
from homeassistant.core import callback
import homeassistant.util.dt as dt_util
from homeassistant.const import MATCH_ALL, CONF_PLATFORM
from homeassistant.const import MATCH_ALL, CONF_PLATFORM, CONF_FOR
from homeassistant.helpers.event import (
async_track_state_change, async_track_point_in_utc_time)
async_track_state_change, async_track_same_state)
import homeassistant.helpers.config_validation as cv
CONF_ENTITY_ID = "entity_id"
CONF_FROM = "from"
CONF_TO = "to"
CONF_STATE = "state"
CONF_FOR = "for"
CONF_ENTITY_ID = 'entity_id'
CONF_FROM = 'from'
CONF_TO = 'to'
TRIGGER_SCHEMA = vol.All(
vol.Schema({
vol.Required(CONF_PLATFORM): 'state',
vol.Required(CONF_ENTITY_ID): cv.entity_ids,
# These are str on purpose. Want to catch YAML conversions
CONF_FROM: str,
CONF_TO: str,
CONF_STATE: str,
CONF_FOR: vol.All(cv.time_period, cv.positive_timedelta),
}),
vol.Any(cv.key_dependency(CONF_FOR, CONF_TO),
cv.key_dependency(CONF_FOR, CONF_STATE))
)
TRIGGER_SCHEMA = vol.All(vol.Schema({
vol.Required(CONF_PLATFORM): 'state',
vol.Required(CONF_ENTITY_ID): cv.entity_ids,
# These are str on purpose. Want to catch YAML conversions
vol.Optional(CONF_FROM): str,
vol.Optional(CONF_TO): str,
vol.Optional(CONF_FOR): vol.All(cv.time_period, cv.positive_timedelta),
}), cv.key_dependency(CONF_FOR, CONF_TO))
@asyncio.coroutine
@@ -40,29 +32,15 @@ def async_trigger(hass, config, action):
"""Listen for state changes based on configuration."""
entity_id = config.get(CONF_ENTITY_ID)
from_state = config.get(CONF_FROM, MATCH_ALL)
to_state = config.get(CONF_TO) or config.get(CONF_STATE) or MATCH_ALL
to_state = config.get(CONF_TO, MATCH_ALL)
time_delta = config.get(CONF_FOR)
async_remove_state_for_cancel = None
async_remove_state_for_listener = None
@callback
def clear_listener():
"""Clear all unsub listener."""
nonlocal async_remove_state_for_cancel, async_remove_state_for_listener
# pylint: disable=not-callable
if async_remove_state_for_listener is not None:
async_remove_state_for_listener()
async_remove_state_for_listener = None
if async_remove_state_for_cancel is not None:
async_remove_state_for_cancel()
async_remove_state_for_cancel = None
match_all = (from_state == MATCH_ALL and to_state == MATCH_ALL)
unsub_track_same = {}
@callback
def state_automation_listener(entity, from_s, to_s):
"""Listen for state changes and calls action."""
nonlocal async_remove_state_for_cancel, async_remove_state_for_listener
@callback
def call_action():
"""Call action with right context."""
hass.async_run_job(action, {
@@ -75,33 +53,19 @@ def async_trigger(hass, config, action):
}
})
if time_delta is None:
# Ignore changes to state attributes if from/to is in use
if (not match_all and from_s is not None and to_s is not None and
from_s.state == to_s.state):
return
if not time_delta:
call_action()
return
@callback
def state_for_listener(now):
"""Fire on state changes after a delay and calls action."""
nonlocal async_remove_state_for_listener
async_remove_state_for_listener = None
clear_listener()
call_action()
@callback
def state_for_cancel_listener(entity, inner_from_s, inner_to_s):
"""Fire on changes and cancel for listener if changed."""
if inner_to_s.state == to_s.state:
return
clear_listener()
# cleanup previous listener
clear_listener()
async_remove_state_for_listener = async_track_point_in_utc_time(
hass, state_for_listener, dt_util.utcnow() + time_delta)
async_remove_state_for_cancel = async_track_state_change(
hass, entity, state_for_cancel_listener)
unsub_track_same[entity] = async_track_same_state(
hass, time_delta, call_action,
lambda _, _2, to_state: to_state.state == to_s.state,
entity_ids=entity_id)
unsub = async_track_state_change(
hass, entity_id, state_automation_listener, from_state, to_state)
@@ -110,6 +74,8 @@ def async_trigger(hass, config, action):
def async_remove():
"""Remove state listeners async."""
unsub()
clear_listener()
for async_remove in unsub_track_same.values():
async_remove()
unsub_track_same.clear()
return async_remove

View File

@@ -2,7 +2,7 @@
Offer sun based automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#sun-trigger
at https://home-assistant.io/docs/automation/trigger/#sun-trigger
"""
import asyncio
from datetime import timedelta
@@ -16,8 +16,6 @@ from homeassistant.const import (
from homeassistant.helpers.event import async_track_sunrise, async_track_sunset
import homeassistant.helpers.config_validation as cv
DEPENDENCIES = ['sun']
_LOGGER = logging.getLogger(__name__)
TRIGGER_SCHEMA = vol.Schema({
@@ -44,8 +42,6 @@ def async_trigger(hass, config, action):
},
})
# Do something to call action
if event == SUN_EVENT_SUNRISE:
return async_track_sunrise(hass, call_action, offset)
else:
return async_track_sunset(hass, call_action, offset)
return async_track_sunset(hass, call_action, offset)

View File

@@ -2,7 +2,7 @@
Offer template automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#template-trigger
at https://home-assistant.io/docs/automation/trigger/#template-trigger
"""
import asyncio
import logging

View File

@@ -2,7 +2,7 @@
Offer time listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#time-trigger
at https://home-assistant.io/docs/automation/trigger/#time-trigger
"""
import asyncio
import logging
@@ -10,32 +10,31 @@ import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_AFTER, CONF_PLATFORM
from homeassistant.const import CONF_AT, CONF_PLATFORM
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import async_track_time_change
CONF_HOURS = "hours"
CONF_MINUTES = "minutes"
CONF_SECONDS = "seconds"
CONF_HOURS = 'hours'
CONF_MINUTES = 'minutes'
CONF_SECONDS = 'seconds'
_LOGGER = logging.getLogger(__name__)
TRIGGER_SCHEMA = vol.All(vol.Schema({
vol.Required(CONF_PLATFORM): 'time',
CONF_AFTER: cv.time,
CONF_AT: cv.time,
CONF_HOURS: vol.Any(vol.Coerce(int), vol.Coerce(str)),
CONF_MINUTES: vol.Any(vol.Coerce(int), vol.Coerce(str)),
CONF_SECONDS: vol.Any(vol.Coerce(int), vol.Coerce(str)),
}), cv.has_at_least_one_key(CONF_HOURS, CONF_MINUTES,
CONF_SECONDS, CONF_AFTER))
}), cv.has_at_least_one_key(CONF_HOURS, CONF_MINUTES, CONF_SECONDS, CONF_AT))
@asyncio.coroutine
def async_trigger(hass, config, action):
"""Listen for state changes based on configuration."""
if CONF_AFTER in config:
after = config.get(CONF_AFTER)
hours, minutes, seconds = after.hour, after.minute, after.second
if CONF_AT in config:
at_time = config.get(CONF_AT)
hours, minutes, seconds = at_time.hour, at_time.minute, at_time.second
else:
hours = config.get(CONF_HOURS)
minutes = config.get(CONF_MINUTES)

View File

@@ -2,7 +2,7 @@
Offer zone automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/components/automation/#zone-trigger
at https://home-assistant.io/docs/automation/trigger/#zone-trigger
"""
import asyncio
import voluptuous as vol
@@ -14,8 +14,8 @@ from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers import (
condition, config_validation as cv, location)
EVENT_ENTER = "enter"
EVENT_LEAVE = "leave"
EVENT_ENTER = 'enter'
EVENT_LEAVE = 'leave'
DEFAULT_EVENT = EVENT_ENTER
TRIGGER_SCHEMA = vol.Schema({

View File

@@ -0,0 +1,302 @@
"""
Support for Axis devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/axis/
"""
import logging
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_AXIS
from homeassistant.const import (
ATTR_LOCATION, ATTR_TRIPPED, CONF_EVENT, CONF_HOST, CONF_INCLUDE,
CONF_NAME, CONF_PASSWORD, CONF_PORT, CONF_TRIGGER_TIME, CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP)
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import discovery
from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers.entity import Entity
from homeassistant.util.json import load_json, save_json
REQUIREMENTS = ['axis==14']
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'axis'
CONFIG_FILE = 'axis.conf'
AXIS_DEVICES = {}
EVENT_TYPES = ['motion', 'vmd3', 'pir', 'sound',
'daynight', 'tampering', 'input']
PLATFORMS = ['camera']
AXIS_INCLUDE = EVENT_TYPES + PLATFORMS
AXIS_DEFAULT_HOST = '192.168.0.90'
AXIS_DEFAULT_USERNAME = 'root'
AXIS_DEFAULT_PASSWORD = 'pass'
DEVICE_SCHEMA = vol.Schema({
vol.Required(CONF_INCLUDE):
vol.All(cv.ensure_list, [vol.In(AXIS_INCLUDE)]),
vol.Optional(CONF_NAME): cv.string,
vol.Optional(CONF_HOST, default=AXIS_DEFAULT_HOST): cv.string,
vol.Optional(CONF_USERNAME, default=AXIS_DEFAULT_USERNAME): cv.string,
vol.Optional(CONF_PASSWORD, default=AXIS_DEFAULT_PASSWORD): cv.string,
vol.Optional(CONF_TRIGGER_TIME, default=0): cv.positive_int,
vol.Optional(CONF_PORT, default=80): cv.positive_int,
vol.Optional(ATTR_LOCATION, default=''): cv.string,
})
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
cv.slug: DEVICE_SCHEMA,
}),
}, extra=vol.ALLOW_EXTRA)
SERVICE_VAPIX_CALL = 'vapix_call'
SERVICE_VAPIX_CALL_RESPONSE = 'vapix_call_response'
SERVICE_CGI = 'cgi'
SERVICE_ACTION = 'action'
SERVICE_PARAM = 'param'
SERVICE_DEFAULT_CGI = 'param.cgi'
SERVICE_DEFAULT_ACTION = 'update'
SERVICE_SCHEMA = vol.Schema({
vol.Required(CONF_NAME): cv.string,
vol.Required(SERVICE_PARAM): cv.string,
vol.Optional(SERVICE_CGI, default=SERVICE_DEFAULT_CGI): cv.string,
vol.Optional(SERVICE_ACTION, default=SERVICE_DEFAULT_ACTION): cv.string,
})
def request_configuration(hass, config, name, host, serialnumber):
"""Request configuration steps from the user."""
configurator = hass.components.configurator
def configuration_callback(callback_data):
"""Call when configuration is submitted."""
if CONF_INCLUDE not in callback_data:
configurator.notify_errors(
request_id, "Functionality mandatory.")
return False
callback_data[CONF_INCLUDE] = callback_data[CONF_INCLUDE].split()
callback_data[CONF_HOST] = host
if CONF_NAME not in callback_data:
callback_data[CONF_NAME] = name
try:
device_config = DEVICE_SCHEMA(callback_data)
except vol.Invalid:
configurator.notify_errors(
request_id, "Bad input, please check spelling.")
return False
if setup_device(hass, config, device_config):
del device_config['events']
del device_config['signal']
config_file = load_json(hass.config.path(CONFIG_FILE))
config_file[serialnumber] = dict(device_config)
save_json(hass.config.path(CONFIG_FILE), config_file)
configurator.request_done(request_id)
else:
configurator.notify_errors(
request_id, "Failed to register, please try again.")
return False
title = '{} ({})'.format(name, host)
request_id = configurator.request_config(
title, configuration_callback,
description='Functionality: ' + str(AXIS_INCLUDE),
entity_picture="/static/images/logo_axis.png",
link_name='Axis platform documentation',
link_url='https://home-assistant.io/components/axis/',
submit_caption="Confirm",
fields=[
{'id': CONF_NAME,
'name': "Device name",
'type': 'text'},
{'id': CONF_USERNAME,
'name': "User name",
'type': 'text'},
{'id': CONF_PASSWORD,
'name': 'Password',
'type': 'password'},
{'id': CONF_INCLUDE,
'name': "Device functionality (space separated list)",
'type': 'text'},
{'id': ATTR_LOCATION,
'name': "Physical location of device (optional)",
'type': 'text'},
{'id': CONF_PORT,
'name': "HTTP port (default=80)",
'type': 'number'},
{'id': CONF_TRIGGER_TIME,
'name': "Sensor update interval (optional)",
'type': 'number'},
]
)
def setup(hass, config):
"""Set up for Axis devices."""
def _shutdown(call):
"""Stop the event stream on shutdown."""
for serialnumber, device in AXIS_DEVICES.items():
_LOGGER.info("Stopping event stream for %s.", serialnumber)
device.stop()
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, _shutdown)
def axis_device_discovered(service, discovery_info):
"""Call when axis devices has been found."""
host = discovery_info[CONF_HOST]
name = discovery_info['hostname']
serialnumber = discovery_info['properties']['macaddress']
if serialnumber not in AXIS_DEVICES:
config_file = load_json(hass.config.path(CONFIG_FILE))
if serialnumber in config_file:
# Device config previously saved to file
try:
device_config = DEVICE_SCHEMA(config_file[serialnumber])
device_config[CONF_HOST] = host
except vol.Invalid as err:
_LOGGER.error("Bad data from %s. %s", CONFIG_FILE, err)
return False
if not setup_device(hass, config, device_config):
_LOGGER.error(
"Couldn't set up %s", device_config[CONF_NAME])
else:
# New device, create configuration request for UI
request_configuration(hass, config, name, host, serialnumber)
else:
# Device already registered, but on a different IP
device = AXIS_DEVICES[serialnumber]
device.config.host = host
dispatcher_send(hass, DOMAIN + '_' + device.name + '_new_ip', host)
# Register discovery service
discovery.listen(hass, SERVICE_AXIS, axis_device_discovered)
if DOMAIN in config:
for device in config[DOMAIN]:
device_config = config[DOMAIN][device]
if CONF_NAME not in device_config:
device_config[CONF_NAME] = device
if not setup_device(hass, config, device_config):
_LOGGER.error("Couldn't set up %s", device_config[CONF_NAME])
def vapix_service(call):
"""Service to send a message."""
for _, device in AXIS_DEVICES.items():
if device.name == call.data[CONF_NAME]:
response = device.vapix.do_request(
call.data[SERVICE_CGI],
call.data[SERVICE_ACTION],
call.data[SERVICE_PARAM])
hass.bus.fire(SERVICE_VAPIX_CALL_RESPONSE, response)
return True
_LOGGER.info("Couldn't find device %s", call.data[CONF_NAME])
return False
# Register service with Home Assistant.
hass.services.register(
DOMAIN, SERVICE_VAPIX_CALL, vapix_service, schema=SERVICE_SCHEMA)
return True
def setup_device(hass, config, device_config):
"""Set up an Axis device."""
from axis import AxisDevice
def signal_callback(action, event):
"""Call to configure events when initialized on event stream."""
if action == 'add':
event_config = {
CONF_EVENT: event,
CONF_NAME: device_config[CONF_NAME],
ATTR_LOCATION: device_config[ATTR_LOCATION],
CONF_TRIGGER_TIME: device_config[CONF_TRIGGER_TIME]
}
component = event.event_platform
discovery.load_platform(
hass, component, DOMAIN, event_config, config)
event_types = list(filter(lambda x: x in device_config[CONF_INCLUDE],
EVENT_TYPES))
device_config['events'] = event_types
device_config['signal'] = signal_callback
device = AxisDevice(hass.loop, **device_config)
device.name = device_config[CONF_NAME]
if device.serial_number is None:
# If there is no serial number a connection could not be made
_LOGGER.error("Couldn't connect to %s", device_config[CONF_HOST])
return False
for component in device_config[CONF_INCLUDE]:
if component == 'camera':
camera_config = {
CONF_NAME: device_config[CONF_NAME],
CONF_HOST: device_config[CONF_HOST],
CONF_PORT: device_config[CONF_PORT],
CONF_USERNAME: device_config[CONF_USERNAME],
CONF_PASSWORD: device_config[CONF_PASSWORD]
}
discovery.load_platform(
hass, component, DOMAIN, camera_config, config)
AXIS_DEVICES[device.serial_number] = device
if event_types:
hass.add_job(device.start)
return True
class AxisDeviceEvent(Entity):
"""Representation of a Axis device event."""
def __init__(self, event_config):
"""Initialize the event."""
self.axis_event = event_config[CONF_EVENT]
self._name = '{}_{}_{}'.format(
event_config[CONF_NAME], self.axis_event.event_type,
self.axis_event.id)
self.location = event_config[ATTR_LOCATION]
self.axis_event.callback = self._update_callback
def _update_callback(self):
"""Update the sensor's state, if needed."""
self.schedule_update_ha_state(True)
@property
def name(self):
"""Return the name of the event."""
return self._name
@property
def device_class(self):
"""Return the class of the event."""
return self.axis_event.event_class
@property
def should_poll(self):
"""Return the polling state. No polling needed."""
return False
@property
def device_state_attributes(self):
"""Return the state attributes of the event."""
attr = {}
tripped = self.axis_event.is_tripped
attr[ATTR_TRIPPED] = 'True' if tripped else 'False'
attr[ATTR_LOCATION] = self.location
return attr

View File

@@ -16,7 +16,6 @@ _LOGGER = logging.getLogger(__name__)
DOMAIN = 'bbb_gpio'
# pylint: disable=no-member
def setup(hass, config):
"""Set up the BeagleBone Black GPIO component."""
# pylint: disable=import-error
@@ -34,41 +33,39 @@ def setup(hass, config):
return True
# noqa: F821
def setup_output(pin):
"""Setup a GPIO as output."""
# pylint: disable=import-error,undefined-variable
"""Set up a GPIO as output."""
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
GPIO.setup(pin, GPIO.OUT)
def setup_input(pin, pull_mode):
"""Setup a GPIO as input."""
# pylint: disable=import-error,undefined-variable
"""Set up a GPIO as input."""
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
GPIO.setup(pin, GPIO.IN, # noqa: F821
GPIO.PUD_DOWN if pull_mode == 'DOWN' # noqa: F821
else GPIO.PUD_UP) # noqa: F821
GPIO.setup(pin, GPIO.IN,
GPIO.PUD_DOWN if pull_mode == 'DOWN'
else GPIO.PUD_UP)
def write_output(pin, value):
"""Write a value to a GPIO."""
# pylint: disable=import-error,undefined-variable
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
GPIO.output(pin, value)
def read_input(pin):
"""Read a value from a GPIO."""
# pylint: disable=import-error,undefined-variable
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
return GPIO.input(pin) is GPIO.HIGH
def edge_detect(pin, event_callback, bounce):
"""Add detection for RISING and FALLING events."""
# pylint: disable=import-error,undefined-variable
# pylint: disable=import-error
import Adafruit_BBIO.GPIO as GPIO
GPIO.add_event_detect(
pin, GPIO.BOTH, callback=event_callback, bouncetime=bounce)

View File

@@ -4,7 +4,7 @@ Component to interface with binary sensors.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/binary_sensor/
"""
import asyncio
from datetime import timedelta
import logging
@@ -14,50 +14,65 @@ from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.entity import Entity
from homeassistant.const import (STATE_ON, STATE_OFF)
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa
from homeassistant.helpers.deprecation import deprecated_substitute
DOMAIN = 'binary_sensor'
SCAN_INTERVAL = timedelta(seconds=30)
ENTITY_ID_FORMAT = DOMAIN + '.{}'
DEVICE_CLASSES = [
'cold', # On means cold (or too cold)
'connectivity', # On means connection present, Off = no connection
'gas', # CO, CO2, etc.
'heat', # On means hot (or too hot)
'light', # Lightness threshold
'moisture', # Specifically a wetness sensor
'motion', # Motion sensor
'moving', # On means moving, Off means stopped
'occupancy', # On means occupied, Off means not occupied
'opening', # Door, window, etc.
'power', # Power, over-current, etc
'safety', # Generic on=unsafe, off=safe
'smoke', # Smoke detector
'sound', # On means sound detected, Off means no sound
'battery', # On means low, Off means normal
'cold', # On means cold, Off means normal
'connectivity', # On means connected, Off means disconnected
'door', # On means open, Off means closed
'garage_door', # On means open, Off means closed
'gas', # On means gas detected, Off means no gas (clear)
'heat', # On means hot, Off means normal
'light', # On means light detected, Off means no light
'lock', # On means open (unlocked), Off means closed (locked)
'moisture', # On means wet, Off means dry
'motion', # On means motion detected, Off means no motion (clear)
'moving', # On means moving, Off means not moving (stopped)
'occupancy', # On means occupied, Off means not occupied (clear)
'opening', # On means open, Off means closed
'plug', # On means plugged in, Off means unplugged
'power', # On means power detected, Off means no power
'presence', # On means home, Off means away
'problem', # On means problem detected, Off means no problem (OK)
'safety', # On means unsafe, Off means safe
'smoke', # On means smoke detected, Off means no smoke (clear)
'sound', # On means sound detected, Off means no sound (clear)
'vibration', # On means vibration detected, Off means no vibration
'window', # On means open, Off means closed
]
DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.In(DEVICE_CLASSES))
@asyncio.coroutine
def async_setup(hass, config):
async def async_setup(hass, config):
"""Track states and offer events for binary sensors."""
component = EntityComponent(
component = hass.data[DOMAIN] = EntityComponent(
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL)
yield from component.async_setup(config)
await component.async_setup(config)
return True
# pylint: disable=no-self-use
async def async_setup_entry(hass, entry):
"""Setup a config entry."""
return await hass.data[DOMAIN].async_setup_entry(entry)
async def async_unload_entry(hass, entry):
"""Unload a config entry."""
return await hass.data[DOMAIN].async_unload_entry(entry)
class BinarySensorDevice(Entity):
"""Represent a binary sensor."""
@property
def is_on(self):
"""Return True if the binary sensor is on."""
"""Return true if the binary sensor is on."""
return None
@property
@@ -66,7 +81,6 @@ class BinarySensorDevice(Entity):
return STATE_ON if self.is_on else STATE_OFF
@property
@deprecated_substitute('sensor_class')
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
return None

View File

@@ -0,0 +1,74 @@
"""
This component provides HA binary_sensor support for Abode Security System.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.abode/
"""
import logging
from homeassistant.components.abode import (AbodeDevice, AbodeAutomation,
DOMAIN as ABODE_DOMAIN)
from homeassistant.components.binary_sensor import BinarySensorDevice
DEPENDENCIES = ['abode']
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, 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_devices(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,84 @@
"""
Support for ADS binary sensors.
For more details about this platform, please refer to the documentation.
https://home-assistant.io/components/binary_sensor.ads/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components.ads import CONF_ADS_VAR, DATA_ADS
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
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'ADS binary sensor'
DEPENDENCIES = ['ads']
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_devices, 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_devices([ads_sensor])
class AdsBinarySensor(BinarySensorDevice):
"""Representation of ADS binary sensors."""
def __init__(self, ads_hub, name, ads_var, device_class):
"""Initialize ADS binary sensor."""
self._name = name
self._state = False
self._device_class = device_class or 'moving'
self._ads_hub = ads_hub
self.ads_var = ads_var
@asyncio.coroutine
def async_added_to_hass(self):
"""Register device notification."""
def update(name, value):
"""Handle device notifications."""
_LOGGER.debug('Variable %s changed its value to %d', name, value)
self._state = value
self.schedule_update_ha_state()
self.hass.async_add_job(
self._ads_hub.add_device_notification,
self.ads_var, self._ads_hub.PLCTYPE_BOOL, update)
@property
def name(self):
"""Return the default name of the binary sensor."""
return self._name
@property
def device_class(self):
"""Return the device class."""
return self._device_class
@property
def is_on(self):
"""Return if the binary sensor is on."""
return self._state
@property
def should_poll(self):
"""Return False because entity pushes its state to HA."""
return False

View File

@@ -0,0 +1,124 @@
"""
Support for AlarmDecoder zone states- represented as binary sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.alarmdecoder/
"""
import asyncio
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.alarmdecoder import (
ZONE_SCHEMA, CONF_ZONES, CONF_ZONE_NAME, CONF_ZONE_TYPE,
CONF_ZONE_RFID, SIGNAL_ZONE_FAULT, SIGNAL_ZONE_RESTORE,
SIGNAL_RFX_MESSAGE)
DEPENDENCIES = ['alarmdecoder']
_LOGGER = logging.getLogger(__name__)
ATTR_RF_BIT0 = 'rf_bit0'
ATTR_RF_LOW_BAT = 'rf_low_battery'
ATTR_RF_SUPERVISED = 'rf_supervised'
ATTR_RF_BIT3 = 'rf_bit3'
ATTR_RF_LOOP3 = 'rf_loop3'
ATTR_RF_LOOP2 = 'rf_loop2'
ATTR_RF_LOOP4 = 'rf_loop4'
ATTR_RF_LOOP1 = 'rf_loop1'
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the AlarmDecoder binary sensor devices."""
configured_zones = discovery_info[CONF_ZONES]
devices = []
for zone_num in configured_zones:
device_config_data = ZONE_SCHEMA(configured_zones[zone_num])
zone_type = device_config_data[CONF_ZONE_TYPE]
zone_name = device_config_data[CONF_ZONE_NAME]
zone_rfid = device_config_data.get(CONF_ZONE_RFID)
device = AlarmDecoderBinarySensor(
zone_num, zone_name, zone_type, zone_rfid)
devices.append(device)
add_devices(devices)
return True
class AlarmDecoderBinarySensor(BinarySensorDevice):
"""Representation of an AlarmDecoder binary sensor."""
def __init__(self, zone_number, zone_name, zone_type, zone_rfid):
"""Initialize the binary_sensor."""
self._zone_number = zone_number
self._zone_type = zone_type
self._state = None
self._name = zone_name
self._rfid = zone_rfid
self._rfstate = None
@asyncio.coroutine
def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
SIGNAL_ZONE_FAULT, self._fault_callback)
self.hass.helpers.dispatcher.async_dispatcher_connect(
SIGNAL_ZONE_RESTORE, self._restore_callback)
self.hass.helpers.dispatcher.async_dispatcher_connect(
SIGNAL_RFX_MESSAGE, self._rfx_message_callback)
@property
def name(self):
"""Return the name of the entity."""
return self._name
@property
def should_poll(self):
"""No polling needed."""
return False
@property
def device_state_attributes(self):
"""Return the state attributes."""
attr = {}
if self._rfid and self._rfstate is not None:
attr[ATTR_RF_BIT0] = True if self._rfstate & 0x01 else False
attr[ATTR_RF_LOW_BAT] = True if self._rfstate & 0x02 else False
attr[ATTR_RF_SUPERVISED] = True if self._rfstate & 0x04 else False
attr[ATTR_RF_BIT3] = True if self._rfstate & 0x08 else False
attr[ATTR_RF_LOOP3] = True if self._rfstate & 0x10 else False
attr[ATTR_RF_LOOP2] = True if self._rfstate & 0x20 else False
attr[ATTR_RF_LOOP4] = True if self._rfstate & 0x40 else False
attr[ATTR_RF_LOOP1] = True if self._rfstate & 0x80 else False
return attr
@property
def is_on(self):
"""Return true if sensor is on."""
return self._state == 1
@property
def device_class(self):
"""Return the class of this sensor, from DEVICE_CLASSES."""
return self._zone_type
def _fault_callback(self, zone):
"""Update the zone's state, if needed."""
if zone is None or int(zone) == self._zone_number:
self._state = 1
self.schedule_update_ha_state()
def _restore_callback(self, zone):
"""Update the zone's state, if needed."""
if zone is None or int(zone) == self._zone_number:
self._state = 0
self.schedule_update_ha_state()
def _rfx_message_callback(self, message):
"""Update RF state."""
if self._rfid and message and message.serial_number == self._rfid:
self._rfstate = message.value
self.schedule_update_ha_state()

View File

@@ -15,7 +15,7 @@ DEPENDENCIES = ['android_ip_webcam']
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Setup IP Webcam binary sensors."""
"""Set up the IP Webcam binary sensors."""
if discovery_info is None:
return
@@ -28,7 +28,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
class IPWebcamBinarySensor(AndroidIPCamEntity, BinarySensorDevice):
"""Represents an IP Webcam binary sensor."""
"""Representation of an IP Webcam binary sensor."""
def __init__(self, name, host, ipcam, sensor):
"""Initialize the binary sensor."""
@@ -47,7 +47,7 @@ class IPWebcamBinarySensor(AndroidIPCamEntity, BinarySensorDevice):
@property
def is_on(self):
"""True if the binary sensor is on."""
"""Return true if the binary sensor is on."""
return self._state
@asyncio.coroutine

Some files were not shown because too many files have changed in this diff Show More