Commit Graph

5350 Commits (1bf2c4d976c73841f9c4ba94a4da419dbe3ba4b6)

Author SHA1 Message Date
Austin Drummond 9d0f58009e
Add support for HomeKit doorbell (#38419)
* Add support for HomeKit doorbell

* Update homeassistant/components/homekit/type_cameras.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/homekit/type_cameras.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* add speaker service for doorbells

* fixed test as doorbell char requires null value

* removed null value for doorbell presses. and removed broken override of default values

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-31 09:41:36 -10:00
Andrew Sayre bb69aba051
Remove unused SmartThings capability subscriptions (#38128) 2020-07-31 17:40:23 +02:00
Charles Garwood 49cbc9735c
Add identifiers to device registry api output (#38427) 2020-07-31 15:47:01 +02:00
Eugene Prystupa c795c68bc0
Support 'stop' action for covers in device automation (#38219) 2020-07-31 14:45:03 +02:00
cgtobi d02c432e4d
Fix rmvtransport breaking when destinations don't match (#38401) 2020-07-31 14:38:49 +02:00
Eugene Prystupa 89cbcdb9dc
Abort bond hub config flow if hub is already registered (#38416)
Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-31 14:08:25 +02:00
Eugene Prystupa 0493f1c206
Generate bond config entry ID from the hub metadata (#38354)
* Generate bond config entry ID from the hub metadata

* Generate bond config entry ID from the hub metadata (PR feedback)
2020-07-30 18:00:58 -05:00
Maciej Bieniek ad0560ef37
Improve tests for Airly integration (#38357)
* Add tests

* More tests

* Add PARALLEL_UPDATES

* Change Quality scale to platinum

* Change PARALLEL_UPDATES value
2020-07-30 08:41:18 -10:00
Eugene Prystupa a00aa6740e
Fix bond fans without defined max_speed (#38382) 2020-07-30 14:44:26 +02:00
Marcio Granzotto Rodrigues 8ab1b41974
Add support for dimmable bond lights (#38203)
* Add support for dimmable lights

* Fix formatting

* Add supported features test on Bond Light

* Add more tests to bond light and fixes comments

* Fix rebase conflict resolution

* Apply suggestions from code review

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-29 20:01:59 -05:00
Franck Nijhof fa9866db96
Add support for multiple time triggers in automations (#37975)
* Add support for multiple time triggers in automations

* Attach with single callback

* Patch time in tests

* Improve test coverage

* Adjusting my facepalm moment
2020-07-29 14:51:30 -10:00
Erik Montnemery e3dc8a1ff2
Bump pychromecast to 7.2.0 (#38351) 2020-07-29 23:46:14 +02:00
J. Nick Koston 1b593e3169
Prevent nut config flow error when checking ignored entries (#38372) 2020-07-29 23:20:19 +02:00
Charles Garwood 13e8e28778
Add basic websocket api for OZW (#38265) 2020-07-29 22:35:26 +02:00
J. Nick Koston ed104d1927
Avoid error with ignored harmony config entries (#38367) 2020-07-29 21:20:06 +02:00
jjlawren 1d987b4846
Ignore remote Plex clients during plex.tv lookup (#38327) 2020-07-29 20:56:32 +02:00
Franck Nijhof 2c6686c5e1
Remove AdGuard version check (#38326) 2020-07-28 17:51:35 +02:00
Kyle Hendricks 0a7dc40712
Fix issue with certain Samsung TVs repeatedly showing auth dialog (#38308)
Through some testing with the samsungtvws library, it was determined
that the issue is related to the short read timeout (1s).  Increasing
the timeout to 10s should solve the issue.
2020-07-28 12:03:56 +02:00
Chris 5fef9653a8
Fix ozw dimming duration (#38254)
* Dimming duration fix

Fixes #38068 - allows dimming duration to 7620 (default of 7621)

* Forgot to commit my test updates

* Added backwards compatibility with pre-150+ builds

Added tests for backwards compatibility

* Upped the build number cut off

* Add check for major.minor version as well

* Fix major.minor detection

* Adjust variable name

* Adjust version checking logic

* Math is hard

* Rename files, adjust test names

* Update doc string
2020-07-28 07:37:09 +02:00
Eugene Prystupa 020dd39c08
Apply changes from bond code review (#38303) 2020-07-27 21:18:24 -05:00
Marcio Granzotto Rodrigues 02e2c40c48
Bond - Make assumed state conditional (#38209) 2020-07-27 20:39:23 -05:00
Joakim Plate 0bcee21333
Restore rfxtrx state to off when delay off is in effect (#38239) 2020-07-28 01:45:41 +02:00
On Freund b226a7183f
Add config flow to Volumio (#38252) 2020-07-27 09:19:19 +02:00
Maciej Bieniek 2b0914994d
Add changes from comments after merging AccuWeather (#38227)
* Fix documentation url

* Return None instead STATE_UNKNOWN

* Invert forecast check

* Patch async_setup_entry in test_create entry

* Improve test name, docstring and add comment
2020-07-26 20:00:47 -05:00
Eugene Prystupa 4d73f107c4
Implement resilient startup for bond integration with ConfigEntryNotReady support (#38253) 2020-07-26 18:27:18 -05:00
shred86 36cb818cd0
Add Abode camera on and off support (#35164)
* Add Abode camera controls

* Add tests for camera turn on and off service

* Bump abodepy version

* Bump abodepy version and updates to reflect changes

* Update manifest
2020-07-26 08:59:11 -10:00
Eugene Prystupa 2d6eb5c05d
Refactor bond unit tests to reduce boilerplate (#38177)
* Refactor bond unit tests to reduce boilerplate

* Refactor bond unit tests to reduce boilerplate (PR feedback)

* Refactor bond unit tests to reduce boilerplate (PR feedback, nullcontext)
2020-07-26 12:15:21 -05:00
J. Nick Koston a39aec862e
Attempt to fix islamic prayer times tests (#38220)
* Attempt to fix islamic_prayer_times tests

* adj
2020-07-26 10:26:32 +02:00
Aidan Timson dcba45e67d
Add Azure DevOps Integration (#33765)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-26 00:04:10 +02:00
Joakim Plate fd11748a1a
Make rfxtrx RfyDevices have sun automation switches (#38210)
* RfyDevices have sun automation

* We must accept sun automation commands for switch

* Add test for Rfy sun automation
2020-07-25 22:56:58 +02:00
Robert Van Gorkom da380d89c2
Removing gogogate2 emulated cover transitional states. (#38199) 2020-07-25 21:43:45 +02:00
Phil Bruckner bbc8748e3b
Stop automation runs when turned off or reloaded (#38174)
* Add automation turn off / reload test

* Stop automation runs when turned off or reloaded
2020-07-25 12:19:55 +02:00
J. Nick Koston a07f4e0986
Ignore harmony hubs ips that are already configured during ssdp discovery (#38181)
We would connect to the hub via discovery and via setup
around the same time.  This put additional load on the hub
which can increase the risk of timeouts.
2020-07-25 11:13:47 +02:00
Nick Whyte 7599997a46
Enable Homekit remote support for devices without play/pause (#37180)
* Enable Homekit remote support for devices without play/pause

* linting

* Update tests

* code review

* code review
2020-07-24 18:20:29 -10:00
Maciej Bieniek 581c4a4edd
Add AccuWeather integration (#37166)
* Initial commit

* Fix strings

* Fix unit system

* Add config_flow tests

* Simplify tests

* More tests

* Update comment

* Fix pylint error

* Run gen_requirements_all

* Fix pyline error

* Round precipitation and precipitation probability

* Bump backend library

* Bump backend library

* Add undo update listener on unload

* Add translation key for invalid_api_key

* Remove entity_registry_enabled_default property

* Suggested change

* Bump library
2020-07-24 15:59:15 -05:00
Eugene Prystupa 69203b5373
Gracefully handle bond API errors and timeouts through available state (#38137)
* Gracefully handle API errors and timeouts through available state

* Gracefully handle API errors and timeouts through available state
2020-07-24 15:14:47 -05:00
Joakim Plate 632a36d819
Support rfxtrx smoke detectors, motion sensors as binary_sensors (#38000)
* Add binary sensor support to motion sensors and smoke detectors

* Add support for new sensor events as binary sensors

Adds a default device_class for motion sensors and smoke detector

* Use device type instead of event to set class

* Add some additional binary values
2020-07-24 17:16:41 +02:00
Aaron Bach 5f6bd22f18
Remove leftover print statement (#38163) 2020-07-24 16:11:02 +02:00
Thomas Delaet 3ff5c17009
Support unavailable state in template fan (#38114)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-24 15:48:07 +02:00
Erik Montnemery 686e6b8fc3
Add test (#37890) 2020-07-24 12:29:19 +02:00
Aaron Bach a5b7a2c228
Fix SimpliSafe to work with new MFA (#38097)
* Fix SimpliSafe to work with new MFA

* Code review (part 1)

* Input needed from Martin

* Code review

* Code review

* Restore YAML

* Tests

* Code review

* Remove JSON patching in tests

* Add reauth test

* One more reauth test

* Don't abuse the word "conf"

* Update homeassistant/components/simplisafe/config_flow.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Test coverage

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-23 20:02:29 -06:00
Rob Bierbooms 0e0f61764a
Fix updates of Rssi for control devices in rfxtrx (#38131)
* Change entity to entity_info

* Fix bug in RSSI for Control devices
2020-07-24 01:49:46 +02:00
Eugenio Panadero 8cfffd00d6
Fix state automation trigger (#38014) (#38032)
for scenarios of enabling/disabling (~ creating/removing) entities,
so it does not trigger in removal if a `to: xxx` is defined, and also
does not trigger in creation if a `from: xxx` is present.
2020-07-23 14:17:11 -05:00
J. Nick Koston fdc5208d18
Prevent the zeroconf service browser from terminating when a device without any addresses is discovered. (#38094) 2020-07-22 20:21:57 -10:00
Paulus Schoutsen 5583f43030
Clean up fido tests (#38098) 2020-07-22 20:21:32 -10:00
Eugene Prystupa 3480fb6996
Refactor bond integration to be completely async (#38066) 2020-07-22 20:22:25 -05:00
Andrew Sayre ae5c50c1b6
Bump pysmartthings to v0.7.2 (#38086) 2020-07-22 16:01:57 -07:00
J. Nick Koston 4a5a09a0e9
Speed up group setup (#38048) 2020-07-21 17:29:57 -07:00
Donnie 6e87c2ad3e
Support default transition in light profiles (#36747)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-21 17:19:07 -07:00
J. Nick Koston 5cf7b1b1bc
Ensure we do not start discovered flows until after the started event has fired (#38047)
* Ensure we do not start discovered flows until after the start event has fired

This change makes zeroconf and ssdp match discovery behavior of not
creating config flows until the start event has been fired.  This
prevents config flow creation/dependency installs for discovered
config flows from competing for cpu time during startup.

* Start discovery/service browser/ssdp when EVENT_HOMEASSISTANT_STARTED is fired instead of EVENT_HOMEASSISTANT_START
2020-07-21 14:18:43 -10:00
Joakim Plate 7a3c6d6525
Avoid using implementation internal to trigger events (#38041)
This uses the moxking in fixture to trigger events.
2020-07-22 00:24:26 +02:00
Joakim Plate 945acb4e29
Make sure command entities restore from state (#38038) 2020-07-22 00:01:31 +02:00
Rob Bierbooms ad5d7ee615
Implement unload entry for rfxtrx integration (#38037)
* Implement unload entry

* Change async_remove to remove

* Pop data from hass.data

* Change sequence order in unload

* Dont unload internal when unload platforms fail
2020-07-21 23:43:05 +02:00
J. Nick Koston 4015991622
Update tests that track time to account for microsecond precision (#38044) 2020-07-21 14:22:55 -07:00
Erik Montnemery fa0e12ffe8
Use keywords for MQTT birth and will (#38040) 2020-07-21 14:10:34 -07:00
Erik Montnemery 908b72370b
Correct arguments to MQTT will_set (#38036) 2020-07-21 12:36:21 -07:00
J. Nick Koston 60009ec2f9
Use event loop scheduling for tracking time patterns (#38021)
* Use event loop scheduling for tracking time patterns

* make patching of time targetable

* patch time tests since time can tick to match during the test

* fix more tests

* time can only move forward

* time can only move forward

* back to 100% coverage

* simplify since the event loop time cannot move backwards

* simplify some more

* revert simplify

* Revert "revert simplify"

This reverts commit bd42f232f6.

* Revert "simplify some more"

This reverts commit 2a6c57d514.

* Revert "simplify since the event loop time cannot move backwards"

This reverts commit 3b13714ef4.

* Attempt another simplify

* time does not move backwards in the last two

* remove next_time <= now check

* fix previous merge error
2020-07-20 20:18:31 -10:00
Patrick 19870ea867
Fix ozw color temp (#38012)
* Fix color temp math

* Ran black --fast

* Update test_light.py

* tweaking mireds

* updating comments

* fixing test_light to match standards

* fixing comments, need coffee
2020-07-20 14:35:30 -04:00
Adam Król bedb0753f3
Add Wolflink integration (#34104)
* WOLF Smart-set integration

* Removed translations. Changed device class of timestamp. Added new test for unknown exception

* Remove unit_of_measurement from hours sensor

* Code cleanup. Pull Request comments fixes

* ConnectError import change. Removed DEVICE_CLASS_TIMESTAMP

* Add unique id guard with tests. Use common translations. Move device_id resolution to config_flow.

* Remove debug print
2020-07-20 11:52:52 +02:00
Jean-Yves Avenard 36ee9ff58f
Don't advertise switch devices as dimmable lights (#37978)
This issue has been corrected and then reverted multiple times.
It seems that the core issue was a casing one (On/off vs On/Off) ; for better
matching with a real Hue hub, also add the productname.

Tested to work with echo 2 and echo 5.
2020-07-19 22:33:56 -10:00
Jeff Irion 2c3618e2c7
Close androidtv ADB socket connection when Home Assistant stops (#37973)
* Close the ADB connection on HA stop

* Get the test to pass

* Remove unnecessary test code

* Register the callback sooner

* '_async_stop' -> 'async_close'

* 'async_close' method -> '_async_close' function
2020-07-20 02:48:08 +02:00
lawtancool 432cbd3148
Add Control4 integration (#37632)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-19 13:48:08 -07:00
Thorjan Knudsvik e6ff8d6839
Adds median to min_max component (#36686) 2020-07-18 16:18:31 -07:00
Joakim Plate 6fa04aa3e3
Add support for InputSelector trait (#35753) 2020-07-18 16:07:32 -07:00
Xiaonan Shen 394194d1e6
Add switch to pi_hole integration (#35605)
Co-authored-by: Ian <vividboarder@gmail.com>
2020-07-17 23:19:01 -07:00
J. Nick Koston 1acdb28cdd
Automatically recover when the sqlite3 database is malformed or corrupted (#37949)
* Validate sqlite database on startup and move away if corruption is detected.

* do not switch context in test -- its all sync
2020-07-17 19:07:37 -10:00
J. Nick Koston 910b6c9c2c
Index entity_registry_updated listeners (#37940) 2020-07-17 21:59:18 -07:00
Shulyaka 9ae08585dc
Add humidifier device triggers (#36887)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-17 21:57:52 -07:00
jjlawren a7dfa60208
Fix Sonos speaker lookup for Plex (#37942) 2020-07-17 18:18:53 -07:00
J. Nick Koston 1582e4347d
Mock out I/O in the default_config test (#37897)
This test never passed locally because of the I/O.
2020-07-17 18:17:40 -07:00
Ivan Belokobylskiy cecdce07cc
Fix Yandex transport Integration, add signature to requests (#37365) 2020-07-17 12:55:30 -07:00
Shulyaka cee136ec55
Add humidifier device conditions (#36962) 2020-07-17 11:33:52 -07:00
Shulyaka 7c9ef39ef6
Add humidifier intents (#37335)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-17 11:20:34 -07:00
Marcel van der Veldt 24ed932b01
Add ozw support for single setpoint thermostat devices (#37713)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-17 14:25:16 +02:00
J. Nick Koston f5b628c04f
Cleanup logbook tests to prevent failure on race condition (#37928) 2020-07-16 21:48:22 -07:00
Chris a6129467aa
Add RGB light support to ozw (#37636) 2020-07-16 18:10:36 -07:00
Perry Naseck 93919dea88
Add Firmata Integration (attempt 2) (#35591) 2020-07-16 17:58:45 -07:00
Alexei Chetroi 33dc015083
Fix ZHA electrical measurement sensor initialization (#37915)
* Refactor cached ZHA channel reads.

If doing a cached ZCL attribute read, do "only_from_cache" read for
battery operated devices only. Mains operated devices will do a network
read in case of a cache miss.

* Use cached attributes for ZHA electrical measurement

* Bump up ZHA zigpy dependency.
2020-07-16 16:25:42 -04:00
Eugene Prystupa 37a70c73a5
Improve bond startup performance (#37900) 2020-07-16 10:31:15 -05:00
mdegat01 16e5d02794
Add `ignore_attributes` option to influxdb (#37747)
* Added ignore_attributes option and tests

* adjusted config for overlapping customization with ignore attrs
2020-07-16 09:42:02 +02:00
Eugene Prystupa 0bfcd8c2ab
Refactor bond tests (#37868) 2020-07-15 15:49:58 -05:00
J. Nick Koston 9db6318122
Remove support for legacy logbook events created before 0.112 (#37822)
* Remove support for legacy logbook events created before 0.112

Reduce the complexity of the logbook code.  This
should also have a small performance boost.

* None is the default
2020-07-15 10:38:08 -10:00
Pascal Vizeli f4c3f5d074
Revert breaking change for Automation (#37885)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-15 20:38:29 +02:00
J. Nick Koston abe3e3094e
Provide workaround for missing/disabled/broken IPv6 (#37887) 2020-07-15 11:26:40 -07:00
J. Nick Koston 44fefb3216
Improve handling of template platforms when entity extraction fails (#37831)
Most of the the template platforms would check for
extract_entities failing to extract entities and avoid
setting up a state change listner for MATCH_ALL after
extract_entities had warned that it could not extract
the entities and updates would need to be done manually.
This protection has been extended to all template platforms.

Alter the behavior of extract_entities to return the
successfully extracted entities if one or more templates
fail extraction instead of returning MATCH_ALL
2020-07-14 22:34:35 -07:00
J. Nick Koston b430496b13
Switch async_track_state_change to the faster async_track_state_change_event part 4 (#37863)
* Switch async_track_state_change to the faster async_track_state_change_event part 4

Calling async_track_state_change_event directly is faster than async_track_state_change (see #37251) since async_track_state_change is a wrapper around async_track_state_change_event now

* pylint
2020-07-14 22:25:48 -07:00
J. Nick Koston e65235b207
Switch async_track_state_change to the faster async_track_state_change_event part 6 (#37869)
Calling async_track_state_change_event directly is faster than async_track_state_change (see #37251) since async_track_state_change is a wrapper around async_track_state_change_event now
2020-07-14 22:24:27 -07:00
J. Nick Koston bf72e3c965
Update august manufacturer name (#37867)
* Update august manufacturer name

This allows homekit to link the accessories to the august app

* yeah.. update the test
2020-07-14 18:03:24 -10:00
Eugene Prystupa b07d09f7dc
Add support for fireplaces to bond integration (#37850) 2020-07-14 22:27:03 -05:00
SukramJ d119c96aee
Add HmIP-FSI16 to HomematicIP Cloud (#37715) 2020-07-14 22:43:21 +02:00
J. Nick Koston d4111617ca
Ensure HomeKit does not throw when a linked motion sensor is removed (#37773) 2020-07-14 22:38:55 +02:00
J. Nick Koston f8d547f2d3
Adjust history as all scripts can now be canceled (#37820) 2020-07-14 22:31:34 +02:00
J. Nick Koston f5cbae0cd5
Avoid homekit crash when temperature is clamped above max value (#37746) 2020-07-14 22:21:10 +02:00
Bram Kragten 9ecaa10e51
Adjust icons for MDI bump (#37730) 2020-07-14 22:17:14 +02:00
Bram Kragten 7d77fa92c2
Add mode info attributes to script and automation (#37815)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-14 10:47:59 -07:00
Eugene Prystupa 515ad6164d
Add support for generic device (switch) to bond integration (#37837) 2020-07-14 08:54:33 -05:00
J. Nick Koston bfbb2826bc
Fix homekit_controller discovery via zeroconf (#37725) 2020-07-13 17:45:05 -07:00
Eugene Prystupa 95e72b4c4b
Map bond fan speeds to standard HA speeds (#37808) 2020-07-13 18:00:05 -05:00
Joakim Plate 1a64108eea
Switch rfxtrx to config entries (#37794)
* Switch to config flow setup

* Add minimal test for config flow

* Add myself as codeowner and address some review concerns

* Address some further review comments
2020-07-13 23:24:28 +02:00
Eugene Prystupa ed3f25489e
Apply bond python related feedback from a prior PR (#37821) 2020-07-13 23:07:35 +02:00
Paulus Schoutsen 9ac1475251
Simplify logger integration (#37780)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-13 10:20:18 -07:00
Paulus Schoutsen 8ed1a29c82
Drop white blacklist pt1 (#37816) 2020-07-13 17:43:11 +02:00
Joakim Plate ccbc3b5e39
Add rfxtrx ability to send a raw command to device (#37793)
* Add the ability to send a raw command to device

* Add a test for new service

* Use async test

* Sort includes
2020-07-13 16:54:52 +02:00
Joakim Plate aaa073183c
Drop dummy connection (#37805)
We now mock the module
2020-07-13 03:40:45 +02:00
Joakim Plate 87f6b7cdd4
Replace rfxtrx entity events with integration events (#37565)
* Drop per entity events

* Correct linting error

* Drop keys()
2020-07-13 02:57:19 +02:00
Eugene Prystupa f32f73a7d1
Add basic support for lights in bond integration (#37802) 2020-07-12 18:45:47 -05:00
Eugene Prystupa e9440c49d5
Add support for fan direction in bond integration (#37789)
* Add support for fan direction in bond integration

* Add support for fan direction (PR feedback)
2020-07-12 15:30:24 -05:00
Joakim Plate 53844488d8
Switch rfxtrx to integration level config (#37742)
* Switch to integration level config

* Switch to per device config rather than per entity type

* All roller shutters should be added as covers

(there are non lighting types)

* Fixup tests that used invalid packets for platforms

* Avoid variable re-use

* Allow control events on sensors too

That way we get signal level sensors for these too

* Lint correction

* Don't filter sensors from config

Disable sensors from GUI if the entities are not wanted

* Correct usage of ATTR_ instead of CONF_

* Make sure the logging when a new entity is added includes the event
2020-07-12 22:03:22 +02:00
Eric Severance 16a947aa5f
Add generic unavailable and last_updated metrics for prometheus (#37456)
* Add generic unavailable and last_updated metrics for prometheus

* Updated with feedback from the code review
2020-07-12 21:27:33 +02:00
Eugene Prystupa c6ab2c5d0a
Add Bond hub as a device for bond entities (#37772)
* Introduce Bond Hub concept

* Read Hub version information when setting up entry

* Link entities to Hub using via_device

* Add test to verify created Hub device properties
2020-07-12 11:31:53 -05:00
J. Nick Koston f16090caf4
Significantly improve logging performance when no integrations are requesting debug level (#37776) 2020-07-11 22:33:25 -07:00
Eugene Prystupa b7318b1914
Upgrade bond-home to 0.0.9 (#37764) 2020-07-11 20:04:07 -05:00
Eugene Prystupa 1e9bc278e0
Refactor Bond integration to remove duplication (#37740)
* Refactor Bond integration to remove duplication in Entity code and unit tests

* Refactor Bond integration to remove duplication in Entity code and unit tests (PR feedback)
2020-07-10 20:20:50 -05:00
Eugene Prystupa 366354c90c
Support Fan domain in Bond integration (#37703)
* Support Fan domain in Bond integration

* Support Fan domain in Bond integration

* Support Fan domain in Bond integration (apply PR feedback)

* Support Fan domain in Bond integration (apply PR feedback)
2020-07-10 19:23:35 -05:00
Phil Bruckner 63e55bff52
Remove legacy script mode and simplify remaining modes (#37729) 2020-07-10 17:00:57 -07:00
Joakim Plate 5255bf20d3
Add rfxtrx device classes to known types (#37698)
* Add device classes to known types

* Update homeassistant/components/rfxtrx/sensor.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-10 21:47:37 +02:00
Phil Bruckner 91271f388c
Add new repeat loop for scripts and automations (#37589) 2020-07-10 13:37:19 -05:00
Paulus Schoutsen 67b18aef5b
Fix Hue homekit discovery (#37694)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-07-10 09:37:36 -07:00
Joakim Plate 67038c6ba8
Rewrite rfxtrx init logic to do away with global object (#37699)
* Rewrite init logic to do away with global object

* Put constant at end

* Use a set instead of list for device_ids
2020-07-10 14:52:07 +02:00
Eugene Prystupa 69a8ba2af8
Add bond cover assumed state and local polling (#37666)
* Declare Bond covers as having assumed state, setup local polling for state updates

* Declare Bond covers as having assumed state, setup local polling for state updates (apply feedback from PR review)

* Declare Bond covers as having assumed state, setup local polling for state updates (apply feedback from PR review)

* Declare Bond covers as having assumed state, setup local polling for state updates (apply feedback from PR review)
2020-07-09 18:25:18 -05:00
Joakim Plate bcd604eec2
Detect lingering threads after tests (#37270)
* Detect lingering threads after tests

* Make sure cast is setup before checking state

* Make sure we ask executors of old hass to shutdown

We are not waiting here, just hoping for the best

* Make sure all instances of hass and executors is stopped.

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Also apply hass stopping to scripts

* Adjust to changes how we set up executor

* Add new CoreState.stopped

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-09 16:15:14 +02:00
cgtobi 155a5f7c26
Add back Netatmo public weather sensors (#34401)
* Add public weather sensors back in

* Remove stale code

* Cleanup after before adding entities

* Fix pylint complaint

* Add test for options flow

* Change mode to listbox

* Update .coveragerc

* Address comments

* Don't process empty list

* Address comment

* Fix mistake

* Make signal unique

* Make string more unique

* Fix merge conflict
2020-07-09 06:39:33 +02:00
jduquennoy af6a4bb6cf
Refactor Enocean part 1 (#35927)
* First step of an EnOcean integration refactoring, including code reorganisation and support of a setup config flow

* Moved title to root of strings file

* Fixed pre-commit checks failures

* Fixed linter errors

* Updated formatted string format in logs

* Removed leftover comment

* Multiple changes after PR change requests.
Using an import flow for yaml config, removed unnecessary logs, added proper unload in __init__ and EnOceanDongle
Replaced config state machine by several flows.
Serial port validity check done in the EnOceanDongle class asynchronously, removed unique ID from config flow
Multiple cosmetic changes

* Multiple changes after PR change requests

* Added variable to store default value, as setdefault was caught returning None when the empty dict literal was passed as an argument

* Literal used directly

* Added tests for EnOcean config flows, changed static methods to bundle methods for bundle

* Updated variable name

* Added missing mock to test, replaced repeated magic strings by constants

* Changed imports to avoid an unused import warning from pylint on DOMAIN

* Adding pylint exception for unused import

* Added proper propagation of setup and unload to platforms, removed dead code, some syntax changes

* Removed setup_entry forwarding as the entities can only be configured using yaml

* Removed forwarding of unload

* Enabled code coverage for config flow only

* Clean up coveragerc

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-08 20:46:38 -04:00
Shulyaka 872140123d
Add humidifier support to prometheus (#37112)
* Add humidifier support to promethease

* add humidifier dependency

* handle dependencies

* wrong place

* applied suggestions from code review

* fix typo

* Revert "wrong place"

This reverts commit 58e509d767.

* Revert "handle dependencies"

This reverts commit 74bd523e08.

* Revert "add humidifier dependency"

This reverts commit 8840b378e5.
2020-07-08 20:42:45 -04:00
Chris fd65ce08c1
Add ozw usercode support (#37390) 2020-07-08 16:41:53 -07:00
Ville Skyttä a077c280c8
Convert syncthru to config flow and native SSDP discovery (#36690)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-08 16:38:16 -07:00
Erik Montnemery fb3049d6a2
Set MQTT sensor to state unavailable when value expires (#36609) 2020-07-08 16:20:19 -07:00
Chris Talkington fb420d5952
Apply more suggestions from bond code review (#37592)
* apply more suggestions from bond code review

* Update cover.py

* Update test_cover.py

* Update test_cover.py

* Update test_cover.py

* Update cover.py

* Update utils.py

* Update test_cover.py

* Update test_utils.py

* Delete test_utils.py

* Update cover.py

* Update test_cover.py

* Update test_cover.py
2020-07-08 16:28:53 -05:00
Sava Tshontikidis c1de781a23
Add kwargs to send_magic_packet() service individually (#37387) 2020-07-08 14:25:21 -07:00
mdegat01 d60c52bbc7
Check buckets/dbs for validity during Influx sensor startup (#37391)
* Check buckets/dbs for validity during sensor startup

* Empty array instead of none
2020-07-08 15:37:43 -04:00
Raman Gupta 572d5a09cd
Vizio: when checking new host against existing config entry hosts, make check hostname aware (#37397)
* make ip check hostname aware

* add executor job for sync function doing IO and remove errant comma

* revert change to update new_data explicitly for options keys since it is already done later

* empty commit to retrigger CI
2020-07-08 15:31:41 -04:00
Erik Montnemery 550f9ba9b0
Modify cast tests to setup via cast integration (#37256)
* Improve tests

* Improve tests

* Don't start zeroconf from tests
2020-07-08 12:11:34 -07:00
Chris aa8f3ad307
Add OZW support for set_config_parameter service (#37523)
* Add support for set_config_parameter service

* Adjusted elif to if

* More if/else cleanup

* More if/else cleanup

* Less nesting

* End loop properly

* Added byte type

* Convert break to return
2020-07-08 20:59:52 +02:00
Eugene Prystupa 90c308a393
fix erroneous dependency used by Bond integration (simplejson to json) (#37642) 2020-07-07 20:36:22 -05:00
J. Nick Koston 3871688dfb
Fix homekit test mocking missed in loop changeover (#37628) 2020-07-07 15:14:58 -07:00
Marcel van der Veldt cbccf011e7
Ozw climate fixes (#37560)
* fix presets and mode conversion

* fix mapping issues in ozw climate

* build mapping table in advance

* Copying a dict to a list copies the keys by default
2020-07-07 16:20:57 -04:00
J. Nick Koston 76be95d7e0
Make devices and activities visible as harmony attributes (#37559)
* Make devices and activities visibile as harmony attributes

* Allow restoring previous activity, add tests

* fix test

* Kill activity_notify with fire

* remove trailing ,
2020-07-07 09:02:22 -05:00
jjlawren 7128092139
Fix missing Plex account mocks in tests (#37591) 2020-07-06 22:58:43 -07:00
J. Nick Koston bea3d841d2
Mock setup in plex test to prevent CI failure (#37590) 2020-07-06 17:25:22 -07:00
akloeckner d0668d3a6c
Add optimistic mode to template switch (#31637) 2020-07-06 16:32:33 -07:00
Paulus Schoutsen f49ce5d1b4
Protect loop set default executor (#37438)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-06 15:58:53 -07:00
jjlawren ba356c41e0
Fix Plex client controls when connected via plex.tv resource (#37572) 2020-07-06 15:16:41 -07:00
starkillerOG b9f97e64f8
Ignore HEOS 1, 3, 5 and 7 for DenonAvr ssdp discovery (#37579) 2020-07-06 15:16:21 -07:00
J. Nick Koston 711b8e10a3
Switch homekit to use async_track_state_change_event (#37253)
* Switch homekit to use async_track_state_change_event

Calling async_track_state_change_event directly
is faster than async_track_state_change and has
slightly lower latency triggering state updates
in homekit

* check for deleted entities

* Update additional tests for linked sensor removals

* Ensure removing entities does not result in an exception
2020-07-05 19:05:13 -07:00
Eugene Prystupa 9b77e16ffc
Add new integration for Bond hub (#37477)
* create foundation for Bond integration

* add Bond hub integration (fix lint)

* Update homeassistant/components/bond/__init__.py

adding async_unload_entry per PR review suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* add Bond hub integration (fix missing import after applying PR suggestion)

* Update tests/components/bond/test_init.py

add a unit for unloading per PR review suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/bond/test_init.py

add unit test for unload per PR review suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/bond/test_init.py

PR review suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/bond/test_init.py

PR review suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/bond/test_init.py

PR review suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* add Bond hub integration (fix formatting)

* Update homeassistant/components/bond/manifest.json

PR suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/bond/manifest.json

PR suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/bond/manifest.json

PR suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/bond/strings.json

PR suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/bond/manifest.json

PR suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update requirements_all.txt

PR suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/bond/manifest.json

PR suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update requirements_test_all.txt

PR suggestion

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* add Bond hub integration (remove friendly name from config per PR suggestion)

* Update homeassistant/components/bond/__init__.py

add per PR review feedback

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/bond/__init__.py

remove per PR review feedback

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/bond/test_init.py

fix unit test

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-05 20:17:53 -05:00
Joakim Plate 2088092f7c
Switch rfxtrx to dispatcher (#37271)
* Switch to dispatcher

* Adjust tests for dispatcher

* Store device in sensor

* Move state application into binary sensor entity class

* Move more specifics into per platform classes

* Should not apply event in init of sensor

* Switch to call_later

* Make apply_event public

* No point in slugifying debug logs

* Adjust error in off delay and event

* Make sure we match with masked id
2020-07-06 00:10:26 +02:00
Franck Nijhof 53545c984b
Log lines do not end with a full stop (#37527) 2020-07-05 23:04:19 +02:00
Joakim Plate 01fd33f173
Switch tests to use hass objects instead of direct (#37530)
* Switch tests to use hass objects instead of direct

* Make sure sensor update state

* Add some initial binary sensor tests

* Add initial binary sensor tests

* Add tests for pt2262

* Add test for off delay
2020-07-05 22:41:11 +02:00
Baptiste Candellier 3062312649
Add config flow + async support for SmartHab integration (#34387)
* Setup barebones SmartHab config flow

* Setup authentication flow

* Make setup async, add config flow receivers

* Add French translation

* Fix async issues

* Address review comments (thanks bdraco!)

* Fix unloading entries

* Migrate translations dir according to warning

* Create list of components

* Fix pylint false positive

* Fix bad copy-pastes 🤭

* Add async support to SmartHab component

* Address review comments (bdraco)

* Fix pylint

* Improve exception handling (bdraco)

* Apply suggestions from code review (bdraco)

Co-authored-by: J. Nick Koston <nick@koston.org>

* Don't log exceptions manually, fix error

* Reduce repeated lines in async_step_user (bdraco)

* Remove useless else (pylint)

* Remove broad exception handler

* Create strings.json + remove fr i18n

* Write tests for smarthab config flow

* Test import flow

* Fix import test

* Update homeassistant/components/smarthab/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-05 14:20:51 -05:00
Jeff Irion 10893f6246
Convert Android TV integration to async (#37510)
* Convert Android TV integration to async

* pylint

* Remove unused test code

* Require async versions of androidtv and adb-shell

* Cleanup

* Remove commented out code

* Use constants SHELL_RESPONSE_OFF and SHELL_RESPONSE_STANDBY
2020-07-05 14:13:08 -05:00
J. Nick Koston f0dda4f875
Fix flapping demo geo_location test (#37516) 2020-07-05 12:55:44 -05:00
Rick Sherman b56f4bd9f8
Fix Datadog boolean metrics (#37273)
Explicitly cast boolean metrics to integers
2020-07-05 12:50:51 -05:00
J. Nick Koston debb928b30
Use the main event loop for homekit (#37441)
* use hass.loop for homekit

* update calls for upstream pr

* Bump HAP-python to 2.9.2
2020-07-05 12:27:07 -05:00
J. Nick Koston b64ae55c66
Prebake common history queries (#37496)
* Prebake common history queries

The python overhead of to construct
the queries exceeded the database overhead.  We now
prebake the queries that get frequently polled.

This reduces the time it takes to update history_stats
sensors and can make quite a difference if there
are a lot of them.

When using the mini-graph-card card, all the entities
on the card being graphed are queried every few seconds
for new states. Previously this would tie up the database if there
are lot of these graphs in the UI.

* Update homeassistant/components/history/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/history/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* cache entity_filter in the lambda

* switch to yield

* Revert "switch to yield"

This reverts commit f8386f4940.

* get_states always returns a list

* query wasnt actually reusable so revert part of the breakout

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-05 11:03:23 -05:00
Phil Bruckner f7c4900d5c
Enhance automation integration to use new features in script helper (#37479) 2020-07-05 09:25:15 -05:00
J. Nick Koston 93df0a6d70
Fix flapping geonetnz_volcano test (#37497) 2020-07-04 19:06:42 -07:00
Shulyaka 5ba38e5053
Add humidifier support to emulated_hue (#37110)
* Add humidifier support to emulated_hue

* add humidifier dependency

* move dependency to after_dependency

* move dependency to hassfest
2020-07-04 17:53:36 -05:00
Franck Nijhof 7b855927e2
Fix flapping google_assistant tests (#37480) 2020-07-04 19:33:26 +02:00
Erik Montnemery b63655057c
Publish birth and will messages by default (#37371)
* Publish birth and will messages by default

* Remove useless copy
2020-07-04 17:49:08 +02:00
Erik Montnemery 4b3ad0a1cd
Support multiple MQTT availability topics (#37418)
* Support multiple MQTT availability topics

* Make availability list and availability_topic exclusive

* Make availability list and availability_topic exclusive

* Add missing abbreviation
2020-07-04 17:48:34 +02:00
Erik Montnemery 9ade1de3d5
Support empty output of MQTT binary_sensor value_template (#37420)
* Support empty output of MQTT binary_sensor value_template

* Strip white space

* Add test

* Add test
2020-07-04 17:48:02 +02:00
Erik Montnemery ebcee2eb35
Fix geonetnz_quakes test flapping (#37473) 2020-07-04 17:42:28 +02:00
Franck Nijhof 15b28bda14
Fix flapping geo_json_events tests (#37471) 2020-07-04 17:21:37 +02:00
starkillerOG ffcdd85117
Xiaomi Gateway subdevice support & AqaraHT + SensorHT devices (#36539)
* Gateway subdevice support & AqaraHT + SensorHT devices

* Gateway subdevice support & AqaraHT + SensorHT devices

* Add starkillerOG to codeowners

as proposed by @rytilahti in this issue: https://github.com/home-assistant/core/issues/36516

* add starkillerOG to xiaomi_miio

* fix config flow tests

* Update CODEOWNERS

* Update manifest.json

* prosess revieuw comments

* fix missing import

* use proper pressure unit hPa

* subdevice --> sub_device

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* subdevice --> sub_device

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* use key acces instead of get

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* subdevice --> sub_device

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* subdevice --> sub_device

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* subdevice --> sub_device

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* subdevice --> sub_device

* use dataclass instead of namedtuple

* update to newest python-miio functions (not yet released)

* Move device info to entitie

* remove unused variable

* improve default names

* SensorHT does not support pressure

* bump python-miio to 0.5.2

* bump python-miio to 0.5.2

* bump python-miio to 0.5.2

* Fix missing brackets

Co-authored-by: Teemu R. <tpr@iki.fi>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Teemu R. <tpr@iki.fi>
2020-07-04 14:56:16 +02:00
J. Nick Koston 4b2ebf5487
Ensure removed entities are not displayed in logbook (#37395) 2020-07-03 23:08:46 -07:00
Chris Talkington 1879183b24
Apply some suggestions from poolsense code review (#37440) 2020-07-03 15:38:05 -07:00
Chris Talkington 813e60d31a
Mock setup in directv config flow tests (#37439)
* mock setup in directv config flow tests

* Update test_config_flow.py
2020-07-03 17:31:57 -05:00
Bouwe Westerdijk d57dbb4319
Add Plugwise zeroconf discovery (#37289)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Tom Scholten <tom@sue.nl>
Co-authored-by: Tom <CoMPaTech@users.noreply.github.com>
2020-07-03 15:28:34 -07:00
Eugene Prystupa 80aebcc7d2
Add more unit tests for plum_lightpad (#37275)
* add more unit tests for plum_lightpad

* add more unit tests for plum_lightpad

* add more unit tests for plum_lightpad

* add more unit tests for plum_lightpad

* Update tests/components/plum_lightpad/test_init.py

apply suggested way to invoke async_setup_entry

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

apply suggested way to invoke async_setup_entry

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

apply suggested way to invoke async_setup_entry

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

remove now unused import

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

import Mock from tests.async_mock as suggested

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

remove now unused import

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* fix unit tests that were failing after suggested changes

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-03 16:40:17 -05:00
J. Nick Koston 76b956a969
Mock setup in sonarr config flow tests (#37432) 2020-07-03 16:20:17 -05:00
J. Nick Koston 07f3d6ebd8
Fix unmocked setup in ipp tests (#37430) 2020-07-03 11:43:13 -07:00
J. Nick Koston c460b7abc9
Fix unmocked setup in garmin_connect test (#37429) 2020-07-03 11:42:56 -07:00
ktnrg45 a445ebdf3c
Fix undesired power toggling (#37427) 2020-07-03 11:34:11 -07:00
Paulus Schoutsen 0c771f1c42
Replace asynctest with tests.async_mock (#37428) 2020-07-03 11:29:35 -07:00
J. Nick Koston 3eb6a68d12
Ensure async_setup is mocked in geonetnz intergration tests (#37426)
* Ensure async_setup is mocked in geonetnz intergration tests

* s/asynctest/tests.async_mock/g
2020-07-03 11:14:19 -07:00
J. Nick Koston ab6d6ac1ce
Reduce time to run zha discover tests (#37424)
Most of the time was registering services and patching
the clusters which are never calls in these tests
2020-07-03 12:57:04 -05:00
Joakim Plate ab4687d914
Convert rfxtrx tests to pytest async tests and re-enable (#37206)
* Rework and re-enable rfxtrx tests

* Add missed change to _signal_event

* Fixup the dummy serial that causes max cpu

* Make sure we cleanup thread here too

* Make sure we always wait for tasks before we check state

* Some more places we need to wait before checking
2020-07-03 10:22:02 +02:00
J. Nick Koston 7e664fbb3b
Ensure logbook entries appear when the logbook.log (#37388)
service without a domain or entity_id
2020-07-02 19:53:28 -05:00
mdegat01 91799e2b52
Modified Influx tests to mock test queries with accurate output (#37315) 2020-07-02 17:52:46 -07:00
Robert Van Gorkom a7cf76491b
Fix withings bug that grabbed oldest value instead of the newest (#37362)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-02 13:09:49 -07:00
Chris f6df85f8ce
Add ozw garage door barrier support (#37316) 2020-07-02 21:29:09 +02:00
J. Nick Koston f3039f96ec
Fix flapping gdacs tests (#37363) 2020-07-02 13:45:57 -05:00
Shulyaka 4ec71c58bd
Add humidifier support to homekit (#37207)
* Add humidifier support to homekit

* spell

* dependencies

* lint

* add linked humidity sensor for humidifiers

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* apply suggestions from code review

* pylint

* Fix tests

* Update homeassistant/components/homekit/type_humidifiers.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update tests/components/homekit/test_homekit.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* apply suggestions from code review

* lint

* pylint

* push

* test for unavailable linker sensor

* black

* valid values key case

* black

* Update homeassistant/components/homekit/type_humidifiers.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* black

* coverage

* Set current humidity to 0 if linked sensor removed or unavailable

* use last known humidity instead

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-02 12:53:11 -05:00
J. Nick Koston 8bce9be590
Fix flapping flux tests (#37346) 2020-07-02 10:51:31 -07:00
J. Nick Koston a87c29b5d9
Ensure logbook performs well when filtering is configured (#37292) 2020-07-02 09:12:27 -07:00
Franck Nijhof 235298a1b2
Add Hue manual bridge config flow + options flow (#37268)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-02 14:12:24 +02:00
Gage Benne bcabf6da91
Add Dexcom Integration (#33852)
* Initial commit for Dexcom integration

* Dexcom config flow testing

* Clarify errors during setup

* Resolve minor test issues

* Update sensor availability, resolve linting issues

* Add sensor tests

* Remove title due to 0.109, add abort

* >94.97% codecov/patch

* Move .translations/ to translations/

* Add constants for servers and unit of measurements

* Bump pydexcom version

* Updated domain schema, Dexcom creation

* Support for different units of measurement

* Update tests

* Remove empty items from manifest

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Raise UpdateFailed if fetching new session fails

* Switch everything over to required

* Simplify state information

* Simplify async_on_remove

* Pydexcom package now handles fetching new session

* Only allow config flow

* Remove ternary operator

* Bump version, pydexcom handling session refresh

* Using common strings

* Import from test.async_mock

* Shorten variable names

* Resolve tests after removing yaml support

* Return false if credentials are invalid

* Available seems to handle if data is empty

* Now using option flow, remove handling import

* Add fixture for JSON returned from API

* Overhaul testing

* Revise update options

* Bump pydexcom version

* Combat listener repetition

* Undo update listener using callback

* Change sensor availability to use last_update_success

* Update sensor availability and tests

* Rename test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-02 02:14:54 +02:00
mdegat01 52f3238e17
Add constant for PlatformNotReady wait time to use in tests (#37266) 2020-07-01 08:42:57 -07:00
Haemish Kyd 10786bbe7f
Create PoolSense integration (#35561)
* Created integration for PoolSense - a device to maintain your pool

* Updated poolsense integration with changes due to code review comments.

* Update poolsense with lint fix (logging-not-lazy)

* Update poolsense with lint fix (f string missing placeholders)

* Update homeassistant/components/poolsense/config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Added test for poolsense component. Updated config_flow to better follow the guidelines.

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Removed uneccessary functions.

* Added local venv to gitignore

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update to strings to allow for translations. Also some coding convention updates.

* Removed space in icon return

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Removed space in icon return

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Removed space in icon return

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/__init__.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/__init__.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/__init__.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Updated to include some error checks for pypi package

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update tests/components/poolsense/test_config_flow.py

* Update homeassistant/components/poolsense/sensor.py

* Apply suggestions from code review

* Update homeassistant/components/poolsense/__init__.py

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update homeassistant/components/poolsense/sensor.py

* Apply suggestions from code review

* Update homeassistant/components/poolsense/__init__.py

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-01 00:44:10 -05:00
Shulyaka 06e977b444
Add humidifier support to google_assistant (#37157) 2020-06-30 14:32:23 -07:00
J. Nick Koston 7746ecc9fb
Cache checking for entity exposure in emulated_hue (#37260)
Since we now base all of exposure checks on data that
will not change, we can cache the result instead
of calculating it every loop.

This change complements the work done in #32718
2020-06-30 13:22:17 -05:00
mdegat01 24289d5dbb
Refactor Influx logic to reduce V1 vs V2 code paths (#37232)
* refactoring to share logic and sensor startup error test

* Added handling for V1 InfluxDBServerError to start-up and runtime and test for it

* Added InfluxDBServerError test to sensor setup tests

* Raising PlatformNotReady exception from sensor for setup failure

* Proper testing of PlatformNotReady error
2020-06-30 20:02:25 +02:00
Phil Bruckner 38210ebbc6
Enhance script integration to use new features in script helper (#37201) 2020-06-30 10:22:26 -07:00
mdegat01 b78f163bb0
Changed FilterTest namedtuples to dataclasses (#37252) 2020-06-30 11:59:21 -05:00
Erik Montnemery 86c27b50f1
Bump pychromecast to 7.0.1 (#37225)
* Bump pychromecast to 7.0.1

* Fix tests

* Mark configuration via platform for removal in 0.116

* Fix uuid check
2020-06-30 16:35:10 +02:00
Michał Mrozek 61475d0a0c
Add support for window covers to ozw integration (#37217)
* feat: add cover to ozw

* fix: imports

* fix: formatting

* fix: improve code regarding comments

* add: cover tests

* fix: add position converting tests

* fix: convert cover position form zwave value

* fix: improve naming

* fix: increase coverage
2020-06-30 13:02:30 +02:00
Jeff Irion 4d17b18761
Register 'androidtv.learn_sendevent' service (#35707) 2020-06-29 18:17:04 -07:00
J. Nick Koston fae47358b8
Use shared zeroconf for discovery netdisco (#37237)
* Use shared zeroconf for netdisco

* Update netdisco

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-29 19:34:38 -05:00
Franck Nijhof 79f131066c
Ensure recorder data integrity and MySQL lock error handling (#37228) 2020-06-29 16:23:11 -07:00
MatthewFlamm 11debb1568
Fix wind speed change in NWS (#37222) 2020-06-29 15:41:52 -07:00
J. Nick Koston 89a9634d35
Use eventloop for scheduling (#37184)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-29 09:39:24 -07:00
J. Nick Koston 0f72008090
Ensure homekit state changed listeners are unsubscribed on reload (#37200)
* Ensure homekit state changed listeners are unsubscribed on reload

* fix mocking
2020-06-29 11:25:26 -05:00
Eugene Prystupa 7ef33a7219
Add first unit test to config flow for Plum Lightpad (#37183)
* add first unit test to config flow for Plum Lightpad

* add first unit test to config flow for Plum Lightpad (add changed requirements_test_all.txt)

* add first unit test to config flow for Plum Lightpad

* add first unit test to config flow for Plum Lightpad (bring coverage to 100%)

* add first unit test to config flow for Plum Lightpad

* add first unit test to config flow for Plum Lightpad (updated patch path as suggested)

* add first unit test to config flow for Plum Lightpad (add unit test for abort)
2020-06-29 18:07:43 +02:00
mdegat01 b96ce9c210
Additional testing for InfluxDB and some quality improvements (#37181)
* refactoring and added tests to sensor

* using caplog and not mocking main setup method in sensor tests
2020-06-29 17:31:49 +02:00
Gleb Sinyavskiy 4a374f0378
Limit and sort transmission torrents_info attribute (#35411) 2020-06-28 13:56:54 +02:00
Aaron Bach b0df223f5a
Bump aioguardian (#37188)
* Bump aioguardian

* Fix tests
2020-06-27 23:16:42 -06:00
Joakim Plate 464f17f182
Fixup rfxtrx tests to at least run (#37186) 2020-06-27 21:54:27 -07:00
J. Nick Koston 4acc6f333e
Improve scalability of state change event routing (#37174) 2020-06-27 14:46:45 -07:00
jjlawren ec13eecc59
Update Plex tests to mock websockets (#37147)
* Update Plex tests to mock websockets

* Avoid unnecessary class mock
2020-06-27 10:03:51 +02:00
mdegat01 d454f85572
Add support for glob matching in InfluxDB filters (#37069)
* added support for glob filtering to influx

* removed print and using dataclass instead of namedtuple
2020-06-27 00:01:32 +02:00
bsmappee 680f8f8d5a
Improve Smappee integration (#37087) 2020-06-26 10:46:14 -07:00
Franck Nijhof 7d74b74570
Fix recorder purging by batch processing purges (#37140) 2020-06-26 10:27:45 -07:00
J. Nick Koston 76db2b39b0
Move logbook continuous domain filtering to sql (#37115)
* Move logbook continuous domain filtering to sql

sensors tend to generate a significant amount of states
that are filtered out by logbook.  In testing 75% of
states can be filtered away in sql to avoid the
sqlalchemy ORM overhead of creating objects that will
be discarded.

* remove un-needed nesting
2020-06-26 09:12:50 -05:00
jjlawren 40573bf393
Plex tests cleanup and additions (#37117) 2020-06-25 23:24:58 -07:00
jjlawren fd1a8dd96c
Fix Plex when using local tokenless authentication (#37096) 2020-06-25 17:10:40 -07:00
Franck Nijhof f42eb0d5ca
Fix missing service call context in multiple locations (#37094) 2020-06-25 17:09:52 -07:00
Indu Prakash 15773cb3e0
Add worldclock custom format (#36157) 2020-06-25 11:41:53 -07:00
J. Nick Koston f4528d0db2
Ensure history states can be copied (#37081)
The filter integration makes a copy of a
state object obtained from history.
2020-06-24 22:43:08 -05:00
Paulus Schoutsen 5bc6ed4cef
Add logbook platforms (#37078)
* Add logbook platforms

* Fix logbook describe test
2020-06-24 18:14:50 -07:00
Aaron Bach 7968cd650a
Add concept of allowed external URLs to config (#36988)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-24 17:37:01 -07:00
uvjustin 8d69a4968f
Handle unexpected versions in forked_daapd zeroconf (#37053) 2020-06-24 14:19:08 +02:00
mdegat01 6c7355785a
Add support for glob matching to entity filters (#36913)
* Added GLOB capability to entityfilter and every place that uses it. All existing tests are passing

* added tests for components affected by glob change

* fixed flake8 error

* mocking the correct listener

* mocking correct bus method in azure test

* tests passing in 3.7 and 3.8

* fixed formatting issue from rebase/conflict

* Checking against glob patterns in more performant way

* perf improvments and reverted unnecessarily adjusted tests

* added new benchmark test around filters

* no longer using get with default in entityfilter

* changed filter name and removed logbook from filter benchmark

* simplified benchmark tests from feedback

* fixed apache tests and returned include exclude schemas to normal

* fixed azure event hub tests to properly go through component logic

* fixed azure test and clean up for other tests

* renaming test files to match standard

* merged mqtt statestream test changes with base

* removed dependency on recorder filter schema from history

* fixed recorder tests after merge and a bunch of lint errors
2020-06-23 20:02:29 -05:00
Shulyaka 26f09bae28
Add humidifier reproduce state (#36799)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-23 17:00:32 -07:00
Hedgehog57 fd1edf1bb6
Add resource_template to rest binary_sensor (#30703) 2020-06-23 15:08:55 -07:00
J. Nick Koston 152a80abed
Complete deprecation of hidden attribute (ATTR_HIDDEN) (#37041) 2020-06-23 17:05:32 -05:00
J. Nick Koston 5b79c1f9ef
Remove support for deprecated hidden attribute from logbook and history (#37039) 2020-06-23 13:40:39 -07:00
Erik Montnemery bb17cbdd83
Drop MQTT broker tls_version parameter (#37033) 2020-06-23 12:12:37 -07:00
J. Nick Koston 91e0395c1c
Optimize database indexes for existing queries (#37036)
Cleanup indexes as >50% of the db size was indexes,
many of them unused in any current query

Logbook search was having to filter event_types without
an index:

  Created ix_events_event_type_time_fired
  Dropped ix_events_event_type

States had a redundant keys on composite index:

  Dropped ix_states_entity_id
  Its unused since we have ix_states_entity_id_last_updated

De-duplicate storage of context in states as
its always stored in events and can be found
by joining the state on the event_id.

  Dropped ix_states_context_id
  Dropped ix_states_context_parent_id
  Dropped ix_states_context_user_id

After schema v9:

STATES............................................ 10186       40.9%
EVENTS............................................ 5502        22.1%
IX_STATES_ENTITY_ID_LAST_UPDATED.................. 2177         8.7%
IX_EVENTS_EVENT_TYPE_TIME_FIRED................... 1910         7.7%
IX_EVENTS_CONTEXT_ID.............................. 1592         6.4%
IX_EVENTS_TIME_FIRED.............................. 1383         5.6%
IX_STATES_LAST_UPDATED............................ 1079         4.3%
IX_STATES_EVENT_ID................................ 375          1.5%
IX_EVENTS_CONTEXT_PARENT_ID....................... 347          1.4%
IX_EVENTS_CONTEXT_USER_ID......................... 346          1.4%
IX_RECORDER_RUNS_START_END........................ 1            0.004%
RECORDER_RUNS..................................... 1            0.004%
SCHEMA_CHANGES.................................... 1            0.004%
SQLITE_MASTER..................................... 1            0.004%
2020-06-23 10:57:52 -07:00
Erik Montnemery 4e77969f5e
Drop use of mock_mqtt_component (#37013)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-23 10:17:22 -07:00
Shulyaka cf6480cda0
Add humidifier device actions (#36854) 2020-06-23 10:04:51 -07:00
Erik Montnemery 1b3e5460a9
Remove embedded MQTT broker (#37032) 2020-06-23 09:51:50 -07:00
Chris Talkington 6610bbe7bb
Add service to trigger roku search (#37014) 2020-06-23 09:03:43 -07:00
Thomas Hollstegge 2c7876fa66
Fix alexa flash briefings after removal of api_password auth (#36789) 2020-06-23 08:58:25 -07:00
Paulus Schoutsen e6d814da1d
Avoid Home connect test doing I/O (#37017) 2020-06-22 23:41:44 -07:00
Martin Hjelmare 149a3165e6
Fix coronavirus worldwide sum (#36737)
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-22 21:22:52 -07:00
J. Nick Koston ad6315be5c
Ensure recorder runs are cleaned up during purge (#36989)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-22 20:10:05 -07:00
Xiaonan Shen b4489e132c
Add DataUpdateCoordinator to pihole (#36684)
Co-authored-by: Ian <vividboarder@gmail.com>
2020-06-22 18:47:37 -07:00
Franck Nijhof 8b21b415c4
Fix/Rewrite of Toon integration (#36952)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-22 18:22:41 -07:00
Shulyaka c28493098a
Add new humidifier entity integration (#28693)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-22 17:59:16 -07:00
Erik Montnemery 747490ab34
Support reconfiguring MQTT config entry (#36537) 2020-06-22 17:49:01 -07:00
Chris 16f1ef5a44
Add attribute templates to template vacuum (#36518) 2020-06-22 17:21:20 -07:00
Jonas Thuresson 247df5874b
Xiaomii miio vaccum clean segment service (#36801) 2020-06-22 16:37:05 -07:00
zvldz e1060f154e
Make generic camera stream_source a template (#36123)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-22 16:11:18 -07:00
Paulus Schoutsen becc011135
Handle ArmDisarm execute without arm level (#36942) 2020-06-22 16:06:30 -07:00
Erik Montnemery 280f49540e
Drop use of async_mock_mqtt_component (#37011) 2020-06-22 23:59:50 +02:00
Erik Montnemery a2e2c35011
Use pytest for more MQTT tests (#36859)
* Use pytest for more MQTT tests

* Address review comments

* Break out PAHO client mock in separate fixture.

* tweak.
2020-06-22 22:02:29 +02:00
J. Nick Koston 53a91ece4e
Improve isoformat timestamp performance (#36991)
* adj

* time_fired_isoformat

* remove unused code

* tests for processing timestamps

* restore missing import lost in merge conflict

* test for None case
2020-06-22 12:06:02 -05:00
Robert Van Gorkom 5446641f09
User defined profile name for Withings (#36864) 2020-06-22 17:55:41 +02:00
J. Nick Koston e19c97af7c
Fix history api with no constraints (#36979) 2020-06-22 10:32:46 -05:00
rajlaud 3f427602ba
Squeezebox config flow (#35669)
* Squeezebox add config flow and player discovery

* Fixes to config flow

* Unavailable player detection and recovery

* Improved error message for auth failure

* Testing for squeezebox config flow

* Import configuration.yaml

* Support for discovery integration

* Internal server discovery

* Fix bug restoring previously detected squeezebox player

* Tests for user and edit steps in config flow

* Tests for import config flow

* Additional config flow tests and fixes

* Linter fixes

* Check that players are found before iterating them

* Remove noisy logger message

* Update requirements_all after rebase

* Use asyncio.Event in discovery task

* Use common keys in strings.json

* Bump pysqueezebox to v0.2.2 for fixed server discovery using python3.7

* Bump pysqueezebox version to v0.2.3

* Don't trap AbortFlow exception

Co-authored-by: J. Nick Koston <nick@koston.org>

* Refactor validate_input

* Update squeezebox tests

* Build data flow schema using function

* Fix linter error

* Updated en.json

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update .coveragerc for squeezebox config flow test

* Mock TIMEOUT for faster testing

* More schema de-duplication and testing improvements

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* Testing and config flow improvements

* Remove unused exceptions

* Remove deprecated logger message

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Implement suggestions from code review

* Add async_unload_entry

* Use MockConfigEntry in squeezebox tests

* Remove unnecessary config schema

* Stop server discovery task when last config entry unloaded

* Improvements to async_unload_entry

* Fix bug in _discovery arguments

* Do not await server discovery in async_setup_entry

* Do not await start server discovery in async_setup

* Do not start server discovery from async_setup_entry until homeassistant running

* Re-detect players when server removed and re-added without restart

* Use entry.entry_id instead of unique_id

* Update unittests to avoid patching homeassistant code

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-06-22 09:29:01 -05:00