Commit Graph

152 Commits (0dea4f2ad1ce7b864657dc114698e1bcce49cf71)

Author SHA1 Message Date
Franck Nijhof 4cf186a47e
Small collection of random styling tweaks, fixes and Pythonism (#35390) 2020-05-09 00:10:17 +02:00
Franck Nijhof e3e3a113e9
async_get_url -> get_url (#35382) 2020-05-08 21:53:28 +02:00
Franck Nijhof 2223592486
Add get_url helper, deprecate base_url (#35224) 2020-05-08 02:29:47 +02:00
J. Nick Koston 6f6c670b3b
Make alexa and google aware of DEVICE_CLASS_GATE (#35103) 2020-05-03 13:29:12 -07:00
Bram Kragten 01599d44f5
Google local sdk: Set right port, correct device id and add base url (#34358) 2020-04-17 20:59:49 -07:00
Paulus Schoutsen 1ac8442c63
Fix Cloud UI bug preventing managing Google 2FA (#34241)
* Fix Cloud UI bug preventing managing Google 2FA

* Update comment
2020-04-15 08:43:43 -07:00
springstan fb8f8133a0
Use HTTP_INTERNAL_SERVER_ERROR constant (#33832) 2020-04-08 23:20:03 +02:00
springstan ed71683488
Improve string formatting (#33643) 2020-04-04 20:17:11 +02:00
Franck Nijhof 7d3c974747
Use set & dict literals (#33636)
Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
2020-04-04 20:05:15 +02:00
Paulus Schoutsen f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
Paulus Schoutsen 6afe6acb6c
Mark new gate device class as 2FA (#33541) 2020-04-02 22:02:59 +02:00
Paulus Schoutsen 06216a8a45
Google Assistant: parallize as many requests as possible (#33472)
* Google Assistant: parallize as many requests as possible

* Fix double comment
2020-03-31 12:01:31 -07:00
Oxan van Leeuwen 6180f7bd64
Fix Google Assistant temperature control for entity without mo… (#33107) 2020-03-23 16:57:26 -07:00
Paulus Schoutsen 900714a3ee
Do not report state when closing down (#32168) 2020-02-25 09:05:36 -08:00
springstan ad102b3840
Use f-strings in integrations starting with "F"and"G" (#32150)
* Use f-strings in integrations starting with F

* Use f-strings in tests for integrations starting with F

* Use f-strings in integrations starting with G

* Use f-strings in tests for integrations starting with G

* Fix pylint error

* Fix broken test
2020-02-24 17:54:20 -08:00
Paulus Schoutsen 4501471b8c
Google Assistant: Remove speaker type and earlier filter out devices from being locally exposed (#31830)
* Remove speaker type

* Do not expose locks or alarms to Google Local
2020-02-14 15:28:11 -08:00
Franck Nijhof 826433b680
Fix device name Google Assistant when using aliases (#31416)
* Fix device name Google Assistant when using aliases

* Adjust cloud tests
2020-02-02 14:48:13 -08:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Paulus Schoutsen e9e44dbd97
Fix callback and async (#31281)
* Fix callback and async

* Fix a return

* Fix test

* Fix mqtt tests

* Fix some more callbacks
2020-01-29 13:59:45 -08:00
Paulus Schoutsen 8ceef72853
Google Assistant: Track if request is local (#31226)
* Track if request is local

* Cancel early if 2FA disabled

* Allow disabling 2FA for ack

* Do not mark devices with 2FA as reachable

* Add request source to GA events
2020-01-28 10:54:39 -08:00
Franck Nijhof 345cc244ed
Correct names in manifests (C-L) (#30532) 2020-01-07 08:19:17 +01:00
Paulus Schoutsen 05374d7c85
Fix google sync (#30524) 2020-01-06 22:00:39 +01:00
Joakim Plate 8dc57a3700
Allow all sources and sound modes to be selected in google assistant (#30418)
* Simplify media player source list

Google don't need a whitelisted set of modes anymore. So let's just forward any mode that we have.

* Report current mode with the setting name, not a synonym

* Refactor mode generation to support other modes

* Support sound mode as mode as well

* Adjust failing test now with sound modes
2020-01-04 00:39:03 +01:00
Joakim Plate 0944d02262 Mark API key as deprecated (#30402)
Service account should be used instead
2020-01-03 12:12:29 +01:00
Joakim Plate 039cc98278 Support case of unknown/unavailable temperature/humidity (#29959)
* Support case of unknown/unavailable temperature/humidity

State is never None, just a string.

* Lint suggestion
2019-12-16 08:04:59 +01:00
Bas Nijholt 7f948594eb Sort imports according to PEP8 for google_assistant (#29633)
* sort imports and fix flake8 issue for google

* add isort:skip to EVENT_SYNC_RECEIVED
2019-12-09 20:00:14 +01:00
springstan b759d50900 Move imports to top for google_assistant (#29561)
* Move imports to top for google_assistant

* Fix pylint error caused by isorting the imports with noqa: F401

* Move back an import because of circular dependency, add annotations
2019-12-08 09:45:13 +01:00
Paulus Schoutsen e99184bf68 Install requirements of after_dependencies when loading integrations (#29491)
* Install requirements of after_dependencies when loading integrations

* Fix smartthings test
2019-12-05 09:28:56 +01:00
Joakim Plate 4191d9ca8d Report unavailable entities to google (#28501)
* Report unavailable entites to google.

Entities should only removed when removed from HA. Removing a temporarily unavailable entity from google causes it to need to re-configured once it become available again.

* Fix test for unavailable entities
2019-12-02 22:14:16 -08:00
Joakim Plate 2569c4ae37 Google assistant storage of connected agents (#29158)
* Make async_report_state take agent_user_id

* Attempt to store synced agents

* Drop now not needed initialization

* Make sure cloud uses the all sync on changed preferences

* Some more places to use all version of sync

* Get the agent_user_id from the request context if available

* Minor cleanup

* Remove the old fixed agent_user_id for cloud

Instead pass along cloud_user where appropriate.

* async_delay_save takes a function

* Adjust test for delayed store

* Remove unused save function

* Add login check.
2019-12-02 22:05:59 -08:00
Joakim Plate 69991bf3a2 Move GoogleConfig initialization into setup of component (#29170) 2019-11-27 20:45:43 -08:00
Joakim Plate 06231e7ac2
Move request sync logic into GoogleConfig (#28227)
* Move request sync logic into GoogleConfig

* Return http status code for request_sync same as cloud

* agent_user_id is not optional for async_sync_entities now

* No need in checking parameter here

* Adjust some things for cloud tests

* Adjust some more stuff for cloud tests

* Drop uneccessary else

* Black required change

* Let async_schedule_google_sync take agent_user_id

* Assert return value on api call

* Test old api key method

* Update homeassistant/components/google_assistant/helpers.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
2019-11-26 22:47:13 +01:00
Ville Skyttä 99c7608fb4 Lint config cleanups (#28864)
* Remove bunch of unneeded lint exclusions

* Use symbolic names instead of identifiers in pylint disables

* Tighten scope of some pylint disables
2019-11-25 22:40:08 -08:00
Shulyaka 1f72de108c google_assistant: support for humidity sensors (#28695) 2019-11-25 22:12:20 -08:00
Joakim Plate 5fd9b474dc Always provide brightness value (#28228)
HA will remove attribute when light is off, but google expect all trait data all the time.
2019-11-03 11:36:02 -08:00
Joakim Plate 2bd9f5680d Report state (#27759)
* Add report state config

* Add initial steps for local report state

* Use owner of system as user_id

* First working prototype

* Only report state if requested

* Add some good logging and adjust constant name

* Move jwt generation out to non member

* Move cache out to caller

* Remove todo about cache

* Move getting token out of class

* Add timeout on calls

* Validate config dependency

* Support using service key to do sync call when api_key is not set

* Make sure timezone is fixed for datetime dummy

* Use exact expire_in time

* Support renewing token on 401

* Test retry on 401

* No need to declare dummy key twice

* Correct some docs on functions

* Add test for token expiry
2019-10-18 22:37:44 -07:00
Paulus Schoutsen 6303117354
Dont create coroutine until acting on it (#27907) 2019-10-18 20:58:43 -07:00
Paulus Schoutsen e866d769e8
Google Assistant Local SDK (#27428)
* Local Google

* Fix test

* Fix tests
2019-10-13 14:16:27 -07:00
Paulus Schoutsen 9e121b785a
Google: catch query not supported (#27559) 2019-10-12 14:07:01 -07:00
Paulus Schoutsen 2ab6eb4fa0
Revert "Allow Google Assistant relative volume control (#26585)" (#27416)
This reverts commit 95c537bee8.
2019-10-10 12:46:40 -07:00
Ryan Ewen 95c537bee8 Allow Google Assistant relative volume control (#26585)
* Allow Google Assistant volume control without volume_level

* Add test for relative volume control w/o volume_level
2019-10-10 17:53:52 +03:00
Paulus Schoutsen a51e0d7a5f
Google: Report all states on activating report state (#27312) 2019-10-08 09:58:36 -07:00
Paulus Schoutsen f184bf4d85 Add Google Report State (#27112)
* Add Google Report State

* UPDATE codeowners"

* Add config option for dev mode

* update library

* lint

* Bug fixes
2019-10-03 13:02:38 +02:00
Franck Nijhof c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
Rami Mosleh d1adb28c6b Add google_assistant alarm_control_panel (#26249)
* add alarm_control_panel to google_assistant

* add cancel arming option

* raise error if requested state is same as current

* rework executing command logic

* Add tests

* fixed tests

* fixed level synonyms
2019-09-25 10:13:31 -07:00
Bryan York f45f8f2f3d Emulate color temperature for non-ct lights in light groups (#23495)
* Emulate color temperature for non-ct lights in light groups

* fix tests

* Address review comments

* Fix black formatting

* Fix for pylint

* Address comments

* Fix black formatting

* Address comments
2019-09-15 20:53:05 +02:00
Ville Skyttä 33e1b44b3a
Use PEP 526 type annotations, add some type hints (#26464)
* Add some more type hints to helpers.event

* Change most type comments to variable types

* Remove some superfluous type hints
2019-09-07 09:48:58 +03:00
Franck Nijhof fa79ef1220 Use literal string interpolation in integrations E-G (f-strings) (#26379) 2019-09-03 17:10:56 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
nierob 979f801488 Avoid creating temporary lists (#25317)
That gives nano performance improvements as *() is slightly faster
then *[].
2019-07-19 13:36:18 -07:00