Commit Graph

3002 Commits (c3c92232da042392cb7a49c993ceed499260e0ca)

Author SHA1 Message Date
Frank db277ad023 Add data/data_template/title to alert component (#17616)
* Add data/data_template/title to alert component

* Fix line length

* Fix tests

* Fix lint

* fix line length

* Fix tests, make title templatable

* Fix test

* Fix test

* Optimize data, make title templated

* Fix line length

* Add title template

* typo

* Fix tests
2019-01-23 08:47:37 +01:00
Paulus Schoutsen e964750ac1
Fix invalid entity ID in entity registry (#20328) 2019-01-22 14:07:17 -08:00
Mattias Welponer 89ba374d51 HomematicIP add cover FROLL and BROLL devices (#19794)
* Add cover FROLL and BROLL devices

* Fix import

* Fix async calls

* Update cover functions and async fixes

* Update test

* Cleanup code

* Update header

* Merge imports

* Update

* Remove init

* Update coveragerc file

* Update coveragerc
2019-01-22 09:22:45 +01:00
krygal a8ef7a2774 Add device tracker support for EE Brightbox 2 router (#19611)
* Added device tracker support for EE Brightbox 2

* removed timeago dependency

* get scanner checks and improved tests

* fixed lint issues

* removed redundant timeago from test requirements

* fixed variable naming in test

* removed unecessary blank line
2019-01-22 09:16:35 +01:00
Andrew Sayre bb21cb6c89 Remove trailing slash from base_url and added ability to generate webhook path. (#20295) 2019-01-21 20:50:41 +01:00
Johann Kellerman c36c708068 Align valid_entity_id with new slugify (#20231)
* slug

* ensure a dot

* fix

* schema_with_slug_keys

* lint

* test
2019-01-21 09:45:11 -08:00
Jon Caruana 9482a6303d Add EverLights light component (#19817)
* EverLights light integration. Supports single color (with color and brightness parameters) or saved pattern (with effect parameter).

* Fix pylint parameter name warning.

* Code review feedback.

* Add tests for the two helper functions of EverLights component.

* Fixes for review feedback.

* Change test style.

* Style fixes for hound.
2019-01-21 04:23:36 +01:00
Phil Bruckner 935e5c67a3 Handle non-string values in JSON renderer (#20233)
Handle the case of async_render_with_possible_json_value's value argument
being something other than a string. This can happen, e.g., when using the
SQL sensor to extract a datetime column such as last_changed and also using
its value_template to convert that datetime to another format. This was
causing a TypeError from json.loads, but async_render_with_possible_json_value
was only catching ValueError's.
2019-01-20 16:46:14 -08:00
emontnemery 3fcbcd5a38 Add JSON attribute topic to MQTT alarm (#20238) 2019-01-20 16:42:56 -08:00
emontnemery dbba3eb0d4 Add JSON attribute topic to MQTT climate (#20239) 2019-01-20 16:42:35 -08:00
emontnemery 89e9d827a2 Add JSON attribute topic to MQTT fan (#20240) 2019-01-20 16:42:17 -08:00
emontnemery ab4e4787e3 Add JSON attribute topic to MQTT lock (#20241) 2019-01-20 16:41:50 -08:00
Paulus Schoutsen b6e1675c46
Add JSON attribute topic to MQTT vacuum (#20242) 2019-01-20 16:36:24 -08:00
Anders Melchiorsen 62844e237c Allow 'all' entity_id in service schema (#20278) 2019-01-20 16:33:39 -08:00
Anders Melchiorsen 1218127d83 Fix 'all' entity_id in service call extraction (#20281) 2019-01-20 16:33:11 -08:00
Erik 5b8f64093b Add JSON attribute topic to MQTT vacuum 2019-01-19 11:58:21 +01:00
Rohan Kapoor 84b1fcbc36 Add verify_ssl to restful_command and switch.rest (#20199) (#20207) 2019-01-18 13:42:52 +01:00
emontnemery 6800871c13 Log exceptions thrown by signal callbacks (#20015)
* Log exceptions thrown by signal callbacks

* Fix unsub

* Simplify traceback print

* Typing

* Add test

* lint

* Review comments

* Rework MQTT test case

* Fix bad merge

* Fix bad merge
2019-01-17 14:44:57 -08:00
emontnemery f094a7369d Add JSON attribute topic to MQTT switch (#20192) 2019-01-17 10:55:22 -08:00
emontnemery 234f348ba1 Add JSON attribute topic to MQTT light (#20191) 2019-01-17 10:54:22 -08:00
emontnemery d1c6eb4f3e Add JSON attribute topic to MQTT cover (#20190)
* Add JSON attribute topic to MQTT cover

* Lint
2019-01-17 10:53:52 -08:00
Paulus Schoutsen 0fe5d567a2 Add command to refresh auth (#20183) 2019-01-17 19:33:01 +01:00
Paulus Schoutsen 84a2e5d8fb Strip login username in backend (#20150)
* Add modern mode to HA auth provider that strips usernames

* Add tests for async_get_or_create_credentials

* Fix test
2019-01-16 15:03:05 -08:00
Fabian Affolter 9bb7e40ee3 Upgrade aiohttp to 3.5.3 (#19957)
* Upgrade aiohttp to 3.5.3

* Upgrade aiohttp to 3.5.4

* Remove test for webhook component from camera.push

* Lint
2019-01-16 14:23:46 -08:00
emontnemery 368682647d Log exceptions thrown by MQTT message callbacks (#19977)
* Log exceptions thrown by MQTT message callbacks

* Fix tests

* Correct method for skipping wrapper in traceback

* Lint

* Simplify traceback print

* Add test

* Move wrapper to common helper function

* Typing

* Lint
2019-01-16 13:50:21 -08:00
Paulus Schoutsen 1d86905d5b
Switch locative to use the webhook component (#20043)
* Switch locative to use the webhook component

* Lint

* Remove dead test code

* Use voluptuous to validate the webhook schema

* Validate test mode schema as well

* Lint

* Remove allow_extra

* Return web.Response correctly

* #20043: Remove superfluous dict in WEBHOOK_SCHEMA validation
2019-01-16 11:08:42 -08:00
Rohan Kapoor b5bfc759ec Migrate gpslogger to the automatically generated webhook (#20079)
* Migrate gpslogger to the automatically generated webhook

* Lint

* Lint and return error code
2019-01-16 10:56:25 -08:00
Nikolay Vasilchuk 075b575bde Support device_class for rest sensor (#20132)
* Ready

* Tests fixed
2019-01-16 10:03:53 -08:00
Anders Melchiorsen c218757336 Accept both domains and entities in influxdb include (#19927)
* Accept both domains and entities in influxdb include

* Explicit test

* Remove lint
2019-01-15 16:20:51 -08:00
Fabian Affolter 25f6302813 Switch to ipapi.co (fixes #19846) (#19886)
* Switch to ipapi.co (fixes #19846)

* Fix name

* Update name
2019-01-15 16:18:57 -08:00
Rohan Kapoor f36755e447 Switch geofency tests to using an unauthenticated HTTP client (#20080) 2019-01-15 16:11:30 -08:00
Paulus Schoutsen 9fd21d20ae
Fix loading translations for embedded platforms (#20122)
* Fix loading translations for embedded platforms

* Update doc string

* Lint
2019-01-15 16:06:04 -08:00
Tommy Jonsson 1b79872dd6 Add notify.html5_dismiss service (#19912)
* Add notify.html5_dismiss service

* fix test

* add can_dismiss

* fix service data payload

* fix hasattr -> getattr

* fixes

* move dismiss service to html5

* fix services.yaml

* fix line to long
2019-01-15 15:31:57 -08:00
starkillerOG 11602c1da0 Improve Philips Hue color conversion 2 (#20118)
* Add gamut capability to color util

* Include gamut in hue_test

* Improve Philips Hue color conversion

* correct import for new location hue.light

* include file changes between PR's

* update aiohue version

* update aiohue version

* update aiohue version

* fix hue_test

Now Idea why it failed compared to the previous time

* Include gamut in hue_test

* fix hue_test

* Try to test hue gamut conversion

supply a color that is well outside the color gamut of the light, and see if the response is correctly converted to within the reach of the light.

* switch from gamut A to gamut B for the tests.

* remove white space in blanck line

* Fix gamut hue test

* Add Gamut tests for the util.color

* fix hue gamut test

* fix hue gamut test

* Improve Philips Hue color conversion
2019-01-15 11:30:50 -08:00
Robert Svensson a3f0d55737
Change deCONZ to embedded platforms (#20113)
Move all platforms into components/deconz
2019-01-15 19:29:56 +01:00
Adam Mills 336b6adc88 Split time_pattern triggers from time trigger (#19825)
* Split interval triggers from time trigger

* Default smaller interval units to zero

* Rename interval to schedule

* Rename schedule to time_pattern
2019-01-15 09:33:34 -08:00
emontnemery 5b53bd6aa0
Move MQTT platforms under the component (#20050)
* Move MQTT platforms under the component
2019-01-15 17:31:06 +01:00
Fredrik Erlandsson c8d885fb78 Fix tellduslive discovery and auth issues (#20023)
* fix for #19954, discovered tellsticks shows up to be configured

* fix for #19954, authentication issues

* updated tests

* move I/O to executer thread pool

* Apply suggestions from code review

Co-Authored-By: fredrike <fredrik.e@gmail.com>
2019-01-15 06:36:17 +01:00
Andrew Sayre e73569c203 Added partial detection to async_add_job (#20119) 2019-01-14 15:08:44 -08:00
emontnemery 0f3b6f1739
Reconfigure MQTT lock component if discovery info is changed (#19468)
* Reconfigure MQTT lock component if discovery info is changed

* Use dict[key] for required config keys and keys with default config schema values.
2019-01-14 21:01:42 +01:00
Aaron Bach ef79566864 Adjust OpenUV integration for upcoming API limit changes (#19949)
* Adjust OpenUV integration for upcoming API limit changes

* Added fix for "Invalid API Key"

* Bugfix

* Add initial nighttime check

* Move from polling to a service-based model

* Fixed test

* Removed unnecessary scan interval

* Fixed test

* Moving test imports

* Member comments

* Hound

* Removed unused import
2019-01-14 13:12:06 +01:00
Rohan Kapoor 7f3871028d Split out gpslogger into a separate component and platform (#20044)
* Split out gpslogger into a separate component and platform

* Lint

* Lint

* Increase test coverage
2019-01-14 01:09:47 +01:00
Rohan Kapoor 3e325a4ef9 Remove dead test code 2019-01-12 20:24:55 -08:00
Rohan Kapoor 4e020b90e1 Switch locative to use the webhook component 2019-01-12 19:18:33 -08:00
Robert Svensson d3f2854c89
UniFi - Fix issue with POE switch reset switch config (#20021)
* Fix issue when controlling POE would reset configuration for all other ports on same device
2019-01-12 17:59:44 +01:00
Tommy Jonsson 3bdee57066 Support for html5 notifications to suggest their names (#19965)
* support for devices to suggest their names

* houndci fixes

* Lint
2019-01-11 20:44:29 -08:00
Paulus Schoutsen 6cba51fd0e Lint 2019-01-11 16:31:16 -08:00
Paulus Schoutsen 2ffadde0a3
Add Hass.io user headers to supervisor proxy (#19395)
* Add Hass.io user headers to supervisor proxy

* Update test_http.py

* Fix tests

* Update test_auth.py
2019-01-11 15:30:40 -08:00
Rohan Kapoor d820efc4e3 Split locative to a separate component (#19964)
* Split locative to a separate component

* Switch tests to use constants for http codes

* Fix tests
2019-01-11 15:14:11 -08:00
Paulus Schoutsen 578bfe9798 Fix fail2ban tests 2019-01-11 15:01:24 -08:00
Fredrik Erlandsson b9a488912a Add support for 'via_hub' for device_info (#19454)
* Add support for 'via_hub'

* Update config schema

* add domain to via_hub

* add tests for via_hub
2019-01-11 13:11:13 -08:00
Paulus Schoutsen 12d16d9bdc
Update test_auth.py 2019-01-11 12:55:23 -08:00
Antoine GRÉA 14dd8791ec Adding IPv6 to fail2ban sensor (#19457)
* Fixing fail2ban regex for ipv6

* Adding IPv6 tests for fail2ban

* Formating code for hound

* Formating again

* Formating again 2
2019-01-11 12:54:47 -08:00
Paulus Schoutsen a8f22287ca
Allow embedded platforms (#19948)
* Allow embedded platforms

* Fix test
2019-01-11 11:30:22 -08:00
Paulus Schoutsen b81260e912 Fix tests 2019-01-11 10:10:36 -08:00
Paulus Schoutsen 7be197b845 Update test_http.py 2019-01-11 10:00:38 -08:00
Paulus Schoutsen fd21d6cc9d Add Hass.io user headers to supervisor proxy 2019-01-11 10:00:38 -08:00
Paulus Schoutsen d812f23f6b
min_max sensor support for STATE_UNAVAILABLE (#19914) 2019-01-11 09:27:48 -08:00
mindigmarton 31d92683f7 Add emulated_roku component (#17596)
* Add emulated_roku component

* Add emulated_roku config tests

* Fix emulated_roku test dependencies

* Remove emulated_roku yaml support, add tests

* Add yaml support, simplify config flow

* Improve emulated_roku code quality

* Fix emulated_roku translation, improve code quality

* Fix emulated_roku translation

* Bump emulated_roku to 0.1.6 to fix SSDP discovery

* Bump emulated roku to 0.1.7, refactor component start/stop methods
2019-01-11 03:20:35 +01:00
Abílio Costa ca460ace5d Small refactoring for the alexa component (#19782)
* small refactoring

* fix tests
2019-01-10 17:39:49 -08:00
arigilder 4d187e08d4 Add sensors to jewish_calendar for upcoming Shabbat times (#19278)
* Initial pass of cleanup for shabbat_times

* Switch to async defs

* First pass of unit tests + fixture data

* Completion of first round of unit tests, 100% passing

* Unit tests for state restoring

* Style fixes

* More style fixes

* Lint fix

* Add upcoming candelighting and havdalah sensors

* Add unit tests, remove havdalah offset

* More unit tests + small bugfix for weekly_portion

* Add issur melacha sensor

* Remove old shabbat_times work-in-progress files

* Bump required version of hdate

* Add havdalah offset config parameter

* Bump hdate version required

* Pin hdate requirement

* Lint fixes

* Changes based on review + API changes for hdate 0.8.7

* Add three-day holiday unit tests

* Remove debugging line

* Add missing docstring

* Fix doc lint comment
2019-01-10 16:27:34 -08:00
Abílio Costa 6c29315088 Add Alexa's EndpointHealth reporting (#19784)
* add Health reports

* add health report for all devices

* update tests

* Update homeassistant/components/alexa/smart_home.py

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

* lint

* add tests
2019-01-10 15:52:21 -08:00
Jérôme Wiedemann e6a2c18430 min_max sensor support for STATE_UNAVAILABLE 2019-01-10 13:48:24 +01:00
Rohan Kapoor 2bdbf6955d Migrate geofency over to the Webhook component (#18951)
* Migrate geofency over to the Webhook component

* Return web.Response correctly

* Fix test

* Lint

* Fix error that tests caught
2019-01-08 20:47:05 -08:00
Florian Ludwig 23382ab199 assign user to websocket connection when using legacy_api_password (#19797) 2019-01-08 20:45:24 -08:00
Malte Franken 6d3343e4d1 Geo Location -> Geolocation (class names and unit test comments) (#19877)
* fixed geolocation naming in class names

* fixed geolocation naming in comments in unit test
2019-01-08 20:11:51 -08:00
Thomas Lovén f73bda1218 Allow other icon prefixes than mdi: (#19872) 2019-01-08 20:08:20 -08:00
emontnemery 0cea54cea1
Cleanup if discovered mqtt climate can't be added (#19739)
* Cleanup if discovered mqtt climate can't be added
2019-01-08 16:53:02 +01:00
emontnemery 203701bc7c
Cleanup if discovered mqtt fan can't be added (#19741)
* Cleanup if discovered mqtt fan can't be added
2019-01-08 16:51:03 +01:00
emontnemery 44f6151548
Cleanup if discovered mqtt alarm can't be added (#19742)
* Cleanup if discovered mqtt alarm can't be added
2019-01-08 16:49:47 +01:00
emontnemery 1a5fe3d880
Cleanup if discovered mqtt cover can't be added (#19743)
* Cleanup if discovered mqtt cover can't be added
2019-01-08 16:48:42 +01:00
emontnemery a62e514d8f
Merge pull request #19744 from emontnemery/mqtt_discovery_cleanup_binary_sensor
Cleanup if discovered mqtt binary_sensor can't be added
2019-01-08 16:47:36 +01:00
emontnemery f0f386e314
Cleanup if discovered mqtt sensor can't be added (#19745)
* Cleanup if discovered mqtt sensor can't be added

* No bare except

* Clear ALREADY_DISCOVERED list with helper
2019-01-08 16:46:26 +01:00
emontnemery bb37cf906c
Cleanup if discovered mqtt lock can't be added (#19746)
* Cleanup if discovered mqtt lock can't be added
2019-01-08 16:45:38 +01:00
Mickaël Schoentgen a57aae9891 Fix 2 ResourceWarning: unclosed file in test_ruamel_yaml.py (#19780)
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
2019-01-07 11:53:31 -05:00
emontnemery 0b57cfb004 Cleanup if discovered mqtt sensor can't be added 2019-01-07 17:03:10 +01:00
emontnemery d8370f44cb Cleanup if discovered mqtt binary_sensor can't be added 2019-01-07 17:00:03 +01:00
emontnemery dd75c49796
Cleanup if discovered mqtt switch can't be added (#19721)
* Cleanup if discovered mqtt switch can't be added
2019-01-07 16:57:51 +01:00
Tommy Jonsson 5b35317e1e [3/3] mqtt-vacuum device-registry (#19479)
* add device registry to mqtt-vacuum
2019-01-06 19:23:33 +01:00
Tommy Jonsson ccbc231d3a [2/3] vacuum mqtt-discovery (#19478)
* add discoverability to mqtt-vacuum
2019-01-06 17:05:04 +01:00
emontnemery 76c30aca38
Remove duplicated MQTT switch test case (#19799) 2019-01-06 06:27:57 +01:00
Eliseo Martelli 3a5ba77e04 Rename air pollutants to air quality (#19448)
* mv component folder

* moved in airquality

* changed names in files

* renamed test init

* renamed test air quality

* renamed in tests

* renamed coverage

* fixed naming

* corrected attr names

* changed attr names
2019-01-05 11:42:36 -05:00
Otto Winter 68723730a7
Add ESPHome native API discovery (#19399)
* ESPHome discovery

* Add note about netdisco

* 🔡

* Address comments

* Bump netdisco to 2.3.0

* Update requirements_all.txt
2019-01-05 16:00:07 +01:00
Austin Drummond fb5b5223fb Added zwave lock state from alarm type workaround (#18996)
Thank you 👍 

* added zwave lock state from alarm type workaround

* fixed test indents

* more linting fixes

* one more linting fix

* simplified logic

* fixed lint new lines

* fixed merge conflict issue

* fixed definition of _alarm_type_workaround in zwave lock
2019-01-05 09:59:43 +01:00
Otto Winter c7700ad11c Fix some ESPHome race conditions (#19772)
* Fix some ESPHome race conditions

* Remove debug

* Update requirements_all.txt

* 🚑 Fix IDE line length settings
2019-01-04 22:10:52 +01:00
Abílio Costa ead38f6005 Proactive Alexa ChangeReport messages (#18114)
* Alexa: implement auth and proactive ChangeReport messages

* refactor after rebase from dev to use the new AlexaDirective and Response classes

* move to aiohttp; cleanup

* better function name

* move endpoint to config

* allow passing token function

* remove uneeded state get

* use iterable directly

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

* missing delete from previous commit

* checks for when user has no auth config

* update cloud component

* PR suggestions

* string lint

* Revert "string lint"

This reverts commit a05a1f134c9ebc7a6e67c093009744f142256365.

* linters are now happier

* more happy linters

* use internal date parser; improve json response handling

* remove unused import

* use await instead of async_add_job

* protect access token update method

* add test_report_state

* line too long

* add docstring

* Update test_smart_home.py

* test accept grant api

* init prefs if None

* add tests for auth and token requests

* replace global with hass.data

* doc lint
2019-01-03 22:28:43 +01:00
Andrew Hayworth 87a0118082 Do not choke on no awair data (#19708)
* awair: do not choke on no data

The awair API returns an empty response for various air data queries
when a device is offline. The underlying library (python_awair) does
not directly inform us that a device is offline, since we really can
only infer it from an empty response - there is no online/offline
indicator in the graphql API.

So - we should just ensure that we do not attempt to update device state
from an empty response. This ensures that the platform does not crash
when starting up with offline devices, and also ensures that the
platform is marked unavailable once devices go offline.

* Fix typo

Further proof that coding after 10pm is rolling the dice.
2019-01-03 14:41:18 +01:00
Nick Whyte 5aa2bd81cf Add ness alarm control panel using nessclient (#18463)
* Add ness alarm control panel using nessclient

* indenting

* .

* Remove availability functionality, will improve and add back in another PR

* Use call_count

* lint

* lint

* Review changes

* Lint

* Bump nessclient to 0.9.8

* Bump nessclient to 0.9.9

* Remove from .coveragerc
2019-01-01 08:08:13 -07:00
Daniel Chesterton 61d5b3028d Add support for color_temp_command_template in MQTT light component (#19675)
* Add support for color_temp_command_template in MQTT light component
2019-01-01 15:42:41 +01:00
javicalle b9f4a7220e Improve rflink coverage (#19596)
* some minor tests refactor
* async/await refactor
* toggle have not brightness
* test for race condition in unknown device
* test for 'no_command' and 'not_connected'
* test for race condition in unknown device
* sensor events are handled in sensor devices, RflinkDevice handle
command events
* test race conditions & bogus entity remove
* two more tests
* Test race condition for unknown components
* Test cleanup for `commands events` and `sensor events`
2019-01-01 15:35:31 +01:00
Robin ff80fc347b Fix london_underground issue (#19642)
* Update london_underground.py

* Update test

* Update london_underground.py

* Update london_underground.py

* Update london_underground.py

* Fix lint

* Use london-tube-status==0.2
2018-12-31 06:24:52 -08:00
Robbert Müller 9928b977fd Added events STARTED, RESTARTED AND PAUSED (#19516)
Rewrote the tests a bit
the 'wait for the timer to finish' part of the test is now it's own test.
The rest is a sequence of fire/assert. Which i rewrote to a loop to
reduce the amount of duplicate code
2018-12-29 16:40:17 +01:00
FieldofClay bf8b201bb3 Add verify_ssl option to Splunk component (#19112)
* added verify_ssl option to Splunk component

* update Splunk tests

* fix typo in Splunk tests

* Update test
2018-12-27 14:23:04 +01:00
javicalle 70fff26383 Clean up remaining rflink tests (#19551)
* some minor tests refactor

* unused import

* async/await refactor

* Correct tests failures
2018-12-26 15:25:16 +01:00
sander76 18b7f74ad7 Clean up homematicip cloud (#19481)
* Better logging, remove unused method, re-try handling fix. Other minor fixes.

* fix test

* typo fix
2018-12-25 09:40:36 +01:00
Antoine GRÉA 1099018a5e Fix fail2ban by removal of internal timer logic (#19456)
* Remove timer logic from sensor class

Proposed fix for issue #10500

* Updating the tests to remove timer logic

* Removing unecessary dependancy

* Fixing requested changes

* Commit to try to fix the CLA ?
2018-12-22 18:25:02 +01:00
javicalle fb226e3e3b Clean up RFLink tests and add two tests (#19511)
* some minor tests refactor

* unused import
2018-12-22 08:53:02 +01:00
Steven Looman 501b3f9927 Disable creating port mappings from UI, add discovery from component (#18565)
* Disable creating port mappings from UI, add discovery from component

* Remove unused constant

* Upgrade to async_upnp_client==0.13.6 and use manufacturer from device

* Upgrade to async_upnp_client==0.13.7
2018-12-21 17:25:23 +00:00
Paulus Schoutsen 1281da024c Remove check if base url is local (#19494) 2018-12-21 11:23:05 +01:00
uchagani 71900ca719 Add new sensor platform to expose Islamic prayer times (#19444)
* added new sensor platform to expose Islamic prayer times

* added new sensor platform to expose Islamic prayer times

* updated tests according to feedback

* make prayer_times_info a public attribute

* remove stale comments
2018-12-20 22:52:43 +01:00
Bob Clough d42d8543c8 Add Mythic Beasts DNSAPI Component (#18333)
* Add Mythic Beasts DNSAPI Component

* Added timeout, and tests for exceptions while updating

* Move API to external module

* Move mbddns import into function

* Updated tests to mock out mbddns library
2018-12-20 11:33:47 +01:00
emontnemery 27ea59f6c3
Add device registry to MQTT climate (#19332)
* Add device registry to MQTT climate

* Add testcase test_entity_id_update
2018-12-19 19:27:44 +01:00
emontnemery ae776e2d28
Add device registry to MQTT alarm control panel (#19331)
* Add device registry to MQTT alarm control panel

* Add testcase test_entity_id_update
2018-12-19 19:27:23 +01:00
emontnemery fed5d0f5be
Add device registry to MQTT lock (#19333) 2018-12-19 19:26:07 +01:00
Erik a9de9aa58d Add testcase test_entity_id_update 2018-12-19 15:28:25 +01:00
Erik e874093818 Add device registry to MQTT climate 2018-12-19 15:28:25 +01:00
emontnemery 1568de62df Correct calls to subscription.async_unsubscribe_topics (#19414)
* Correct calls to subscription.async_unsubscribe_topics

* Review comments

* Add testcases
2018-12-19 14:05:24 +01:00
Pascal Vizeli 2bf36bb1db
Use unicode slugify (#19192)
* Update __init__.py

* Update setup.py

* Update requirements_all.txt

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* remove `-`

* fix packages

* Update package_constraints.txt

* Update __init__.py

* Update package_constraints.txt

* Update requirements_all.txt

* Update setup.py

* Fix tests

* Fix line issue

* fix all test

* fix type

* Fix lint
2018-12-17 07:51:13 +01:00
Otto Winter a08bab7b18 Add native ESPHome API component (#19334)
* Create esphomelib component

* Update requirements

* Remove python 2 string literals

* MVP

* Remove config flow

* Remove config flow translations

* Use dispatcher more

* Use data classes

* Type Hints

* Cleanup on remove

* Use helper and cleanup

* Fix HA stop listener cleanup

* Add config flow

* Fix SyntaxError for Py3.5

* Update

* Lint

* Re-do tests

*  Rename to ESPHome

* Better error message for resolve errors

* Fix tests when aioesphomeapi not installed

* Refactor mock

* Update requirements

* Add strings.json

* 🍵 100% config flow  test coverage
2018-12-17 01:29:32 +01:00
Anders Melchiorsen f9c02889b2 Remove recorder purge protection (#19358) 2018-12-16 23:31:50 +01:00
PeteBa 9d4de2a722 Initialise plant attributes at startup (#19315)
* Initialise plant attributes at startup

* Pvizeli review comments

* Martin review change
2018-12-16 21:54:33 +01:00
Fredrik Erlandsson 5a295ad42b Add config flow for Daikin (#19182)
* config flow for daikin

* tox test

* return fixes

* tox test fixes

* tox formatting
2018-12-16 16:19:18 +01:00
Malte Franken 629dd24ff3 bump georss_client to 0.5 (#19337) 2018-12-16 11:14:36 +01:00
emontnemery 3a7083900c
Merge pull request #19223 from emontnemery/mqtt_sensor_json_attributes_topic
Add JSON attribute topic to MQTT sensor
2018-12-15 16:28:34 +01:00
Paulus Schoutsen d83f20f743 Fix tests 2018-12-14 17:58:45 +01:00
Fabian Affolter b88cf64850 Add air pollutants component (#18707)
* Add air pollutants component

* Fix lint issue

* Update docstrings

* Revert change

* Remove entries

* Remove imports

* Fix variable and other fixes

* Change tests

* Set SCAN_INTERVAL
2018-12-14 13:32:58 +01:00
emontnemery b97f0c0261 Make variable `entity_id` available to value_template for MQTT binary sensor (#19195)
* MQTT binary_sensor: Make variable `entity_id` available to value_template

* Review comments

* Add testcase
2018-12-14 13:00:37 +01:00
Luca Angemi fb680bc1e4 Add automation and script events to logbook filter events (#19253)
* Add automation and script events to logbook filter events

* Update logbook.py

* Update logbook.py

* Update logbook tests

* Update test_logbook.py

* Update test_logbook.py

* Update test_logbook.py

* Update test_logbook.py
2018-12-14 10:25:02 +01:00
Paulus Schoutsen 4f98818258
Rename is_owner decorator to is_admin (#19266)
* Rename is_owner decorator to is_admin

* Update test_auth.py
2018-12-14 10:19:27 +01:00
Paulus Schoutsen a5a896b519
Check admin permission before able to manage config entries (#19265)
* Check admin permission before able to manage config entries

* Lint
2018-12-14 10:19:04 +01:00
Paulus Schoutsen 0eb0faff03
Add permission check to light service (#19259) 2018-12-14 10:18:36 +01:00
Paulus Schoutsen 34cfdb4e35
Fix OwnTracks deadlocking (#19260)
* Fix OwnTracks deadlocking

* Fix deadlock
2018-12-13 20:56:48 +01:00
Paulus Schoutsen 85e6f92c5a Lint 2018-12-13 20:08:31 +01:00
Paulus Schoutsen 90df932fe1 Check admin permission before able to manage config entries 2018-12-13 16:13:43 +01:00
emontnemery 7436c0fe42 Add device registry to MQTT light (#19013) 2018-12-13 15:51:50 +01:00
Paulus Schoutsen 9d9e11372b
Make automations log errors (#18965) 2018-12-13 12:21:16 +01:00
Paulus Schoutsen 8ea0a8d40b
RFC: Deprecate auto target all for services and introduce entity_id: * (#19006)
* Deprecate auto target all

* Match on word 'all'
2018-12-13 10:07:59 +01:00
Erik 0e868deedd Add JSON attribute topic to MQTT sensor 2018-12-12 16:26:44 +01:00
javicalle 61ca9bb8e4 Restore states for RFLink devices (#18816)
* Merge branch 'master' of https://github.com/home-assistant/home-assistant into dev

# Conflicts:
#	homeassistant/components/binary_sensor/point.py
#	homeassistant/components/cloud/__init__.py
#	homeassistant/components/cloud/prefs.py
#	homeassistant/components/frontend/__init__.py
#	homeassistant/components/light/fibaro.py
#	homeassistant/components/logbook.py
#	homeassistant/components/point/__init__.py
#	homeassistant/config_entries.py
#	homeassistant/const.py
#	homeassistant/helpers/service.py
#	requirements_all.txt
#	requirements_test_all.txt

* one 'async_get_last_state' refactor left behind

* Remove RestoreEntity inheritance (already in parent class)

* # pylint: disable=too-many-ancestors

* code predictor can be a bitch

* lint corrections

* # pylint: disable=too-many-ancestors

* recover from dict[key]

* Remove all 'coroutine' decorator, replace for 'async def'
Replace all 'yield from' for 'await'
Replace 'hass.async_add_job' for 'hass.async_create_task'
2018-12-11 17:20:30 +01:00
Paulus Schoutsen 557720b094
Fix cloud defaults (#19172) 2018-12-11 06:50:54 +01:00
Fredrik Erlandsson 92e19f6001 TelldusLive config flow (#18758)
* update TelldusLive to use config flow

* fixes from Martin

* Update homeassistant/components/tellduslive/config_flow.py

Co-Authored-By: fredrike <fredrik.e@gmail.com>

* revert changes in entry.py

* tox tests

* tox fixes

* woof woof (fix for hound)

* lint ignore

* unload entry

* coverall toxtests

* fix some toxtests
2018-12-10 18:44:45 +01:00
Paulus Schoutsen 59581786d3
Add raw service data to event (#19163) 2018-12-10 12:58:51 +01:00
Paulus Schoutsen da338f2c1a
Fix lovelace save (#19162) 2018-12-10 12:25:08 +01:00
Paulus Schoutsen fdea9cb426
Drop OwnTracks bad packets (#19161) 2018-12-10 12:24:56 +01:00
Paulus Schoutsen a521b885bf
Lovelace using storage (#19101)
* Add MVP

* Remove unused code

* Fix

* Add force back

* Fix tests

* Storage keyed

* Error out when storage doesnt find config

* Use old load_yaml

* Set config for panel correct

* Use instance cache var

* Make config option
2018-12-10 08:57:17 +01:00
Andrew Hayworth 05586de51f Set lock status correctly for Schlage BE469 Z-Wave locks (#18737)
* Set lock status correctly for Schlage BE469 Z-Wave locks

PR #17386 attempted to improve the state of z-wave lock tracking for
some problematic models. However, it operated under a flawed
assumptions. Namely, that we can always trust `self.values` to have
fresh data, and that the Schlage BE469 sends alarm reports after every
lock event. We can't trust `self.values`, and the Schlage is very
broken. :)

When we receive a notification from the driver about a state change,
we call `update_properties` - but we can (and do!) have _stale_
properties left over from previous updates. #17386 really works best
if you start from a clean slate each time. However, `update_properties`
is called on every value update, and we don't get a reason why.
Moreover, values that weren't just refreshed are not removed. So blindly
looking at something like `self.values.access_control` when deciding to
apply a workaround is not going to always be correct - it may or may not
be, depending on what happened in the past.

For the sad case of the BE469, here are the Z-Wave events that happen
under various circumstances:

RF Lock / Unlock:
- Send: door lock command set
- Receive: door lock report
- Send: door lock command get
- Receive: door lock report

Manual lock / Unlock:
- Receive: alarm
- Send: door lock command get
- Receive: door lock report

Keypad lock / Unlock:
- Receive: alarm
- Send: door lock command get
- Receive: door lock report

Thus, this PR introduces yet another work around - we track the current
and last z-wave command that the driver saw, and make assumptions based
on the sequence of events. This seems to be the most reliable way to go
- simply asking the driver to refresh various states doesn't clear out
alarms the way you would expect; this model doesn't support the access
control logging commands; and trying to manually clear out alarm state
when calling RF lock/unlock was tricky.

The lock state, when the z-wave network restarts, may look out of sync
for a few minutes. However, after the full network restart is complete,
everything looks good in my testing.

* Fix linter
2018-12-07 21:17:34 +01:00
emontnemery 5ff7563070
Merge pull request #18923 from emontnemery/mqtt_binary_sensor_json_attributes_topic
Add JSON attribute topic to MQTT binary sensor
2018-12-07 07:48:55 +01:00
ehendrix23 8a62bc9237 Set directv unavailable state when errors returned for longer then a minute (#19014)
* Fix unavailable

Change setting to unavailable when getting request exceptions only after 1 minute has past since 1st occurrence.

* Put common code in _check_state_available

Put common code to determine if available should be set to False in method _check_state_available
2018-12-07 07:26:49 +01:00
Mike Miller dd92318762 Fix missing colorTemperatureInKelvin from Alexa responses (#19069)
* Fix missing colorTemperatureInKelvin from Alexa responses

* Update smart_home.py

* Add test
2018-12-06 17:05:14 +01:00
Paulus Schoutsen 962358bf87
Fix cloud const (#19052)
* Fix cloud const

* Fix tests
2018-12-06 09:20:53 +01:00
Paulus Schoutsen 12f222b5e3
Don't wait for answer for webhook register (#19025) 2018-12-05 14:45:30 +01:00
Paulus Schoutsen 3928d034a3 Allow checking entity permissions based on devices (#19007)
* Allow checking entity permissions based on devices

* Fix tests
2018-12-05 11:41:00 +01:00
Erik 21197fb968 Review comments 2018-12-04 19:56:34 +01:00
Paulus Schoutsen b65bffd849
Mock out device tracker configuration loading funcs in Geofency + OwnTracks (#18968)
* Mock out device tracker configuration loading funcs

* Update test_init.py

* Update test_init.py
2018-12-04 10:45:41 +01:00
Pierre Gronlier a6511fc0b9 remove the need to have query feature support (#18942)
* remove the need to have query feature support

Some InfluxDB servers don't have /query support feature but are still valid servers for storing data.
Usually those servers are proxies to others timeseries databases.
The change proposes to still validate the configuration but with less requirements on the server side.

* `.query` call is replaced by `.write_points`

* no more query call in the influxdb component. remove test

* reset mock after the setup and before the test

* remove unused import

* reset mock stats after component setup
2018-12-04 09:59:03 +01:00
Jason Hunter b900005d1e New Events and Context Fixes (#18765)
* Add new events for automation trigger and script run, fix context for image processing, add tests to ensure same context

* remove custom logbook entry for automation and add new automation event to logbook

* code review updates
2018-12-04 09:45:17 +01:00
Paulus Schoutsen d028236bf2
Refactor script helper actions into their own methods (#18962)
* Refactor script helper actions into their own methods

* Lint

* Lint
2018-12-03 15:46:25 +01:00
Paulus Schoutsen d2b62840f2
Add users added via credentials to admin group too (#18922)
* Add users added via credentials to admin group too

* Update test_init.py
2018-12-03 11:34:01 +01:00
cdce8p 3904d83c32 Extend partial reload to include packages (#18884)
* Merge packages after partial reload

* Remove merge from core reload & test

* Integrate merge in 'async_hass_config_yaml'

* Merge executors
2018-12-03 10:56:26 +01:00
Andrew Hayworth 5ae65142b8 Allow verisure locks to be configured with a default code (#18873)
* Allow verisure locks to be configured with a default code

* linting fix

* PR feedback

* PR feedback - try harder to prevent future typos

A python mock is a magical thing, and will respond to basicaly
any method you call on it. It's somewhat better to assert against
an explicit variable named 'mock', rather than to assert on the
method name you wanted to mock... could prevent a typo from messing up
tests.

* PR feedback: convert tests to integration-style tests

Set up a fake verisure hub, stub out a _lot_ of calls, then test
after platform discovery and service calls.

It should be noted that we're overriding the `update()` calls in
these tests. This was done to prevent even further mocking of
the verisure hub's responses.

Hopefully, this'll be a foundation for people to write more tests.

* more pr feedback
2018-12-03 07:25:54 +01:00