Commit Graph

45 Commits (443147e132fd3714396aaf651a80840a0d2cfd1b)

Author SHA1 Message Date
Allen Porter 160bd74bae
Update DeviceInfo static types (#54276)
* Update nest static types from aditional PR feedback

Update nest and device helper static types based on post-merge discussion in PR #53475

* Remove unused type: ignore in synology

* Remove check for None device type

Remove check for None device type in order to reduce untested code as this is
a case not allowed by the nest python library.
2021-08-08 19:24:36 -07:00
Allen Porter 6376b4be5c
Increase static type coverage for nest integration (#53475)
Co-authored-by: Mick Vleeshouwer <mick@imick.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-07-27 01:43:52 +02:00
Ville Skyttä 19d25cd901
Change config entry state to an enum (#49654)
* Change config entry state to an enum

* Allow but deprecate EntryState str equality comparison

* Test fixes

* Rename to ConfigEntryState

* Remove str comparability backcompat

* Update new occurrences of strs cropped up during review
2021-05-20 19:19:20 +02:00
Allen Porter bcadccf7aa
Invalidate HLS Stream on nest url refresh failure (#47869)
This will ensure that the HLS stream is re-created and fetches a new url.
2021-03-14 22:49:21 -07:00
Erik Montnemery 84226da404
Update tests i-o to use async_get() instead of async_get_registry() (#47653) 2021-03-09 14:32:08 +01:00
Allen Porter 19f5b467b7
Make FAN_ON use the max duration rather than 15 min default (#46489) 2021-02-23 20:38:52 -06:00
Allen Porter 2bcf87b980
Change the API boundary between camera and stream with initial improvement for nest expiring stream urls (#45431)
* Change the API boundary between stream and camera

Shift more of the stream lifecycle management to the camera.  The motivation is to support stream urls that expire
giving the camera the ability to change the stream once it is created.

* Document stream lifecycle and simplify stream/camera interaction

* Reorder create_stream function to reduce diffs

* Increase test coverage for camera_sdm.py

* Fix ffmpeg typo.

* Add a stream identifier for each stream, managed by camera

* Remove stream record service

* Update homeassistant/components/stream/__init__.py

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

* Unroll changes to Stream interface back into camera component

* Fix preload stream to actually start the background worker

* Reduce unncessary diffs for readability

* Remove redundant camera stream start code

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-02-08 19:53:28 -08:00
Paulus Schoutsen 9e07910ab0
Mark entities as unavailable when they are removed but are still registered (#45528)
* Mark entities as unavailable when they are removed but are still registered

* Add sync_entity_lifecycle to collection helper

* Remove debug print

* Lint

* Fix tests

* Fix tests

* Update zha

* Update zone

* Fix tests

* Update hyperion

* Update rfxtrx

* Fix tests

* Pass force_remove=True from integrations

Co-authored-by: Erik <erik@montnemery.com>
2021-02-08 10:45:46 +01:00
Allen Porter eebd0d333e
Clear cached nest event images after expiration (#44956)
* Clear cached nest event images after expiration

* Don't share removal cleanup with alarm cleanup

Don't share code across these functions since it would require a dummy timestamp values that is unnecessary.

* Increase test coverage on sdm camera remove

* Update homeassistant/components/nest/camera_sdm.py

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

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-01-12 22:08:59 -08:00
Ville Skyttä 2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional (#44897)
* Make async_get_device connections Optional, default None

* Remove unnecessary async_get_device connections arg usages

Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.
2021-01-07 13:49:45 +01:00
Allen Porter 560e3811a3
Generate nest images thumbnails from events (#44638)
* Capture nest still images from events

Use python google-nest-sdm API for fetching images.  Update home assistant
to use the google-nest-sdm API for fetching the image contents generated
by the server.  This uses the existing websession object for server fetches,
reducing the amount of new code and facilites unit testing using the existing
mechanism.

Simplify tests using the image fetch API rather than a snapshot API
2021-01-06 07:02:04 -08:00
Allen Porter c92353088c
Fix Fan support in nest climate by adding HVAC_MODE_FAN_ONLY support (#44203)
* Add HVAC_MODE_FAN_ONLY to nest climate

* Remove unreachable code

* Fix HVAC_FAV_ONLY bug; must also turn off hvac
2021-01-04 16:43:41 +01:00
Allen Porter 321c0a87ae
Resolve nest pub/sub subscriber token refresh issues (#44686) 2021-01-02 01:51:01 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Allen Porter 051f6c0e72
Increase test coverage for Nest SDM integration (#44718) 2021-01-01 13:31:18 +01:00
Allen Porter fe9a254017
Fix legacy nest api binary_sensor initialization (#44674) 2020-12-31 19:22:24 +01:00
Allen Porter baacf2cd7d
Publish timestamps in nest events (#44641) 2020-12-30 10:23:48 +01:00
Allen Porter 71af0fac16
Improve nest setup error handling (#44385)
* Improve error handling user experience

This is meant to make the nest integration quieter.  Exceptions are handled with a single log error message.


Co-authored-by: j-stienstra <65826735+j-stienstra@users.noreply.github.com>
2020-12-27 20:30:51 -08:00
Allen Porter 51b88337ca
Simplify nest event handling (#44367)
* Simplify nest event handling

Use device specific update callbacks rather than a global callback.
The motivation is to prepare for a follow up change that will store
camera specific event tokens on the camera itself, so that a service
can later fetch event specific image snapshots, which would be difficult
to send across the event bus.

* Increase nest camera test coverage

* Remove unnecessary device updates for nest cameras

* Remove unused imports

* Fix device id check to look at returned entry

* Remove unused imports after rebase

* Partial revert of nest event simplification

* Push more update logic into the nest library

* Revert nest device_info changes

* Revert test changes to restore global update behavior

* Bump nest library version to support new callback interfaces
2020-12-27 09:49:22 +01:00
Allen Porter 24ccdb55bb
Move Legacy Works With Nest integration to subdirectory (#44368)
* Move Legacy Works With Nest integration to subdirectory

Motivation is to streamline the actively developed integration e.g. make code coverage easier to reason about and simplify __init__.py
2020-12-22 12:42:37 -08:00
Allen Porter 81341bbf91
Handle expiration of nest auth credentials (#44202)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-12-20 01:41:29 +01:00
Allen Porter 1a8123aba6
Increase nest climate test coverage (#44146) 2020-12-12 20:57:02 +01:00
Allen Porter 6d12e764b7
Increase test coverage for nest camera (#44144) 2020-12-12 10:17:43 +01:00
Allen Porter 0670124e8d
Address PR cleanup for nest device triggers (#43961) 2020-12-05 10:55:19 +01:00
Allen Porter 945a0a9f7e
Add nest device triggers for camera and doorbell events (#43548) 2020-11-30 09:19:42 +01:00
Paulus Schoutsen f9fa24950b
OAuth2 to use current request header (#43668) 2020-11-27 08:55:34 +01:00
Allen Porter 745823dd55
Add nest SDM API camera/doorbell events (#42700)
* Add nest SDM API camera/doorbell events

Events are fired  when pubsub messages are received.   When messages
are received lookup a home assistant device id from the nest
device id, so that the home assistant device id can be included
in the event payload.

* Update homeassistant/components/nest/__init__.py

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

* Update nest code style based on PR feedback

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-11-24 14:34:43 -08:00
springstan 5a892e8fca
Add unknown_authorize_url_generation to base strings for config flows (#42484) 2020-11-24 12:00:16 -05:00
Allen Porter 3dd14e05e3
Update nest library and switch events to async (#43583) 2020-11-24 08:53:50 -07:00
Allen Porter 2d14f07396
Improve nest SDM integration error handling (#43271) 2020-11-19 12:26:49 +01:00
Allen Porter 3e46c42307
Catch the right nest stream refresh exception error (#43189) 2020-11-13 22:37:09 -08:00
Allen Porter 94db07ca8c
Update nest sdm camera to refresh in background (#42865)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-11-10 23:48:02 +01:00
Allen Porter 64f06b2b00
Update nest SDM climate simplifying support for eco mode (#42955) 2020-11-09 11:35:38 +01:00
Allen Porter a5da98680a
Add nest climate support for SDM API (#42702)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-11-06 09:57:02 +01:00
Allen Porter 89a5c9fcac
Add image support to nest SDM api (#42556) 2020-11-03 09:31:43 +01:00
Allen Porter 8caa177ba1
Add Nest cam support for the SDM API (#42325)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-27 15:20:01 +01:00
Allen Porter 5e9de88f4b
Fix nest to stop doing asyncio in a property (#42312)
This upgrades to the latest vesion of python-google-nest-sdm that
had bug fixes to stop doing asyncio in a property.
2020-10-24 23:33:52 +02:00
Allen Porter 0c852b5f81
Update nest integration with fixes from initial PR (#42250) 2020-10-24 20:48:28 +02:00
Allen Porter 52b66e88c7
Update Nest integration to support Google Nest Device Access (new API) (#41689)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-21 10:17:49 +02:00
Christian Bilevits 1c4512bc40
Use common strings in Nest config flow (#41597) 2020-10-11 14:47:30 +02:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
Bas Nijholt 186799794d Sort imports according to PEP8 for nest (#29670) 2019-12-09 12:08:51 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen 8a777f6e78
Show notification when user configures Nest client_id/secret (#14970)
* Show notification when user configures Nest client_id/secret

* Lint
2018-06-15 15:19:58 -04:00
Paulus Schoutsen e014a84215
Nest config flow (#14921)
* Move nest to dir based component

* Add config flow for Nest

* Load Nest platforms via config entry

* Add tests for Nest config flow

* Import existing access tokens as config entries

* Lint

* Update coverage

* Update translation

* Fix tests

* Address strings

* Use python-nest token resolution

* Lint

* Do not do I/O inside constructor

* Lint

* Update test requirements
2018-06-13 11:14:52 -04:00