core/tests
Phil Frost e16793013a
Refactor Alexa API, fix thermostats (#17969)
* Refactor Alexa API to use objects for requests

This introduces _AlexaDirective to stand in for the previous model of passing
basic dict and list data structures to and from handlers. This gives a more
expressive platform for functionality common to most or all handlers.

I had two use cases in mind:

1) Most responses should include current properties. In the case of locks and
thermostats, the response must include the properties or Alexa will give the
user a vague error like "Hmm, $device is not responding." Locks currently work,
but thermostats do not. I wanted a way to automatically include properties in
all responses. This is implemented in a subsequent commit.

2) The previous model had a 1:1 mapping between Alexa endpoints and Home
Assistant entities. This works most of the time, but sometimes it's not so
great. For example, my Z-wave thermostat shows as three devices in Alexa: one
for the temperature sensor, one for the heat, and one for the AC. I'd like to
merge these into one device from Alexa's perspective. I believe this will be
facilitated with the `endpoint` attribute on `_AlexaDirective`.

* Include properties in all Alexa responses

The added _AlexaResponse class provides a richer vocabulary for handlers.

Among that vocabulary is .merge_context_properties(), which is invoked
automatically for any request directed at an endpoint. This adds all supported
properties to the response as recommended by the Alexa API docs, and in some
cases (locks, thermostats at least) the user will get an error "Hmm, $device is
not responding" if properties are not provided in the response.

* Fix setting temperature with Alexa thermostats

Fixes https://github.com/home-assistant/home-assistant/issues/16577
2018-10-29 22:16:35 -04:00
..
auth Permissions improv (#17811) 2018-10-29 11:28:04 +01:00
components Refactor Alexa API, fix thermostats (#17969) 2018-10-29 22:16:35 -04:00
fixtures Swedish weather institute weather component (#16717) 2018-10-08 23:54:55 +02:00
helpers Pass hass_config to load_platform (#17952) 2018-10-29 19:21:21 +01:00
mock Add zwave.network_complete_some_dead event (#16894) 2018-09-28 19:14:57 +02:00
resources
scripts Fix check config packages key error (#15840) 2018-08-17 05:28:00 +02:00
test_util Deprecated stuff (#16019) 2018-08-20 16:34:18 +02:00
testing_config add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
util Pytest tests (#17750) 2018-10-24 12:10:05 +02:00
__init__.py
common.py Add permissions foundation (#16890) 2018-10-11 19:24:25 +02:00
conftest.py Remove usage of "run_until_complete" (#16617) 2018-09-19 15:40:02 +02:00
test_bootstrap.py Remove usage of "run_until_complete" (#16617) 2018-09-19 15:40:02 +02:00
test_config.py Pytest tests (#17750) 2018-10-24 12:10:05 +02:00
test_config_entries.py Fix unloading an entry can leave states around (#17786) 2018-10-25 19:57:36 +02:00
test_core.py Pytest tests (#17750) 2018-10-24 12:10:05 +02:00
test_data_entry_flow.py Allow finish_flow callback to change data entry result type (#16100) 2018-08-21 10:48:24 -07:00
test_loader.py Pytest tests (#17750) 2018-10-24 12:10:05 +02:00
test_main.py
test_requirements.py Improve package loadable (#16237) 2018-08-28 12:52:18 +02:00
test_setup.py Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0 (#14557) 2018-08-24 10:28:43 +02:00