Commit Graph

93 Commits (bf649e373cb05753882aea0b4513eaac62619d64)

Author SHA1 Message Date
Paulus Schoutsen 0f49a9cb7b
Return state when changing optimistic covers (#23498) 2019-04-28 12:09:20 -07:00
Paulus Schoutsen b09f5b6743 Only include agent user ID in SYNC responses (#23497) 2019-04-28 09:42:05 +02:00
Joakim Plate 39932d132d Add device classes for media player and map to google types (#23236)
* Add device classes for media player and map to google types

* Switch default class for media_player to media
2019-04-25 13:12:11 -07:00
Joakim Plate 62fcb1895e Device type garage for binary sensor garage_door (#23345)
* Switch binary sensor to garage for garage_door

* Add test for cover garage device type
2019-04-24 09:56:22 -07:00
Joakim Plate e11e6e1b04 Volume trait for google assistant (#23237)
* Add action.devices.traits.Volume

* Drop media player from brightness trait

* Factor out commands into separate functions

* Drop support for explicit mute
2019-04-24 09:08:41 -07:00
Joakim Plate 7c55b9f087 Expose door cover/binary_sensor as door type (#23307)
* Expose door cover/binary_sensor as door type

More logical to ask "What doors are open" than "What sensors are open"

* Add test for binary_sensor device_classes

* Cosmetic flake8

* Add test for device class for cover
2019-04-23 19:25:20 -07:00
Paulus Schoutsen aa26f90420
Add sensor and binary senseor to default expose (#23332) 2019-04-23 19:19:23 -07:00
Paulus Schoutsen 0533f56fe3
Ask users for a pin when interacting with locks/garage doors (#23223)
* Ask users for a pin when interacting with locks/garage doors

* Deprecate allow_unlock option
2019-04-19 14:50:21 -07:00
Joakim Plate 4a2a130bfa Google assistant skip missing type (#23174)
* Skip entity if no device type found

* Add test for potentially skipped binary sensors

* Reorg code, add tests to ensure all exposed things have types

* Lint

* Fix tests

* Lint
2019-04-17 22:37:39 -07:00
Joakim Plate 1bfccd803f Allow switches to be represented as outlets on google assistant (#23149)
* Add device class support for switch to support outlet type

* Add a test for cover device class sync

* Drop remnant unused import
2019-04-16 17:07:14 -07:00
giefca 497038b332 Add Google Assistant garage type (#23115)
* Tests

* Add Google Assistant GARAGE type

* Update test_trait.py

* Key device class by domain

* Update smart_home.py
2019-04-15 13:05:53 -07:00
giefca b804919eaa Fix for stateless covers (#22962)
* Corrections and test

* Raise error if does not support setting position

* Raising error for stateless and assumed state covers

* Fix pylint

* Tests

* Update test_trait.py
2019-04-14 19:52:00 -07:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Paulus Schoutsen f33bf718c7
Google Assistant: Migrate light setting trait to use HSV color spectrum (#22980)
* Migrate light setting trait to use HSV

* Fix tests

* Fix all the typos
2019-04-10 21:35:37 -07:00
Paulus Schoutsen 51e6d5380e
Add color setting trait (#22894) 2019-04-09 20:17:13 -07:00
Paulus Schoutsen cfe4cf30ad
Add manifests (#22699)
* Add manifests

* Update auto name

* Update codeowners

* Add requirements from platforms

* Minor cleanup

* Incorporate changes from awarecan PR
2019-04-03 21:14:45 -07:00
Paulus Schoutsen 14da2fd8c9
Google Assistant: Add support for open/close binary sensors (#22674)
* Google Assistant: Add support for binary sensors

* Update test
2019-04-03 10:20:56 -07:00
Tobias Sauerwein 048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Paulus Schoutsen b1cca25299 Deal with cover assumed state (#22673)
* Deal with cover assumed state

* Add docs
2019-04-03 13:53:44 +02:00
giefca b04fd08cea Google assistant: add blinds trait for covers (#22336)
* Update const.py

* Update smart_home.py

* Update trait.py

* Update test_trait.py

* Update smart_home.py

* Update test_trait.py

* Update trait.py

* Update trait.py

* Update test_trait.py

* Update test_trait.py

* Update __init__.py

* Update test_trait.py

* Change email

* Trying to correct CLA

* Update __init__.py

* Update trait.py

* Update trait.py

* Update trait.py

* Update trait.py

* Update __init__.py

* Update test_trait.py

* Update test_google_assistant.py

* Update trait.py

* Update trait.py

* Update test_trait.py

* Update test_trait.py
2019-03-29 20:51:47 -07:00
Paulus Schoutsen c68b621972
Google Assistant: Add camera stream trait (#22278)
* Add camera stream trait

* Lint
2019-03-23 09:16:43 -07:00
Penny Wood ecabf92504 Update trait to support auto without ranges. (#21847) 2019-03-22 13:42:56 -07:00
Penny Wood 81bb928394 Handle on/off through TemperatrureSetting trait. (#21842) 2019-03-21 10:57:42 -07:00
Penny Wood d1038ea79f Google Assistant: Create and pass context to service calls (#21551)
* Google Assistant: Create and pass context to service calls

* Refactor request data into separate object and pass to execute.
2019-03-05 20:00:53 -08:00
Paulus Schoutsen 27e8a6ee80
Rename Google Assistant evenets (#21655) 2019-03-04 13:18:16 -08:00
Penny Wood f61f650495 Get room hints from areas (#21519)
* Get google room hint from area.

* Test case for area code.

* Updates as per code review.
2019-03-01 23:31:57 -08:00
Penny Wood b87eb9d79e Fire events when Google Assistant commands come in #15139 (#20204) 2019-02-27 11:33:34 -08:00
Paulus Schoutsen 6626e5c4a4
Handle GA Disconnect intent (#21387)
* Handle GA Disconnect intent

* Fixed lint error
2019-02-25 10:35:03 -08:00
Joakim Plate c5de32e7b1 Climate const.py move (#20945)
* Move constants to const.py

* Import from const instead of climate
2019-02-14 20:34:43 +01:00
Fabian Affolter 3736120c6a
Update file header (#21061)
* Update file header

* Fix lint issue

* Fix lint issue
2019-02-14 16:01:46 +01:00
Paulus Schoutsen 802497b05c
Google_assistant: fix climate modes (#19084)
* home-assistant/home-assistant#18645: Fix climate mode mapping.

* home-assistant/home-assistant#18645: Remove un-used constants.

* home-assistant/home-assistant#18645: revert heat-cool -> auto change
2018-12-10 12:32:24 +01:00
Eric Nagley df2f476c67 Google assistant fix target temp for *F values. (#19083)
* home-assistant/home-assistant#18524 : Add rounding to *F temps

* home-assistant/home-assistant#18524 : Linting

* simplify round behavior

* fix trailing whitespace

(thanks github editor)
2018-12-10 12:31:52 +01:00
edif30 fd5b92b2fb Update Google Assistant services description and request sync timeout (#19113)
* Fix google assistant request sync service call

* More descriptive services.yaml

* Update services.yaml

* Update __init__.py

* Update request sync service call timeout

Change from 5s to 15s to allow Google to respond.  5s was too short.  The service would sync but the service call would time out and throw the error.
2018-12-08 20:39:51 -05:00
phnx 385f0298bd home-assistant/home-assistant#18645: revert heat-cool -> auto change 2018-12-07 10:00:56 -05:00
phnx 24d0aa3f55 home-assistant/home-assistant#18645: Remove un-used constants. 2018-12-07 01:50:48 -05:00
phnx 471d94b6cd home-assistant/home-assistant#18645: Fix climate mode mapping. 2018-12-07 01:15:04 -05:00
Paulus Schoutsen 04c7d5c128
Revert #17745 (#19064) 2018-12-06 10:38:26 +01:00
Andrew Hayworth b7e2522083 bugfix: ensure the `google_assistant` component respects `allow_unlock` (#18874)
The `Config` object specific to the `google_assistant` component
had a default value for `allow_unlock`. We were not overriding this
default when constructing the Config object during `google_assistant`
component setup, whereas we do when setting up the `cloud` component.

To fix, we thread the `allow_unlock` parameter down through http setup,
and ensure that it's set correctly. Moreover, we also change the
ordering of the `Config` parameters, and remove the default. Future
refactoring should not miss it, as it is now a required parameter.
2018-12-02 11:14:46 +01:00
Eric Nagley 4e272624eb BUGFIX: handle extra fan speeds. (#18799)
* BUGFIX: add support for extra fan speeds.

* Drop extra fan speeds.

Remove catch all, drop missing fan speeds.

* fix self.speed_synonyms call. Remove un-needed keys() call
2018-11-29 22:24:53 +01:00
Eric Nagley e50a6ef8af Add support for Mode trait in Google Assistant. (#18772)
* Add support for Mode trait in Google Assistant.

* Simplify supported logic.

* Fix SUPPORTED_MODE_SETTINGS to correct rip failures.

* more stray commas

* update tests.
2018-11-29 21:14:17 +01:00
Bryan York 02309cc318 Enable Google Assistant OnOffTrait for climate devices that support them (#18544)
* Enable Google Assistant OnOffTrait for climate devices that support them

This commit enables the OnOffTrait for climate devices that have the SUPPORT_ON_OFF feature. I have tested this locally with a Sensibo device which supports ON_OFF and a nest device that does not.

* Update trait.py

* Add tests for onoff_climate

* Add OnOff trait to climate.heatpump

* Add on status to heatpump in google_assistant tests
2018-11-27 17:11:55 +01:00
Jason Hu 4d5338a1b0 Fix google assistant request sync service call (#17415)
* Update __init__.py

* Add optional agent_user_id field to request_sync service

* Update services.yaml
2018-11-27 14:57:42 +01:00
Eric Nagley ddeeba20b9 Google assistant enable fan speed controls (#18373)
* Initial commit of Traits changes.

* Initial commit of tests chagnes for added FanSpeed trait.

* pylint fixes.

* Default reversible to false

* Ensure reversible returns True/False.

* Fix FanSpeed trait name and fix order.

* Add remaining checks to FanSpeed trait Test.

* Remove un-needed blank lines at EOF.

* Update homeassistant/components/google_assistant/trait.py

Co-Authored-By: marchingphoenix <eanagley@gmail.com>

* use fan.SPEED_* constants as keys to speed_synonyms dict.
convert True if() to bool() for reversible assignment.

* use fan.SPEED_OFF constant of 'on' check.
2018-11-11 22:02:33 +01:00
Glen Takahashi 34d7758b4a Correct expose_by_default interaction with expose_domains (#17745)
Based on the documentation here: https://www.home-assistant.io/components/google_assistant/#expose_by_default it seems that expose_by_default means all devices should be exposed unless explicitly set to false, and that regardless if this is set domains in exposed_domains should be exposed.
2018-11-06 12:53:47 +01:00
Andrew Hayworth 2bf2214d51 Add support for locks in google assistant component (#18233)
* Add support for locks in google assistant component

This is supported by the smarthome API, but there is no documentation
for it. This work is based on an article I found with screenshots of
documentation that was erroneously uploaded:

https://www.androidpolice.com/2018/01/17/google-assistant-home-can-now-natively-control-smart-locks-august-vivint-first-supported/

Google Assistant now supports unlocking certain locks - Nest and August
come to mind - via this API, and this commit allows Home Assistant to
do so as well.

Notably, I've added a config option `allow_unlock` that controls
whether we actually honor requests to unlock a lock via the google
assistant. It defaults to false.

Additionally, we add the functionNotSupported error, which makes a
little more sense when we're unable to execute the desired state
transition.

https://developers.google.com/actions/reference/smarthome/errors-exceptions#exception_list

* Fix linter warnings

* Ensure that certain groups are never exposed to cloud entities

For example, the group.all_locks entity - we should probably never
expose this to third party cloud integrations. It's risky.

This is not configurable, but can be extended by adding to the
cloud.const.NEVER_EXPOSED_ENTITIES array.

It's implemented in a modestly hacky fashion, because we determine
whether or not a entity should be excluded/included in several ways.

Notably, we define this array in the top level const.py, to avoid
circular import problems between the cloud/alexa components.
2018-11-06 10:39:10 +01:00
Mariusz Łuciów 38576e5b74 Corrected fan device type in google assistant to fan (#17792) 2018-10-28 14:53:47 +01:00
Mariusz Łuciów cfbd84f450 Added vacuum dock and pause/unpause traits (#17657) 2018-10-26 23:02:07 +02:00
Ville Skyttä 43048962f2
Upgrade flake8 to 3.6.0 (#17770)
* Upgrade flake8 to 3.6.0

* flake8/pylint comment tweaks

* flake8 F841 fixes

* flake8 W605 fix

* Ignore pyflakes bug #373 false positives

https://github.com/PyCQA/pyflakes/issues/373

* pycodestyle bug #811 workaround

https://github.com/PyCQA/pycodestyle/issues/811
2018-10-25 23:15:20 +03:00
Sébastien RAMAGE 4e8cd7281c All supported domains should be exposed by default (#17579)
According to documentation, all supported domains should be exposed by default
https://www.home-assistant.io/components/google_assistant/#expose_by_default
2018-10-22 20:07:11 +02:00
Jason Hu 92a5068977 Use HA native OAuth2 flow for google assistant components (#16848)
* Use HA native OAuth2 flow for google assistant components

* Lint

* Force breaking changes

* Fix CONFIG_SCHEMA
2018-09-26 08:57:55 +02:00