Commit Graph

4810 Commits (2cda7bf1e7e160d996359188f1fa25265914650b)

Author SHA1 Message Date
Kevin Eifinger 2cda7bf1e7
Add Here travel time arrival departure (#29909)
* here_travel_time: Add modes arrival and departure

* convert arrival/departure from datetime to time

* Default departure is set by external lib on None

* Use cv.key_value_schemas
2020-03-16 21:16:49 -07:00
springstan 51b9afe3c1
Add device condition for alarm_control_panel (#29063)
* Initial commit

* Restricting conditions by supported_features, drop pending condition

* Added tests for no and minimum amount of conditions

* Address review comments

* Sort impors with isort

* Sort impors with isort v2
2020-03-16 18:08:06 -05:00
Bram Kragten 2f1824774f
Lovelace: storage key based on id instead of url_path (#32873)
* Fix storage key based on url_path

* Fix test
2020-03-16 20:08:00 +01:00
Paulus Schoutsen 999c5443c1
Fix abode test (#32871) 2020-03-16 10:03:44 -07:00
Knapoc 7ec7306ea8
Update deconz/cover.py to adapt rest-api changes (#32351)
* Update cover.py to adapt rest-api changes

* adjust test to reflect max brightness changes

* implement test for rest-api cover position of 255
2020-03-16 15:44:59 +01:00
Robert Svensson fa63dc1e25
UniFi - Improve expected SSID filter behavior (#32785)
* Improve expected ssid filter behavior

* Fix tests
2020-03-16 12:10:45 +01:00
Jason Lachowsky 77b3f31e9b
Corrected minor misspellings (#32857) 2020-03-16 11:58:12 +01:00
Chris Talkington cf8dfdae47
Add config flow to roku (#31988)
* create a dedicated const.py

* add DEFAULT_PORT to const.py

* work on config flow conversion.

* remove discovery.

* work on config flow and add tests. other cleanup.

* work on config flow and add tests. other cleanup.

* add quality scale to manifest.

* work on config flow and add tests. other cleanup.

* review tweaks.

* Update manifest.json

* catch more specific errors

* catch more errors.

* impprt specific exceptions

* import specific exceptions

* Update __init__.py

* Update config_flow.py

* Update media_player.py

* Update remote.py

* Update media_player.py

* Update remote.py

* Update media_player.py

* Update remote.py

* Update config_flow.py

* Update config_flow.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* Update test_config_flow.py

* Update config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update remote.py

* Update test_init.py

* Update test_init.py

* Update media_player.py

* Update media_player.py

* Update media_player.py
2020-03-15 21:13:04 -07:00
shred86 d36259f067
Add Abode tests (#32562)
* Add tests for several devices

* Update coveragerc

* Code review changes and minor clean up

* More code review changes

* Update manifest and minor test updates

* Add test for locks and covers

* Add tests for switch on and off

* Add more complete test for alarms

* Fix for camera test

* Patch abodepy.mode for tests

* Add test for unknown alarm state and minor cleanup

* Update to make tests more robust

* More specific tests

* Update quality scale to silver

* Remove integration quality scale
2020-03-16 03:05:10 +01:00
Kit Klein ef54f33af7
Ignore the ignored konnected config entries (#32845)
* ignore the ignored konnected config entries

* key off data instead of source
2020-03-16 01:11:26 +01:00
Paulus Schoutsen 2889067ece
Make sure panel_custom won't crash on invalid data (#32835)
* Make sure panel_custom won't crash on invalid data

* Add a test
2020-03-15 11:51:02 -07:00
Bram Kragten f4bf66aecd
Require a hyphen in lovelace dashboard url (#32816)
* Require a hyphen in lovelace dashboard url

* Keep storage dashboards working

* register during startup again

* Update homeassistant/components/lovelace/dashboard.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Comments

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-03-15 11:50:23 -07:00
SukramJ 2f80489428
Add SF transition to HmIP-BSL and remove obsolete code in HMIPC (#32833) 2020-03-15 19:01:50 +01:00
SukramJ 4f81109304
Fix flaky tests for HMIPC (#32806) 2020-03-14 19:35:15 +01:00
J. Nick Koston 7737387efe
Add config flow for rachio (#32757)
* Do not fail when a user has a controller with shared access on their account

* Add config flow for rachio

Also discoverable via homekit

* Update homeassistant/components/rachio/switch.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Split setting the default run time to an options flow

Ensue the run time coming from yaml gets imported into the option flow

Only get the schedule once at setup instead of each zone (was hitting rate limits)

Add the config entry id to the end of the webhook so there is a unique hook per config entry

Breakout the slew of exceptions rachiopy can throw into RachioAPIExceptions

Remove the base url override as an option for the config flow

Switch identifer for device_info to serial number

Add connections to device_info (mac address)

* rename to make pylint happy

* Fix import of custom_url

* claim rachio

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-13 22:46:17 -07:00
Franck Nijhof 743166d284
Fix brightness_pct in light device turn_on action (#32787) 2020-03-13 21:58:32 -07:00
Chris Talkington 5dd031af17
Optimize directv client initialization (#32706)
* Optimize directv client initialization.

* Update config_flow.py

* Update media_player.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update test_media_player.py

* Update __init__.py

* Update media_player.py

* Update test_media_player.py

* Update media_player.py

* Update test_media_player.py

* Update config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_media_player.py

* Update test_media_player.py

* Update __init__.py

* Update __init__.py

* Update __init__.py
2020-03-13 21:55:21 -07:00
J. Nick Koston 750ed2facd
Optimize is_entity_exposed in emulated_hue by removing deprec… (#32718)
* emulated_hue: Optimize is_entity_exposed

Switch all list transversals in is_entity_exposed to
hash lookups

get_deprecated is now only called if explict_expose is
set

This funciton was iterating multiple lists per enitity
every time there was an update.  It was responsible for
a chunk of execution time when there are large number
of entities in home assistant.

* Complete deprecation of ATTR_EMULATED_HUE attribute

* Complete deprecation of ATTR_EMULATED_HUE attribute (remove const)

* Remove ATTR_EMULATED_HUE_HIDDEN and Rewrite tests
2020-03-13 21:47:47 -07:00
David F. Mulcahey aa972b0005
Fix handling of attribute reports in ZHA sensors and binary sensors (#32776)
* Update sensor tests.

* Update light tests.

* Update binary_sensor tests.

* Update cover tests.

* Update device tracker tests.

* Update fan tests.

* Update lock tests.

* Update switch tests.

* add sensor attr to sensors

* add sensor attr to binary sensors

* cleanup extra var

Co-authored-by: Alexei Chetroi <alexei.chetroi@outlook.com>
2020-03-13 19:17:50 -04:00
Bram Kragten 6bd55011a8
Check if panel url used and delay dashboard reg till start (#32771)
* Check if panel url used and delay dashboard reg till start

* move storage_dashboard_changed

* fix tests
2020-03-13 11:55:53 -07:00
Franck Nijhof 992daa4a44
Migrate WLED to use DataUpdateCoordinator (#32565)
* Migrate WLED to use DataUpdateCoordinator

* Remove stale debug statement

* Process review suggestions

* Improve tests

* Improve tests
2020-03-13 13:19:05 +01:00
Raman Gupta 26d7b2164e
Move apps configuration to options flow for vizio integration (#32543)
* move apps configuration to options flow

* add additional assertion to new test

* add additional assertions for options update

* update docstrings, config validation, and tests based on review
2020-03-13 12:16:24 +01:00
Aaron Bach 4f0997f6e9
Add options flow for SimpliSafe (#32631)
* Fix bug where SimpliSafe ignored code from UI

* Fix tests

* Add options flow

* Fix tests

* Code review

* Code review

* Code review
2020-03-12 22:00:00 -07:00
Franck Nijhof ff92a8b260
Add update class method to DataUpdateCoordinator (#32724)
* Add update class method to DataUpdateCoordinator

* Update homeassistant/helpers/update_coordinator.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Move update_method param

* Rename async_update_data to _async_update_data

* Raise NotImplementedError

* Re-raise NotImplementedError

* Remove caplog, not needed anymore

* Don't set last_update_success on NotImplementedError

* Fix test

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-03-13 00:27:19 +01:00
Robert Svensson 374a8157e7
Remove manual configuration support (#32699) 2020-03-12 11:56:50 +01:00
Franck Nijhof b8fab33e69
Remove deprecated hide_if_away from device trackers (#32705) 2020-03-12 11:55:18 +01:00
Raman Gupta 77ebda0c20
Update Vizio `source` property to only return current app if i… (#32713)
* only return current app for source if current app is set

* check for None specifically

* make sure current app isn't called for speaker
2020-03-12 11:01:05 +01:00
escoand f9a0b4b3cf
Fix legacy Samsung TV (#32719)
* Update bridge.py

* Update test_init.py
2020-03-12 10:29:11 +01:00
Erik Montnemery 8bc542776b
Cleanup entity and device registry on MQTT discovery removal (#32693)
* Cleanup entity and device registry on MQTT discovery removal.

* Review comments
2020-03-11 18:00:47 -07:00
Phil Bruckner 5f5cb8bea8
Add support for simultaneous runs of Script helper - Part 2 (#32442)
* Add limit parameter to service call methods

* Break out prep part of async_call_from_config for use elsewhere

* Minor cleanup

* Fix improper use of asyncio.wait

* Fix state update

Call change listener immediately if its a callback

* Fix exception handling and logging

* Merge Script helper if_running/run_mode parameters into script_mode

- Remove background/blocking _ScriptRun subclasses which are no longer needed.

* Add queued script mode

* Disable timeout when making fully blocking script call

* Don't call change listener when restarting script

This makes restart mode behavior consistent with parallel & queue modes.

* Changes per review

- Call all script services (except script.turn_off) with no time limit.
- Fix handling of lock in _QueuedScriptRun and add comments to make it
  clearer how this code works.

* Changes per review 2

- Move cancel shielding "up" from _ScriptRun.async_run to Script.async_run
  (and apply to new style scripts only.) This makes sure Script class also
  properly handles cancellation which it wasn't doing before.
- In _ScriptRun._async_call_service_step, instead of using script.turn_off
  service, just cancel service call and let it handle the cancellation
  accordingly.

* Fix bugs

- Add missing call to change listener in Script.async_run
  in cancelled path.
- Cancel service task if ServiceRegistry.async_call cancelled.

* Revert last changes to ServiceRegistry.async_call

* Minor Script helper fixes & test improvements

- Don't log asyncio.CancelledError exceptions.
- Make change_listener a public attribute.
- Test overhaul
  - Parametrize tests.
  - Use common test functions.
  - Mock timeout so tests don't need to wait for real time to elapse.
  - Add common function for waiting for script action step.
2020-03-11 16:34:50 -07:00
Quentame 19be4a5d6d
Refactor Freebox : add config flow + temperature sensor + signal dispatch (#30334)
* Add config flow to Freebox

* Add manufacturer in device_tracker info

* Add device_info to sensor + switch

* Add device_info: connections

* Add config_flow test + update .coveragerc

* Typing

* Add device_type icon

* Remove one error log

* Fix pylint

* Add myself as CODEOWNER

* Handle sync in one place

* Separate the Freebox[Router/Device/Sensor] from __init__.py

* Add link step to config flow

* Make temperature sensors auto-discovered

* Use device activity instead of reachablility for device_tracker

* Store token file in .storage

Depending on host if list of Freebox integration on the future without breaking change

* Remove IP sensors + add Freebox router as a device with attrs : IPs, conection type, uptime, version & serial

* Add sensor should_poll=False

* Test typing

* Handle devices with no name

* None is the default for data

* Fix comment

* Use config_entry.unique_id

* Add async_unload_entry with asyncio

* Add and use bunch of data size and rate related constants (#31781)

* Review

* Remove useless "already_configured" error string

* Review : merge 2 device & 2 sensor classes

* Entities from platforms

* Fix unload + add device after setup + clean loggers

* async_add_entities True

* Review

* Use pathlib + refactor get_api

* device_tracker set + tests with CoroutineMock()

* Removing active & reachable from tracker attrs

* Review

* Fix pipeline

* typing

* typing

* typing

* Raise ConfigEntryNotReady when HttpRequestError at setup

* Review

* Multiple Freebox s

* Review: store sensors in router

* Freebox: a sensor story
2020-03-11 22:15:59 +01:00
Quentame 01dc81d8fb
Fetch iCloud family devices only when wanted (#32644)
* Fetch iCloud family devices only when wanted

* Review: form data_schema as init schema
2020-03-11 20:43:37 +01:00
Chris Talkington bb666b9ac6
Add config flow to directv (#32162)
* initial work on config flow.

* more work on config flow.

* work on config flow and add tests. other cleanup.

* cleanup tests.

* fix test.

* isort

* Update .coveragerc

* Update test_init.py

* Update test_init.py

* Update test_init.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* correct upnp serial format.

* improve config flow coverage.

* review tweaks.

* further review tweaks

* simplify dtv data gathering job

* lint

* black

* Update test_init.py

* Update test_init.py

* Simplify exception handling.

* Simplify exception handling.

* Update media_player.py

* Update test_media_player.py

* Update test_media_player.py

* Update test_media_player.py

* Update test_media_player.py

* Update test_media_player.py

* fix failing test.

* restore change made during debug.

* isort.

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-11 12:28:38 -07:00
chiefdragon 3e8728ad5f
Fix issue #23758 - Restore Canary sensors and ensure alarm con… (#32627)
* Fixed missing Canary sensors and Canary alarm control panel that was not updating correctly

* Resolved pylinting warnings in original tests
2020-03-11 11:58:42 -07:00
jjlawren 44c7743351
Rewrite and add Plex tests (#32633)
* Rewrite and add Plex tests

* Remove unnecessary mocks

* Explicitly import constants for readability
2020-03-11 09:37:02 -07:00
Erik Montnemery f7ddbc7e1e
Remove duplicated config from MQTT tests (#32689) 2020-03-11 09:34:19 -07:00
Florian Werner 5216dc0ae1
Fix rate of change calculation of statistics sensor (#32597)
* Fix rate of change of statistics sensor

* Fix test
2020-03-11 09:33:00 -07:00
Alexei Chetroi 440c837eb6
Allow sw_version update of a device registry entry. (#32630) 2020-03-11 09:31:02 -07:00
Bram Kragten 4c4e5f3fa9
Fix demos (#32086)
* Fixes for demos

* Update vacuum.py

* Comment

* Fix tests
2020-03-11 08:16:22 -07:00
David F. Mulcahey 7127492767
Additional ZHA cleanup (#32678)
* fix double device loading in tests

* change imports

* None is default
2020-03-11 13:37:28 +01:00
David F. Mulcahey 4248893007
Clean up custom polling in ZHA device and light (#32653)
* cleanup timer handle when device is removed

* separate unavailable times for mains vs battery

* better name

* remove light refresh handle when removing light

* remove unused parallel updates

* don't steal HA const for different purpose

* don't flood network every hour for lights

* update test to test both intervals

* add test for light refresh interval

* fix tests

* update test

* put parallel updates back for now...

* fix async_schedule_update_ha_state usage

* review comment

* review comment

* update test - review conversation

* review comments

* await count not call count

* flip some state
2020-03-11 07:17:53 -04:00
Diogo Gomes 16336bf902
Add entity_service calibrate_meter to utility_meter (#32658)
* add calibrate service
2020-03-11 09:42:22 +01:00
J. Nick Koston 048f9e7daa
Throw ConfigEntryNotReady when august servers are offline or u… (#32635)
* Throw ConfigEntryNotReady when august servers are offline

* august has tests now and its nearing 100%

* Adjust per review

* define in init
2020-03-10 17:10:00 -07:00
J. Nick Koston ae147fd9c7
Lock operation sensors for August (#32593)
* adkj

* reduce

* Convert august to async

Async io was added to py-august 0.24

* Fix lint

* Lock operation sensors for august

* Tracking lock operation method allows user presence detection at the lock

* revert lock changes

* fix activity count merge conflict reversion

* Fix revert that come back with the conflict
2020-03-10 17:09:49 -07:00
Bram Kragten bbe0f75336
input_datetime guard for unexpected state on restore (#32652)
* input_datetime guard for unexpected state

If state is a time and has_date = true, or the other way around, restore state would error

* Update __init__.py

* Add test
2020-03-10 15:15:11 -07:00
J. Nick Koston 908ae23738
Add griddy integration (#32591)
* Add griddy integration

* Griddy is a wholesale power provider in Texas

* Supports all four load zones in Texas

* Provides real time power price which is useful for automations to handle demand response

* Update homeassistant/components/griddy/sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/griddy/config_flow.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Add ability request updated via entity update service.

* Improve error message about already configured

* Remove DEVICE_CLASS_POWER since we do not have a device class for cost

* remove setdefault that was left from previous refactor

* More detail on data naming

* Bump translation for testing

* git add the config flow tests

* s/PlatformNotReady/ConfigEntryNotReady/

* Review items

* git add the other missing file

* Patch griddypower

* reduce

* adjust target

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-10 23:00:30 +01:00
Aaron Bach 21cff003f8
Add options flow for AirVisual (#32634)
* Add options flow for AirVisual

* Code review

Co-Authored-By: Robert Svensson <Kane610@users.noreply.github.com>

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2020-03-10 14:16:25 -06:00
Paolo Tuninetto a8758ed3a1
Add support for newer SamsungTV models (#31537)
* Added support for newer SamsungTV models

* Fixed legacy port

* store token in HA config directory

* Change token name

* rebasing and exception handling

* implement update

* fix error creating mediaplayer

* Debug logging

* Increase timeout

* Restore update timeout

* Store token_file path in config_entry

* Introduction of samsung bridge class

* Added bridge class functions

* Code cleanup

* more fixes

* Begin testing

* samsungtvws 1.2.0

* Config flow tests 0.1

* Fixed some mediaplayer tests

* Fixed fixture in media player

* use of constants and turn off

* more media player tests

* samsungtvws 1.3.1 and other fixes

* WS tv update rewritten

* more tests

* test_init

* fixed tests

* removed reset mock

* tests reset mock

* close_remote and tests

* deprecate port config

* deprecate port config 2

* deprecate port config 3

* save token only if needed

* cleanup

* better websocket protocol detection

* config removal
2020-03-10 11:48:09 +01:00
Quentame 2e802c88f8
Add devices check to iCloud config flow (#31950)
* Add devices check to iCloud config flow

* Some test rename

* Bump pyicloud to catch KeyError
2020-03-10 11:42:04 +01:00
Michaël Arnauts 8c52e2c923
Revert "Breakout tado zone code into a single place (#32564)" (#32639)
This reverts commit c2b03332a0.
2020-03-10 09:32:56 +01:00