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.
This commit is contained in:
1 parent
dc3aa43f73
commit
da094e09fa
10 files changed
+1190
-53
No files matched your search
@@ -67,13 +67,22 @@ def get_new_request(namespace, name, endpoint=None):
|
||||
|
||||
|
||||
async def assert_request_calls_service(
|
||||
namespace, name, endpoint, service, hass, response_type="Response", payload=None
|
||||
namespace,
|
||||
name,
|
||||
endpoint,
|
||||
service,
|
||||
hass,
|
||||
response_type="Response",
|
||||
payload=None,
|
||||
instance=None,
|
||||
):
|
||||
"""Assert an API request calls a hass service."""
|
||||
context = Context()
|
||||
request = get_new_request(namespace, name, endpoint)
|
||||
if payload:
|
||||
request["directive"]["payload"] = payload
|
||||
if instance:
|
||||
request["directive"]["header"]["instance"] = instance
|
||||
|
||||
domain, service_name = service.split(".")
|
||||
calls = async_mock_service(hass, domain, service_name)
|
||||
|
||||
Reference in new issue
Block a user