Commit graph

104 commits

Author SHA1 Message Date
Allen Porter
93afc9458a
Update nest to only include the image attachment payload for cameras that support fetching media (#124590)
Only include the image attachment payload for cameras that support fetching media
2024-08-31 11:38:45 -07:00
Allen Porter
18212052a4
Update nest events to include attachment image and video urls (#124554) 2024-08-25 21:24:06 +02:00
Allen Porter
3e3d27f48d
Add nest event platform (#123042)
* Add nest event platform

* Translate entities

* Put motion events into a single entity type

* Remove none types

* Set event entity descriptions as kw only

* Update translations for event entities

* Add single event entity per trait type

* Update translation keys
2024-08-24 08:44:44 -07:00
Allen Porter
f046545883
Fix nest to cancel event listener on config entry unload (#119257) 2024-06-10 08:18:50 +02:00
Allen Porter
fc931ac449
Stop the nest subscriber on Home Assistant stop (#117830) 2024-05-20 22:59:11 -07:00
Sid
ac54cdcdb4
Enable Ruff RUF010 (#115371)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-08 23:54:49 +02:00
Marc Mueller
988c71ecc5
Add empty line after module docstring [n-q] (#112702) 2024-03-08 15:04:07 +01:00
Jan-Philipp Benecke
28281523ec
Add pylint plugin to check for sorted platforms list (#108115) 2024-01-16 09:47:53 +01:00
Erik Montnemery
7539cf25be
Don't require passing identifiers to DeviceRegistry.async_get_device (#96479)
* Require keyword arguments to DeviceRegistry.async_get_device

* Update tests

* Update tests

* Don't enforce keyword arguments
2023-07-13 13:39:25 -04:00
Allen Porter
bc2319bbe6
Update Nest Legacy removal strings (#96229) 2023-07-10 11:22:15 +02:00
Allen Porter
c4a39bbfb1
Remove Legacy Works With Nest (#96111)
* Remove Legacy Works With Nest

* Simplify nest configuration

* Cleanup legacy nest config entries
2023-07-09 19:38:05 -07:00
Allen Porter
e7433c42b9
Cleanup code from nest yaml migration and OOB auth deprecation (#92311) 2023-04-30 18:00:40 -07:00
Franck Nijhof
fcb612cd6f
Collection of code styling tweaks (#87344) 2023-02-03 23:51:27 +01:00
Franck Nijhof
baef267f33
String formatting and max line length - Part 3 (#84394) 2022-12-22 13:35:47 +01:00
epenet
7871a517a8
Import constants from root (#78271) 2022-09-12 18:53:05 +02:00
Erik Montnemery
c741d9d045
Update integrations to import issue_registry from helpers (#77305)
* Update integrations to import issue_registry from helpers

* Update tests
2022-08-25 15:33:05 +02:00
Allen Porter
26e2ef8175
Add repair issues for nest app auth removal and yaml deprecation (#75974)
* Add repair issues for nest app auth removal and yaml deprecation

* Apply PR feedback

* Re-apply suggestion that i force pushed over

* Update criticality level
2022-08-02 03:20:20 +02:00
J. Nick Koston
cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
Allen Porter
0cf922cc4e
Allow legacy nest integration with no configuration.yaml (#74222) 2022-06-30 08:54:51 +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
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
Franck Nijhof
c3d19f3827
Clean up accessing device_registry helpers via hass (#72031) 2022-05-17 12:22:15 -07:00
Franck Nijhof
69cc6ab5f1
Clean up accessing entity_registry.async_get_registry helper via hass (#72005) 2022-05-17 16:40:45 +02:00
Allen Porter
bab9f4ba76
Fix nest error handling and bug in tests for media fetches (#70596) 2022-04-24 10:17:59 -10:00
Marc Mueller
6e49b0e122
Use assignment expressions [K-Z] (#66881) 2022-02-19 17:19:46 +01: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
737ac7cb7c
Cleanup nest auth registration, moving out of __init__.py (#63350) 2022-01-17 22:17:23 -08: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
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
fdb4b1d7f0
Cleanup nest config flow (#63351) 2022-01-04 16:33:17 +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
2df0adfbc7
Reload nest integration when new devices are added (#62976) 2021-12-29 12:20:55 +01: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
bbe4a67a98
Coalesce nest media source preview clips by session and bump google-nest-sdm (#61081) 2021-12-05 23:59:24 -08:00
Marc Mueller
e0cb33a0a1
Use platform enum (4) [M-O] (#60940) 2021-12-05 17:06:35 -10:00
Allen Porter
5fdcbbe0e1
Fetch media for events for rendering in the nest media player (#61056) 2021-12-05 09:45:40 -08:00
Allen Porter
ba99dc3af9
Add Nest Battery Cam event clip support with a Nest MediaSource (#60073) 2021-12-03 10:53:05 -08:00
Allen Porter
cc543b200d
Update nest config flow to dramatically simplify end user setup with automated pub/sub subscription creation (#59260)
* Configure nest pubsub subscriber automatically

Update the config flow to configure the nest pubsub subscriber automatically.
After completing the authentication step, the user is now asked for the google
cloud console ID, which is needed to create a subscription.

Home Assistant manages the lifecycle of a subscription only when it is created
by the ConfigFlow. Otherwise (if specified in configuration.yaml) it treats
it similarly as before.

These are the considerations or failure modes taken into account:
- Subscription is created with reasonable default values as previously recommended (e.g. retion only keeps 5-15 minutes of backlog messages)
- Subscriptions are created with a naming scheme that makes it clear they came from home assistant, and with a random
  string
- Subscriptions are cleaned up when the ConfigEntry is removed. If removal fails, a subscription that is orphaned will
  be deleted after 30 days
- If the subscription gets into a bad state or deleted, the user can go through the re-auth flow to re-create it.
- Users can still specifcy a CONF_SUBSCRIBER_ID in the configuration.yaml, and
skip automatic subscriber creation

* Remove unnecessary nest config flow diffs and merge in upstream changes

* Incorporate review feedback into nest subscription config flow

* Update text wording in nest config flow
2021-11-29 22:41:29 -08:00
Allen Porter
0991a30125
Pre-factor nest subscriber to library (#59462)
* Pre-factor nest subscriber to library

Move the nest subscriber to a library that can be reused in a future PR:
- From ConfigFlow for creating subscriptions
- On nest removal to delete subscriptions

This is pulled out of PR #59260 to make that easier to review.

* Resolve pylint error in nest api subscriber

* Remove duplicate constants
2021-11-14 16:08:22 -08:00
Allen Porter
fa4e890696
Revamp nest authentication config flows and remove need for redirect urls (#59033)
* Add support for Installed Auth authentication flows.

Add support for additional credential types to make configuration simpler for
end users. The existing Web App auth flow requires users to configure
redirect urls with Google that has a very high security bar: requires ssl,
and a publicly resolvable dns name.

The new Installed App flow requires the user to copy/paste an access code
and is the same flow used by the `google` calendar integration. This also
allows us to let users create one authentication credential to use with
multiple google integrations.

* Remove hard migration for nest config entries, using soft migration

* Add comment explaining soft migration

* Revet changes to common.py made obsolete by removing migration

* Reduce unnecessary diffs in nest common.py

* Update config entries using library method

* Run `python3 -m script.translations develop`

* Revert nest auth domain

* Remove compat function which is no longer needed

* Remove stale nest comment

* Adjust typing for python3.8

* Address PR feedback for nest auth revamp
2021-11-04 15:56:16 -07:00
Allen Porter
f1b082a369
Publish nest event ids in camera related events (#58299) 2021-10-26 10:14:12 -05:00
Allen Porter
7627b959f8
Fix format bug in nest log statement (#58263)
* Fix format bug in nest log statement

* Resolve lint error logging-fstring-interpolation
2021-10-22 21:33:19 -07:00
Marc Mueller
70469e0979
Use assignment expressions 23 (#58180) 2021-10-22 11:13:05 +02:00
Marc Mueller
4f8148f9ea
Use assignment expressions 07 (#57787) 2021-10-17 20:24:34 +02:00
Ville Skyttä
939fde0a50
ConfigType and async_setup/setup type hint improvements (#54739) 2021-08-18 13:22:05 +02: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
Allen Porter
c2a2f50316
mypy cleanup for homeassistant.components.nest (#53214) 2021-07-20 07:59:31 +02:00