* Refactor Alexa Smart Home API
Having an object per interface will make it easier to support
properties.
Ideally, properties are reported in context in all responses. However
current implementation reports them only in response to a ReportState
request. This seems to work sufficiently. As long as the device is
opened in the Alexa app, Amazon will poll the device state every few
seconds with a ReportState request.
* Report properties for some Alexa interfaces
Fixes (mostly) #11874.
Other interfaces will need properties implemented as well.
Implementing properties for just PowerController seems sufficient to
eliminate the "There was a problem." error for any device that supports
it, even if other interfaces are supported. Of course the additional
properties will be reported incorrectly in the Alexa app.
Includes a minor bugfix: `reportable` was previously placed incorrectly
in the responses, so Amazon was ignoring it.
Having an object per interface will make it easier to support
properties.
Ideally, properties are reported in context in all responses. However
current implementation reports them only in response to a ReportState
request. This seems to work sufficiently. As long as the device is
opened in the Alexa app, Amazon will poll the device state every few
seconds with a ReportState request.
* Send Alexa Smart Home responses to debug log
* Report scripts and groups as scenes to Alexa
The Alexa API docs have a couple display categories that sound relevant
to scenes or scripts:
ACTIVITY_TRIGGER: Describes a combination of devices set to a
specific state, when the state change must occur in a specific
order. For example, a “watch Neflix” scene might require the: 1. TV
to be powered on & 2. Input set to HDMI1.
SCENE_TRIGGER: Describes a combination of devices set to a specific
state, when the order of the state change is not important. For
example a bedtime scene might include turning off lights and
lowering the thermostat, but the order is unimportant.
Additionally, Alexa has a notion of scenes that support deactivation.
This is a natural fit for groups, and scripts with delays which can be
cancelled.
https://developer.amazon.com/docs/device-apis/alexa-discovery.html#display-categories
The mechanism to map entities to the Alexa Discovery response is
refactored since extending the data structures in MAPPING_COMPONENT to
implement supportsDeactivation would have added complication to what I
already found to be a confusing construct.
* Expose Alexa Smart Home via HTTP POST
Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.
* Expose Alexa Smart Home via HTTP POST
Haaska uses the deprecated v2 Alexa Smart Home payload. Exposing the v3
implementation this way allows an easy path to upgrading Haaska and
reducing code duplication with Home Assistant Cloud.
* alexa: Add handling for covers
Covers don't support either cover.turn_on or homeassistant.turn_on so
use cover.[open|close]_cover.
* alexa: Add tests for covers
* Implement entity and domain exclude/include for Alexa
* Switch to using generate_filter
* Use proper domain for turn on/off calls except for groups where we must use the generic homeassistant.turn_on/off
* travis fixes
* Untangle
* Lint
* Initial scene support
* Initial fan support
* ordering
* Initial lock support
* Scenes cant be deactivated; Correct the scene display category
* Initial input_boolean support
* Support customization of Alexa discovered entities
* Initial media player support
* Add input_boolean to tests
* Add play/pause/stop/next/previous to media player
* Add missing functions and pylint
* Set manufacturerName to Home Assistant since the value is displayed in app
* Add scene test
* Add fan tests
* Add lock test
* Fix volume logic
* Add volume tests
* settup -> setup
* Remove unused variable
* Set required scene description as per docs
* Allow setting scene category (ACTIVITY_TRIGGER/SCENE_TRIGGER)
* Add alert, automation and group support/tests
* Change display categories to match docs
* simplify down the display category props into a single prop which can be used on any entity
* Fix tests to expect proper display categories
* Add cover support
* sort things
* Use generic homeassistant domain for turn on/off
* Implement adjustment
* Add color support
* fix lint
* Fix lint & use only RGB
* fix HSB + Test
* Add tests & fix bugs
* add rgb test
* add setColorTemperature
* Add color light support + tests
* Fix color temp
* use kelvin for converting
* use correct calculation