Commit Graph

122 Commits (040ece76ab690bf10af5490a921bc61db3f43d6b)

Author SHA1 Message Date
epenet 35df012b6e
Fix reauth step in nest (#74090) 2022-06-28 10:06:05 +02:00
Allen Porter cf9cab900e
Allow multiple configuration entries for nest integration (#73720)
* Add multiple config entry support for Nest

* Set a config entry unique id based on nest project id

* Add missing translations and remove untested committed

* Remove unnecessary translation

* Remove dead code

* Remove old handling to avoid duplicate error logs
2022-06-21 16:36:13 +02:00
Allen Porter b014d558ff
Add application credentials platform for nest and deprecate yaml for SDM API (#73050)
* Update the nest integration to be useable fully from the config flow

* Support discovery in nest config flow

* Remove configuration entries

* Remove unused import

* Remove dead code

* Update homeassistant/components/nest/strings.json

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

* Remove commented out code

* Use config flow for app auth reauthentication path

* Improves for re-auth for upgrading existing project and creds

* More dead code removal

* Apply suggestions from code review

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

* Remove outdated code

* Update homeassistant/components/nest/config_flow.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-06-15 07:15:53 -07:00
Allen Porter 0b7a030bd4
Fix fan support in nest, removing FAN_ONLY which isn't supported (#73422)
* Fix fan support in nest, removing FAN_ONLY which isn't supported

* Revert change to make supported features dynamic
2022-06-14 06:19:22 -07:00
Allen Porter 7a5fa8eb58
Update more nest tests to use common fixtures (#73303)
Update nest tests to use fixtures
2022-06-10 07:14:43 +02:00
uvjustin 73f2bca377
Make Stream.stop() async (#73107)
* Make Stream.start() async
* Stop streams concurrently on shutdown
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-06-08 00:10:53 +08:00
Allen Porter 3a8a816584
Cleanup nest config flow tests to use common setup fixtures (#72878)
* Cleanup nest config flow tests to use common setup

* Remove some conditionals in test setup
2022-06-02 21:42:52 -07:00
Erik Montnemery 47d0cc9b09
Update integrations to pass target player when resolving media (#72597) 2022-05-27 09:05:06 -07:00
Allen Porter c181af92a2
Throw nest climate API errors as HomeAssistantErrors (#72474) 2022-05-25 13:00:48 -07:00
Allen Porter 775be354a6
Cleanup nest async methods that do not need to actually await (#72170)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-05-20 07:47:18 -07:00
Allen Porter 5e49457c65
Add camera/stream platform diagnostics, exercised with nest (#69780) 2022-04-26 22:33:04 -07:00
Allen Porter bab9f4ba76
Fix nest error handling and bug in tests for media fetches (#70596) 2022-04-24 10:17:59 -10:00
Erik Montnemery 5e50a8abd5
Mark device triggers from hidden or auxiliary entities as secondary (#70335)
* Mark device triggers from hidden or auxiliary entities as secondary

* Update tests
2022-04-21 08:01:32 +02:00
Franck Nijhof c93c7e8eff
Replace Camera STREAM_ constants with StreamType enum (#69871) 2022-04-11 16:27:27 -07:00
Allen Porter 66a183cfe3
Add nest device level diagnostics (#68024) 2022-03-29 16:56:03 -10:00
Marc Mueller 8f69d31322
Make TypeVars private (3) (#68207) 2022-03-17 19:11:14 +01:00
Allen Porter 2678d8120a
Update nest media source to make device play most recent event (#67557) 2022-03-03 08:16:03 -08:00
Paulus Schoutsen 2a8dc38d2d
Move media_source to after_deps (#67195) 2022-02-24 14:54:46 -08:00
Allen Porter f3add292d5
Update nest climate set_temperature to allow hvac_mode (#66909) 2022-02-19 20:57:29 -08:00
Allen Porter 58551ec66d
Update nest camera tests to use common test fixture (#66192) 2022-02-17 23:08:29 -08:00
Allen Porter 572fa7d055
Update nest camera to pull still images from stream component (#66427)
* Update nest to use stream thumbnail when it exists

* Update nest camera to always pull still image from stream

Update nest camera to always pull the still iamge from the stream component,
removing the use of the separate ffmpeg call, and removing use of the nest event
image. Image for events can now be pulled using the media source APIs, rather
than relying on the camera snapshot.

* Simplify a comment

* Remove more unused variables

* Simplify comments, image, and test code

* Remove assertions for placeholder images
2022-02-14 21:45:09 -08:00
Allen Porter b2f5ab2008
Publish Nest Motion/Person events with optional user defined zone information (#66187)
Publish Nest events with zone information if present. User defined zones are configured
in the Google Home app, and are published with Motion/Person event.
2022-02-11 21:22:53 -08:00
Allen Porter ddd198de37
Fix legacy nest diagnostics to return empty rather than fail (#65824)
Fix legacy nest diangostics to return gracefully, rather than a TypError
by checking explicitiy for SDM in the config entry. Update diagnostics
to use the common nest test fixture, and extend with support for the
legacy nest config. Use the sdm test fixture in the existing legacy
tests so they all share the same config files.
2022-02-06 14:14:25 -08:00
Allen Porter 956ceb6c68
Update nest diagnostics (#65141) 2022-01-28 21:50:38 +01:00
Allen Porter ebaaa13759
Update nest climate and sensor test fixtures (#64800)
Update nest climate tests to use shared fixtures for component setup. Add an additional
fixture for creating devices shared between the climate and sensor tests.
2022-01-23 16:06:04 -08:00
Allen Porter a5fb60fd3a
Update nest media player device thumbnails (#64738) 2022-01-22 23:46:00 -08:00
Allen Porter cdf7742c3e
Refactor nest test_init_sdm tests to use fixtures with varied config types (#64736) 2022-01-22 20:56:03 -08:00
Allen Porter e56e25180b
Strip whitespace in nest cloud project id (#64503) 2022-01-20 09:13:49 +01:00
Allen Porter f1435b1385
Add diagnostic information for nest (#64405)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-01-19 09:30:48 +01:00
Allen Porter 849abaca8b
Bump google-nest-sdm to 1.5.0 and add nest mp4 clip transcoding to animated gif (#64155) 2022-01-15 12:31:02 -08:00
Allen Porter 64c5f69c3d
Add thumbnails to nest media player (#62532) 2022-01-13 22:31:33 -08:00
Marc Mueller d057850971
Update typing - collections.abc (3) (#63947) 2022-01-12 08:04:17 +01:00
Allen Porter 789c0a24dd
Improve nest media player clip/image and event handling for multiple events in a short time range (#63149) 2022-01-11 20:54:49 -08:00
Allen Porter 4203e1b064
Delete nest event image fetching and use same APIs as media player (#62789) 2022-01-07 16:37:54 +01:00
Allen Porter da71e89f53
Add tests that exercise nest dhcp discovery behavior (#62526)
* Add tests that exercise nest dhcp discovery

Add tests that exercise the behavior of dhcp discovery for nest,
which is effectively that it doesn't work -- it only works when
you have already added a configuration.yaml.

Discovery can be made to work by using an entirely config flow
driven approach, which is in discussion.

* Adjust whitespace from merge
2022-01-05 17:35:55 -08:00
Allen Porter d6c8f3965a
Improve nest camera failure handling on removal (#63207) 2022-01-05 16:17:51 +01:00
Allen Porter 224f960050
Set the nest configuration title to a user friendly name (#62886)
* Set the nest configuration title to a user friendly name

Set the config entry title name to be the name of the Google Home or
Nest Home that was authorized. In case more than one home was authorized,
they are all listed since they are all accessed over a single shared
home.

* Fix pylint errors

* Resolve pylint errors
2022-01-04 19:23:20 -08:00
Allen Porter 0bcad5579b
Set nest climate hvac_action to report idle when hvac mode is not off (#62811) 2022-01-04 17:28:46 +01:00
Allen Porter 9e3f7d2961
Simplify nest reauth config flow (#63058) 2022-01-02 21:43:50 +01:00
Allen Porter 15baea4ba3
Use more narrow exception catching in `nest` (#63225) 2022-01-02 18:54:56 +01:00
Allen Porter ebc8e19788
Revert nest reloading due to lock up (#63206) 2022-01-02 17:08:38 +01:00
Allen Porter 788373a7ca
Update legacy nest config flow tests to use modern best practices (#63019)
* Update legacy nest tests to use modern best practices

Update legacy nest integration config flow tests to test the config flow actually through the integration APIs rather
than interacting with the config flow object directly. This is a pre-factoring pulled out of a larger config flow revamp
where we want to exercise the actual production code for initializing configuration, config flows, and authentication
implementations.

* Revert some test name/comment changes

* Update setup calls to verify async_setup_legacy is called
2021-12-29 10:38:50 -08:00
Allen Porter 2df0adfbc7
Reload nest integration when new devices are added (#62976) 2021-12-29 12:20:55 +01:00
Allen Porter 17fbfe2eed
Set a suggested_area on nest devices based on the Google Home room name (#62871) 2021-12-27 11:39:57 -08:00
Ville Skyttä f913961d63
Use DeviceAutomationType in tests/components/[m-r]* (#62443) 2021-12-20 22:29:22 +01:00
Allen Porter 368e16f189
Simplify nest test patch using new keyword (#62336) 2021-12-19 11:45:04 -08:00
Allen Porter a63fa53275
Persist nest media events to disk backed storage (#61641)
* Persist nest media events to disk backed storage

Persist nest events in the media player to disk, targeting about ~500mb
per camera device as a cap. Events are stored in config/nest/event_media/.

Add a NestEventMediaStore is used for persistence. It has three main jobs:
- Read/write the key/value data that holds event data (event type, time, device, etc)
- Read/write media contents to disk
- Pick the filename for the media event based on device and event deatils

The nest event media manager library handles cache management and eviction, and by
default uses an in memory cache. Home Assistant nest integration now provides the
disk backed implementation, which is invoked by the nest library.

The store reads the event metadata key/value dict on startup, and then writes it
back with a short delay of 5 seconds to avoid unnecessary writes.

Future work planned includes:
- Possibly a small memory buffer for media objects themselves. This could make sense
  when adding thumbnails to the media player grid to avoid unnecessary fetches
- Transcoding mp4 clips to animated image previews

* Address style errors

* Cleanup from CI test/pylint/etc.

* Put media for each device into its own directory

* Update comments for media store

* Decrease # of events to lower disk requirements

Target more like 1k events, to reduce disk needs.

* Address PR feedback

* Update homeassistant/components/nest/media_source.py

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

* Ignore incorrect mypy in nest library

* Fix pylint errors

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-12-18 23:53:40 -08:00
Allen Porter bff677e34e
Bump google-nest-sdm to 0.4.8 (#61851) 2021-12-15 13:12:38 +01:00
Allen Porter efbec55818
Suppress errors for legacy nest api when using media source (#61629) 2021-12-13 17:41:45 +01:00
Allen Porter cd001d0243
Only publish nest camera event messages once per thread and bump nest version (#61587) 2021-12-12 14:12:05 -08:00