Commit Graph

106 Commits (7887850505bbaef83467c732e07b23236e31f1d2)

Author SHA1 Message Date
ochlocracy d6654eaecb Implement Alexa.PlaybackStateReporter Interface for alexa (#28215) 2019-10-25 14:53:33 -07:00
ochlocracy d44bfa8e88 Improved Alexa ThermostatController thermostatMode handling (#28176)
* Update ThermostatController to map directives to supported modes and add support for CUSTOM mode.

* Removed erroneous config value from test.

* Removed unnecessary use of a comprehension by dumbing down comment so pylint could comprehend.

* Removed erroneous import variable caused by removing erroneous config value from test.

* Removed unnecessary use of a comprehension.

* Reverted Removal or erroneous import variable and erroneous config value from test.
Apparently need for additional tests outside this component. Whoops.
2019-10-25 13:42:21 -07:00
ochlocracy da8a476142 Add support for supportedOperations to Alexa.PlaybackController (#28212)
* Added support for supportedOperations to Alexa.PlaybackController

* Added support for supportedOperations to Alexa.PlaybackController
2019-10-25 13:34:51 -07:00
ochlocracy 38428308fc Change Alexa default display category based on media_player device_class (#28191)
* Support default display category based one media_player device_class.

* Support default display category based one media_player device_class.
2019-10-25 10:21:22 -07:00
ochlocracy 65d8c70377 Rebase Implement Alexa.DoorbellEventSource Interface Controller (#27726) 2019-10-23 11:41:26 -07:00
Alain Turbide b1a374062b Add Alexa.ChannelController functions for media players (#27671)
* Added missing Alexa.ChannelController functions. Specifically ChangeChannel
and SkipChannel commands. These functions will call the play_media function
 in a media_player app if it has the capability published and pass on the
  channel# or channel name. The selected media player can then use this to
   select the channel on the device it is associated to.
Modified the existing Alexa.StepSpeaker Setvolume function to actually do
a stepped volume change using the steps sent by Alexa. The Alexa default
 step of 10 for a simple volume up/down can be changed via an exposed
 media_player attribute called volume_step_default.
 The default is set to 1. Any other value then default will be sent
 as sequential volume up /down to the media_player.

* The test code has some weird behaviour with passed boolean values.  Had to surround them in quotes for the tests to pass properly.

* Reverted test_smart_home.py change. Issue was not the boolean value but the behavior in the handler. The test suite does not like multiple await calls in a loop. Will investigate further.  The handler code works though.

* Added ChannelController/SkipChannels test in test_smart_home.py
Added test for callSign payload attribute.

* Modified smart home test to allow more than one call to services

* Added more tests for ChannelChange functions for various payload options.
Removed name options from metadata payload section. not needed.

* Reverted assert call change in alexa test __init__.py back to ==1. Not sure if it was the cause of the pytest's failing on github

* Corrected a comment.  First commit after a rebase.

* Comment line change.  Also wanted to force a code check on github.

* Added a loop delay in StepSpeaker and SkipChannel functions for safety

* Removed uneeded sleep from for loops.  Let remote handle delays
Moved service type decision out of for loops in ChannelController and StepSpeaker
Used constants instead of numeric values for support options in test module

* Change media_player const import to be more specific in source

* Modifed test_smart_home to use media_play constants instead of hardcode valu

* Removed unecessary test volume_step_default attribute from test_smart_home

* Removed uneeded comment in StepSpeaker function.
Re-ordered constants in test_smart_home.py

* Modified call to media_player play_media service to use media_player constant instead of hard coded value.

* Changed constant use to be consistant with rest of function.

* Correct merge conflicts in handlers.py and capablities.py
2019-10-23 08:28:23 -07:00
ochlocracy da094e09fa Implement ToggleController, RangeController, and ModeController in alexa (#27302)
* Implement AlexaToggleController, AlexaRangeController, and AlexaModeController interfaces.

* Implement AlexaToggleController, AlexaRangeController, and AlexaModeController interfaces.

* Unkerfuffled comments to please the pydocstyle gods.

* Unkerfuffled comments in Tests to please the pydocstyle gods.

* Added additional test for more coverage.

* Removed OSCILLATING property check from from ModeController.

* Added capability report tests for ModeController, ToggleController, RangeController, PowerLevelController.

* Update homeassistant/components/alexa/capabilities.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/alexa/capabilities.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Corrected mis-spelling of AlexaCapability class.

* Changed instance from method to property in AlexaCapability class.

* Refactored to add {entity.domain}.{entity.attribute} to the instance name.

* Improved type handling for configuration object.
Added additional test for configuration object.

* Added Tests for unsupported domains for ModeController and RangeController

* Made changes to improve future scaling for other domains.

* Split fan range to speed maps into multiple constants.
2019-10-22 22:01:03 -07:00
ochlocracy a49dbb9718 Update Unlock directive for Alexa LockController (#27653)
* Update the Alexa.LockController Unlock directive to include the lockState property in the context of the response.

* Added Test for Alexa.LockController Unlock directive to include the lockState property in the context of the response.
2019-10-14 14:19:05 -07:00
ochlocracy 9a5c1fbaed Add SecurityPanelController for alarm_control_panel to alexa (#27081)
* Implemented Alexa.SecurityPanelController Interface for alarm_control_panel
https://developer.amazon.com/docs/device-apis/alexa-securitypanelcontroller.html

* Implemented Tests for Alexa.SecurityPanelController Interface for alarm_control_panel

* Added additional AuthorizationRequired error handling

* Removed optional exitDelayInSeconds

* Updating elif to if to please pylint

* Adding self to code owners.

* Adding self to code owners.

* Added AlexaEndpointHealth Interface to alarm_control_panel entities.

* Added additional entity tests.

* Code reformatted with Black.

* Updated alexa alarm_control_panel tests for more coverage.

* Updated alexa alarm_control_panel tests for more coverage. Fixed Test.

* Adding self to code owners.
2019-10-04 08:41:47 -07:00
ochlocracy af81878d08 Add PowerLevelController for fan to alexa (#27158)
* Implement AlexaPowerLevelController

* Implement AlexaPowerLevelController Tests
2019-10-03 13:28:02 -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
ochlocracy 9c1feacd47 Fix colorTemperatureInKelvin in Alexa report when light is off (#27107)
* Fixes #26405 Return None if light state is off since attribute is unavailable, prevents property from being reported with invalid value of 0.

* Update Test to check property is not reported when light state is off.
2019-10-02 15:59:21 -07:00
ochlocracy 363873dfcb Display Fan entity as Fan category in Alexa (#27135)
* Added Fan to display categories.

* Added Doorbell to display categories.

* Added Microwave to display categories.

* Added Security Panel to display categories.

* Updated FanCapabilities to use FAN display category.

* Updated Tests for FanCapabilities to use FAN display category.
2019-10-02 15:55:01 -07:00
ochlocracy 6dfeed6cd1 Fix unavailable climate entities in Alexa StateReport (#27128)
* Return None for AlexaThermostatController and AlexaTemperatureSensor properties if climate state is unavailable. Preserves raising an error for UnsupportedProperty, and allows Alexa.EndpointHealth to handle the unavailable state.

* Added additional tests for climate state reporting.
2019-10-02 15:53:04 -07:00
Franck Nijhof c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
Bram Kragten 80bc15e24b
Update Alexa discovery description (#26933)
* Update Alexa discovery description

* Update description

* Fix test

* Filter special chars
2019-09-27 21:51:46 +02:00
Paulus Schoutsen fc700c7937 Guard against non supported entities (#26941) 2019-09-27 08:49:51 +02:00
Tsvi Mostovicz 1041b10616 Move alexa integration to use dt_util (#26723) 2019-09-19 09:19:27 -07:00
Paulus Schoutsen 4e2fcdb9a3 Fix state report (#26406)
* Fix state report

* Update test
2019-09-03 20:57:32 -05:00
Franck Nijhof ad51615718 Use literal string interpolation in integrations A (f-strings) (#26377)
* Use literal string interpolation in integrations A (f-strings)

* Black
2019-09-03 09:11:36 -05:00
Paulus Schoutsen 46b5b0cac7 Fix alexa bad temp sensors (#26307) 2019-08-31 09:46:26 -05:00
Paulus Schoutsen 7b05ede297 Fix Alexa Report State (#26305)
* Fix Alexa Report State

* Forgot to save a file
2019-08-30 20:34:40 -05:00
Paulus Schoutsen ce35f64d59 Guard against unavailable climate entities (#25978) 2019-08-16 16:17:43 +02:00
Ville Skyttä a54ade1189 Spelling fixes (#25666) 2019-08-02 23:20:06 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen d37d1ce4ad Simplify Alexa/Google for new climate turn_on/off (#25115) 2019-07-13 10:27:50 +02:00
Pascal Vizeli 78a5dc71ac Fix powercontrol media player alexa (#25080) 2019-07-11 08:35:46 -07:00
Pascal Vizeli 84cf76ba36
Climate 1.0 (#23899)
* Climate 1.0 / part 1/2/3

* fix flake

* Lint

* Update Google Assistant

* ambiclimate to climate 1.0 (#24911)

* Fix Alexa

* Lint

* Migrate zhong_hong

* Migrate tuya

* Migrate honeywell to new climate schema (#24257)

* Update one

* Fix model climate v2

* Cleanup p4

* Add comfort hold mode

* Fix old code

* Update homeassistant/components/climate/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/climate/const.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* First renaming

* Rename operation to hvac for paulus

* Rename hold mode to preset mode

* Cleanup & update comments

* Remove on/off

* Fix supported feature count

* Update services

* Update demo

* Fix tests & use current_hvac

* Update comment

* Fix tests & add typing

* Add more typing

* Update modes

* Fix tests

* Cleanup low/high with range

* Update homematic part 1

* Finish homematic

* Fix lint

* fix hm mapping

* Support simple devices

* convert lcn

* migrate oem

* Fix xs1

* update hive

* update mil

* Update toon

* migrate deconz

* cleanup

* update tesla

* Fix lint

* Fix vera

* Migrate zwave

* Migrate velbus

* Cleanup humity feature

* Cleanup

* Migrate wink

* migrate dyson

* Fix current hvac

* Renaming

* Fix lint

* Migrate tfiac

* migrate tado

* Fix PRESET can be None

* apply PR#23913 from dev

* remove EU component, etc.

* remove EU component, etc.

* ready to test now

* de-linted

* some tweaks

* de-lint

* better handling of edge cases

* delint

* fix set_mode typos

* apply PR#23913 from dev

* remove EU component, etc.

* ready to test now

* de-linted

* some tweaks

* de-lint

* better handling of edge cases

* delint

* fix set_mode typos

* delint, move debug code

* away preset now working

* code tidy-up

* code tidy-up 2

* code tidy-up 3

* address issues #18932, #15063

* address issues #18932, #15063 - 2/2

* refactor MODE_AUTO to MODE_HEAT_COOL and use F not C

* add low/high to set_temp

* add low/high to set_temp 2

* add low/high to set_temp - delint

* run HA scripts

* port changes from PR #24402

* manual rebase

* manual rebase 2

* delint

* minor change

* remove SUPPORT_HVAC_ACTION

* Migrate radiotherm

* Convert touchline

* Migrate flexit

* Migrate nuheat

* Migrate maxcube

* Fix names maxcube const

* Migrate proliphix

* Migrate heatmiser

* Migrate fritzbox

* Migrate opentherm_gw

* Migrate venstar

* Migrate daikin

* Migrate modbus

* Fix elif

* Migrate Homematic IP Cloud to climate-1.0 (#24913)

* hmip climate fix

* Update hvac_mode and preset_mode

* fix lint

* Fix lint

* Migrate generic_thermostat

* Migrate incomfort to new climate schema (#24915)

* initial commit

* Update climate.py

* Migrate eq3btsmart

* Lint

* cleanup PRESET_MANUAL

* Migrate ecobee

* No conditional features

* KNX: Migrate climate component to new climate platform (#24931)

* Migrate climate component

* Remove unused code

* Corrected line length

* Lint

* Lint

* fix tests

* Fix value

* Migrate geniushub to new climate schema (#24191)

* Update one

* Fix model climate v2

* Cleanup p4

* Add comfort hold mode

* Fix old code

* Update homeassistant/components/climate/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/climate/const.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* First renaming

* Rename operation to hvac for paulus

* Rename hold mode to preset mode

* Cleanup & update comments

* Remove on/off

* Fix supported feature count

* Update services

* Update demo

* Fix tests & use current_hvac

* Update comment

* Fix tests & add typing

* Add more typing

* Update modes

* Fix tests

* Cleanup low/high with range

* Update homematic part 1

* Finish homematic

* Fix lint

* fix hm mapping

* Support simple devices

* convert lcn

* migrate oem

* Fix xs1

* update hive

* update mil

* Update toon

* migrate deconz

* cleanup

* update tesla

* Fix lint

* Fix vera

* Migrate zwave

* Migrate velbus

* Cleanup humity feature

* Cleanup

* Migrate wink

* migrate dyson

* Fix current hvac

* Renaming

* Fix lint

* Migrate tfiac

* migrate tado

* delinted

* delinted

* use latest client

* clean up mappings

* clean up mappings

* add duration to set_temperature

* add duration to set_temperature

* manual rebase

* tweak

* fix regression

* small fix

* fix rebase mixup

* address comments

* finish refactor

* fix regression

* tweak type hints

* delint

* manual rebase

* WIP: Fixes for honeywell migration to climate-1.0 (#24938)

* add type hints

* code tidy-up

* Fixes for incomfort migration to climate-1.0 (#24936)

* delint type hints

* no async unless await

* revert: no async unless await

* revert: no async unless await 2

* delint

* fix typo

* Fix homekit_controller on climate-1.0 (#24948)

* Fix tests on climate-1.0 branch

* As part of climate-1.0, make state return the heating-cooling.current characteristic

* Fixes from review

* lint

* Fix imports

* Migrate stibel_eltron

* Fix lint

* Migrate coolmaster to climate 1.0 (#24967)

* Migrate coolmaster to climate 1.0

* fix lint errors

* More lint fixes

* Fix demo to work with UI

* Migrate spider

* Demo update

* Updated frontend to 20190705.0

* Fix boost mode (#24980)

* Prepare Netatmo for climate 1.0 (#24973)

* Migration Netatmo

* Address comments

* Update climate.py

* Migrate ephember

* Migrate Sensibo

* Implemented review comments (#24942)

* Migrate ESPHome

* Migrate MQTT

* Migrate Nest

* Migrate melissa

* Initial/partial migration of ST

* Migrate ST

* Remove Away mode (#24995)

* Migrate evohome, cache access tokens (#24491)

* add water_heater, add storage - initial commit

* add water_heater, add storage - initial commit

delint

add missing code

desiderata

update honeywell client library & CODEOWNER

add auth_tokens code, refactor & delint

refactor for broker

delint

* Add Broker, Water Heater & Refactor

add missing code

desiderata

* update honeywell client library & CODEOWNER

add auth_tokens code, refactor & delint

refactor for broker

* bugfix - loc_idx may not be 0

more refactor - ensure pure async

more refactoring

appears all r/o attributes are working

tweak precsion, DHW & delint

remove unused code

remove unused code 2

remove unused code, refactor _save_auth_tokens()

* support RoundThermostat

bugfix opmode, switch to util.dt, add until=1h

revert breaking change

* store at_expires as naive UTC

remove debug code

delint

tidy up exception handling

delint

add water_heater, add storage - initial commit

delint

add missing code

desiderata

update honeywell client library & CODEOWNER

add auth_tokens code, refactor & delint

refactor for broker

add water_heater, add storage - initial commit

delint

add missing code

desiderata

update honeywell client library & CODEOWNER

add auth_tokens code, refactor & delint

refactor for broker

delint

bugfix - loc_idx may not be 0

more refactor - ensure pure async

more refactoring

appears all r/o attributes are working

tweak precsion, DHW & delint

remove unused code

remove unused code 2

remove unused code, refactor _save_auth_tokens()

support RoundThermostat

bugfix opmode, switch to util.dt, add until=1h

revert breaking change

store at_expires as naive UTC

remove debug code

delint

tidy up exception handling

delint

* update CODEOWNERS

* fix regression

* fix requirements

* migrate to climate-1.0

* tweaking

* de-lint

* TCS working? & delint

* tweaking

* TCS code finalised

* remove available() logic

* refactor _switchpoints()

* tidy up switchpoint code

* tweak

* teaking device_state_attributes

* some refactoring

* move PRESET_CUSTOM back to evohome

* move CONF_ACCESS_TOKEN_EXPIRES CONF_REFRESH_TOKEN back to evohome

* refactor SP code and dt conversion

* delinted

* delinted

* remove water_heater

* fix regression

* Migrate homekit

* Cleanup away mode

* Fix tests

* add helpers

* fix tests melissa

* Fix nehueat

* fix zwave

* add more tests

* fix deconz

* Fix climate test emulate_hue

* fix tests

* fix dyson tests

* fix demo with new layout

* fix honeywell

* Switch homekit_controller to use HVAC_MODE_HEAT_COOL instead of HVAC_MODE_AUTO (#25009)

* Lint

* PyLint

* Pylint

* fix fritzbox tests

* Fix google

* Fix all tests

* Fix lint

* Fix auto for homekit like controler

* Fix lint

* fix lint
2019-07-08 14:00:24 +02:00
Paulus Schoutsen 4b5718431d
Guard for None entity config (#24838) 2019-06-28 22:23:00 -07:00
Paulus Schoutsen f5f86993f1
Improve Alexa error handling (#24745) 2019-06-24 22:04:31 -07:00
Paulus Schoutsen 6d9f1b3fd3 Notify Alexa when exposed entities change (#24609) 2019-06-19 10:06:28 +02:00
Paulus Schoutsen a02b69db38
Cloud: Add Alexa report state (#24536)
* Cloud: Add Alexa report state

* Lint

* Lint

* Only track state changes when we are logged in
2019-06-17 13:50:01 -07:00
Paulus Schoutsen 6c5124e12a
Cloud: allow managing Alexa entities via UI (#24522)
* Clean up Alexa config

* Cloud: Manage Alexa entities via UI

* Add tests for new cloud APIs
2019-06-13 11:58:08 -07:00
Paulus Schoutsen 7e2278f1cc
Clean up Alexa smart home code (#24514)
* Clean up Alexa smart home code

* lint

* Lint

* Lint
2019-06-13 08:43:57 -07:00
Paulus Schoutsen f995ab9d54
Don't pass in loop (#23984)
* Don't pass in loop

* Revert some changes

* Lint + Axis revert

* reinstate loop

* Fix a test

* Set loop

* Update camera.py

* Lint
2019-05-22 21:09:59 -07:00
Pascal Vizeli 4c4f0e38d4
Fix media_player alexa power control bug (#23537) 2019-04-29 22:40:55 +02:00
mcc05 5529bcc114 Fixed AlexaPowerController to report power state for thermostats (#23468)
Fixed AlexaPowerController to report power state for thermostats, to look if state is OFF return OFF, otherwise report ON as thermostats have multiple values for ON
2019-04-28 21:29:12 -04:00
Paulus Schoutsen a52f96b23a
Add stub services.yaml and make validation mandatory (#23213) 2019-04-18 15:13:35 -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 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
Jack Wilsdon 14ceb8472f Return percentage information in Alexa Smart Home response (#22440) 2019-03-27 19:58:52 -07:00
Jason Hu cf69f25354 Correct context (#22061) 2019-03-15 10:01:15 -07: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 127c55e0c1
Update file header (#21023)
* Update file header

* Update file header

* Update file header

* Update file header

* Update file header

* Fix lint issues
2019-02-13 21:21:14 +01:00
Martin Gross 852d67b95c Fix #19990: Alexa-support for climate in manual-mode (#20910) 2019-02-10 09:02:53 -06:00
Joakim Plate d16d14b648 Media player const.py move (#20822)
* Move more constants to const.py

* Import constants directly from const

* ATTR_ENTITY_ID is not defined in media_player

* MEDIA_PLAYER_PLAY_MEDIA_SCHEMA is still in __init__.py

* Correct imports in tts

* PLATFORM_SCHEMA, SCHEMA is still defined in __init__.py

* Pandora imports several services

* Some additional fixes for move of const in media_player

* Fix hound lengths
2019-02-08 14:18:18 -08:00
Abílio Costa ca460ace5d Small refactoring for the alexa component (#19782)
* small refactoring

* fix tests
2019-01-10 17:39:49 -08:00
Abílio Costa 6c29315088 Add Alexa's EndpointHealth reporting (#19784)
* add Health reports

* add health report for all devices

* update tests

* Update homeassistant/components/alexa/smart_home.py

Co-Authored-By: abmantis <abmantis@users.noreply.github.com>

* lint

* add tests
2019-01-10 15:52:21 -08:00
Abílio Costa ead38f6005 Proactive Alexa ChangeReport messages (#18114)
* Alexa: implement auth and proactive ChangeReport messages

* refactor after rebase from dev to use the new AlexaDirective and Response classes

* move to aiohttp; cleanup

* better function name

* move endpoint to config

* allow passing token function

* remove uneeded state get

* use iterable directly

Co-Authored-By: abmantis <abmantis@users.noreply.github.com>

* missing delete from previous commit

* checks for when user has no auth config

* update cloud component

* PR suggestions

* string lint

* Revert "string lint"

This reverts commit a05a1f134c9ebc7a6e67c093009744f142256365.

* linters are now happier

* more happy linters

* use internal date parser; improve json response handling

* remove unused import

* use await instead of async_add_job

* protect access token update method

* add test_report_state

* line too long

* add docstring

* Update test_smart_home.py

* test accept grant api

* init prefs if None

* add tests for auth and token requests

* replace global with hass.data

* doc lint
2019-01-03 22:28:43 +01:00
Mike Miller dd92318762 Fix missing colorTemperatureInKelvin from Alexa responses (#19069)
* Fix missing colorTemperatureInKelvin from Alexa responses

* Update smart_home.py

* Add test
2018-12-06 17:05:14 +01:00