mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Remove AlexaPowerController from device_class garage covers in… (#32607)
This commit is contained in:
parent
c0c5c33b20
commit
fa4f27f78e
@ -400,7 +400,10 @@ class CoverCapabilities(AlexaEntity):
|
|||||||
|
|
||||||
def interfaces(self):
|
def interfaces(self):
|
||||||
"""Yield the supported interfaces."""
|
"""Yield the supported interfaces."""
|
||||||
|
device_class = self.entity.attributes.get(ATTR_DEVICE_CLASS)
|
||||||
|
if device_class != cover.DEVICE_CLASS_GARAGE:
|
||||||
yield AlexaPowerController(self.entity)
|
yield AlexaPowerController(self.entity)
|
||||||
|
|
||||||
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
|
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
|
||||||
if supported & cover.SUPPORT_SET_POSITION:
|
if supported & cover.SUPPORT_SET_POSITION:
|
||||||
yield AlexaRangeController(
|
yield AlexaRangeController(
|
||||||
|
@ -2592,33 +2592,25 @@ async def test_mode_unsupported_domain(hass):
|
|||||||
assert msg["payload"]["type"] == "INVALID_DIRECTIVE"
|
assert msg["payload"]["type"] == "INVALID_DIRECTIVE"
|
||||||
|
|
||||||
|
|
||||||
async def test_cover(hass):
|
async def test_cover_garage_door(hass):
|
||||||
"""Test garage cover discovery and powerController."""
|
"""Test garage door cover discovery."""
|
||||||
device = (
|
device = (
|
||||||
"cover.test",
|
"cover.test_garage_door",
|
||||||
"off",
|
"off",
|
||||||
{
|
{
|
||||||
"friendly_name": "Test cover",
|
"friendly_name": "Test cover garage door",
|
||||||
"supported_features": 3,
|
"supported_features": 3,
|
||||||
"device_class": "garage",
|
"device_class": "garage",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
appliance = await discovery_test(device, hass)
|
appliance = await discovery_test(device, hass)
|
||||||
|
|
||||||
assert appliance["endpointId"] == "cover#test"
|
assert appliance["endpointId"] == "cover#test_garage_door"
|
||||||
assert appliance["displayCategories"][0] == "GARAGE_DOOR"
|
assert appliance["displayCategories"][0] == "GARAGE_DOOR"
|
||||||
assert appliance["friendlyName"] == "Test cover"
|
assert appliance["friendlyName"] == "Test cover garage door"
|
||||||
|
|
||||||
assert_endpoint_capabilities(
|
assert_endpoint_capabilities(
|
||||||
appliance,
|
appliance, "Alexa.ModeController", "Alexa.EndpointHealth", "Alexa"
|
||||||
"Alexa.ModeController",
|
|
||||||
"Alexa.PowerController",
|
|
||||||
"Alexa.EndpointHealth",
|
|
||||||
"Alexa",
|
|
||||||
)
|
|
||||||
|
|
||||||
await assert_power_controller_works(
|
|
||||||
"cover#test", "cover.open_cover", "cover.close_cover", hass
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user