Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/alexa/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def default_display_categories(self):
def interfaces(self):
"""Yield the supported interfaces."""
device_class = self.entity.attributes.get(ATTR_DEVICE_CLASS)
if device_class != cover.DEVICE_CLASS_GARAGE:
if device_class not in (cover.DEVICE_CLASS_GARAGE, cover.DEVICE_CLASS_GATE):
yield AlexaPowerController(self.entity)

supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
Expand Down
24 changes: 23 additions & 1 deletion tests/components/alexa/test_smart_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,7 @@ async def test_cover_garage_door(hass):
"""Test garage door cover discovery."""
device = (
"cover.test_garage_door",
"off",
"closed",
{
"friendly_name": "Test cover garage door",
"supported_features": 3,
Expand All @@ -2630,6 +2630,28 @@ async def test_cover_garage_door(hass):
)


async def test_cover_gate(hass):
"""Test cover with device class gate discovery."""
device = (
"cover.test_gate",
"closed",
{
"friendly_name": "Test cover gate",
"supported_features": 3,
"device_class": "gate",
},
)
appliance = await discovery_test(device, hass)

assert appliance["endpointId"] == "cover#test_gate"
assert appliance["displayCategories"][0] == "GARAGE_DOOR"
assert appliance["friendlyName"] == "Test cover gate"

assert_endpoint_capabilities(
appliance, "Alexa.ModeController", "Alexa.EndpointHealth", "Alexa"
)


async def test_cover_position_mode(hass):
"""Test cover discovery and position using modeController."""
device = (
Expand Down