1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-29 02:07:09 +00:00

32 Commits

Author SHA1 Message Date
Andrew Hayworth
2bf2214d51 Add support for locks in google assistant component ()
* 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 () 2018-10-28 14:53:47 +01:00
Mariusz Łuciów
cfbd84f450 Added vacuum dock and pause/unpause traits () 2018-10-26 23:02:07 +02:00
Ville Skyttä
43048962f2
Upgrade flake8 to 3.6.0 ()
* Upgrade flake8 to 3.6.0

* flake8/pylint comment tweaks

* flake8 F841 fixes

* flake8 W605 fix

* Ignore pyflakes bug  false positives

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

* pycodestyle bug  workaround

https://github.com/PyCQA/pycodestyle/issues/811
2018-10-25 23:15:20 +03:00
Paulus Schoutsen
092c146eae
Add option to disable specific integrations ()
* Add option to disable specific integrations

* Lint
2018-09-20 23:46:51 +02:00
Jerad Meisner
ae63980152 Remove unit_of_measurement from climate entities ()
* Remove unit_of_measurement from climate base class.

* Updated google_assistant component and tests to use core temp units.

* Fixes

* Convert Alexa component to use core temp units for climate entities.

* Fix tests.

* Converted prometheus component.

* Remove unit_of_measurement from homekit thermostat tests.

* Small fix.
2018-08-22 09:17:29 +02:00
Ville Skyttä
397f551e6d Import collections abstract base classes from collections.abc ()
Accessing them directly through collections is deprecated since 3.7, and
will no longer work in 3.8.
2018-07-25 11:35:22 +02:00
Ville Skyttä
6f582dcf24 Lint cleanups ()
* Remove some unused imports

* Fix a flake8 E271
2018-07-01 11:57:01 -04:00
Ville Skyttä
b92350fb55 Lint cleanup ()
* Remove unneeded inline pylint disables

* Remove unneeded noqa's

* Use symbol names instead of message ids in inline pylint disables
2018-06-25 13:05:07 -04:00
Paulus Schoutsen
5dcad89a0d
Do not sync entities with an empty name () 2018-04-30 09:18:18 -04:00
Paulus Schoutsen
cfb0b00c0c
Do not include unavailable entities in Google Assistant SYNC () 2018-03-20 18:09:34 -07:00
Paulus Schoutsen
e1a5e5a8ba
Fix input_boolean Google Assistant serialize error () 2018-03-14 15:07:37 -07:00
Paulus Schoutsen
9b1a75a74b
Refactor Google Assistant ()
* Refactor Google Assistant

* Fix cloud test

* Fix supported features media player demo

* Fix query

* Fix execute

* Fix demo media player tests

* Add tests for traits

* Lint

* Lint

* Add integration tests

* Add more tests

* update logging

* Catch out of range temp errrors

* Fix cloud error

* Lint
2018-03-08 14:39:10 -08:00
Jeremy Klein
f899ce8fbf Adding RoomHinting to GoogleAssistant to allow for room annotations. () 2018-02-22 15:24:41 -08:00
Thom Troy
fe1a85047e have climate fallback to state if no ATTR_OPERATION_MODE () () 2018-02-10 15:06:24 -08:00
Phil Kates
8e441ba03b Refactor Google Assistant query_device ()
* google_assistant: Refactor query_device

The previous code had issues where domains could break out and end up
with weird brightness values and we weren't enforcing the `on` and
`oneline` keys in the response.

* google_assistant: Add media_player to query test
2018-01-30 01:19:24 -08:00
Otto Winter
8dcfd35b8b Spelling fixes ()
* Spelling fixes

*Lots* of them.

* Spelling breaking changes

* Fix lint errors
2018-01-29 23:37:19 +01:00
Ville Skyttä
55ee8959ba Spelling fixes () 2018-01-27 11:58:27 -08:00
Paulus Schoutsen
390b727869 Allow setting climate devices to AUTO mode via Google Assistant ()
* Allow setting climate devices to AUTO mode via Google Assistant

* Remove cast to lower

* Clarify const name
2018-01-26 12:37:06 +01:00
Frantz
bc13c9db83 Allow exposing sensors as temperature or humidity 'climate' devices to Google Assistant ()
* Allow exposing sensors as temperature or humidity as 'climate' to Google Assistant

* Fixed hound

* Fixed hound

* Handled correctly unit of measurement to fix humidity

* Fixed temperature conversion for Google climate components

* Fixed temperature conversion for Google climate components

* Fixed indentation

* Fixed hound

* Fixed tests

* Fixed conversion and unit tests

* Fix sync for custom unit temperature

* Implemented requested changes

* Fix hound

* Fix linting errors

* Added success tests for sensors as climate

* Fix lint errors
2018-01-22 23:23:33 -08:00
andrewdolphin
5513ffc33c Change 'on' to 'heat' as fallback thermostat mode ()
* Change 'on' to 'heat' as fallback thermostat mode

'on' isn't recognised as a mode by Google Assistant, rather is used as a method to return a thermostat to a previous mode. In the case where a thermostat doesn't support the standard google modes (e.g. A homematic radiator thermostat) this means the set_temperature doesn't get returned to the user on a request.

* Update test_google_assistant.py
2018-01-21 12:57:56 -08:00
Laqoore
1235dae5b8 Changed device type of media player and cover to switch ()
* Changed device type of media player and cover to switch

Covers and media players should not be of device type 'light'. Example: If user requests all lights to switch to off, covers are closed and media players are affected too.

* Fix test
2018-01-11 15:01:38 -08:00
Paulus Schoutsen
8313225b40
Move Google Assistant entity config out of customize ()
* Move Google Assistant entity config out of customize

* CONF_ALIAS -> CONF_ALIASES

* Lint
2018-01-09 15:14:56 -08:00
Paulus Schoutsen
fc8b25a71f
Clean up Google Assistant ()
* Clean up Google Assistant

* Fix tests
2017-12-31 15:04:49 -08:00
Zach
282e37ef14 Changing handling for google_assistant groups to treat them as lights. ()
* Fixed aliases warning message

* Fixed test cases

* Changing handling for google_assistant groups to treat them as lights - amending to include user info.

* Enable brightness, RGB, etc for groups in Google Assistant

* Revert color/hue/temp settings

* Change servce from light to homeassistant

* Fixed config_units

* Convert from light to switch

* Change group to switch

* Update tests to switch instead of light for group
2017-11-27 21:43:01 -08:00
braddparker
3ef9c99003 Google assistant climate mode fix ()
* Changed supported climate modes lookup to be case insensitive by forcing to lower-case

* Fixed style errors. (Blank line and line too long)
2017-11-23 12:57:30 -08:00
Per Osbäck
d4bd4c114b add support for color temperature and color to Google Assistant ()
* add support for color temperature and color; also add some extra deviceInfo attributes

* change so that default behaviour doesn't turn off device if the action isn't handled

* add tests

* fix lint

* more lint

* use attributes were applicable

* removed debug logging

* fix unassigned if only None returned

* report more data in QUERY

* better tests for color and temperature

* fixes after dev merge

* remove deviceInfo as not part of a device state (PR )

* fix after merge
2017-11-15 23:00:43 -08:00
Eitan Mosenkis
0b4de54725 Google Assistant for climate entities: Support QUERY and respect system-wide unit_system setting. () 2017-11-14 20:19:42 -08:00
Eitan Mosenkis
4da8ec0a05 Add Google Assistant support for setting climate temperature and operation mode. ()
Fixes .
2017-11-01 07:44:59 -07:00
Per Osbäck
b6324b511c Google Assistant: make it possible to set a custom domain/type ()
* Google Assistant: make it possible to set a custom domain/type

* add test for switch platform

* update custom type test
2017-10-31 20:38:34 -07:00
Peter Epley
e7fc8a1890 Google Assistant Script Support ()
* Add script support as scene

* Add script support as scene

* Corrected missing script definition
2017-10-30 00:11:23 -07:00
Phil Kates
9d20a53d63 Google Actions for Assistant ()
* http: Add headers key to json[_message]

* Add google_assistant component

This component provides API endpoints for the Actions on Google Smart
Home API to interact with Google Assistant.

* google_assistant: Re-add fan support

* google_assistant: Fix Scene handling

- The way I originally wrote the MAPPING_COMPONENT and the way it's actual
  used changed so the comment was updated to match that.
- Use const's in more places
- Handle the ActivateScene command correctly

* google_assistant: Fix flakey compare test

Was failing on 3.4.2 and 3.5, this is more correct anyway.

* google_assistant: Use volume attr for media_player
2017-10-17 22:00:59 -07:00