mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 04:50:05 +00:00
Support google assistant stopping for assumed state covers (#44266)
* Support stopping for assumed state covers * Adjust black formatting
This commit is contained in:
@@ -384,8 +384,8 @@ async def test_startstop_vacuum(hass):
|
||||
assert unpause_calls[0].data == {ATTR_ENTITY_ID: "vacuum.bla"}
|
||||
|
||||
|
||||
async def test_startstop_covert(hass):
|
||||
"""Test startStop trait support for vacuum domain."""
|
||||
async def test_startstop_cover(hass):
|
||||
"""Test startStop trait support for cover domain."""
|
||||
assert helpers.get_google_type(cover.DOMAIN, None) is not None
|
||||
assert trait.StartStopTrait.supported(cover.DOMAIN, cover.SUPPORT_STOP, None)
|
||||
|
||||
@@ -429,6 +429,24 @@ async def test_startstop_covert(hass):
|
||||
await trt.execute(trait.COMMAND_PAUSEUNPAUSE, BASIC_DATA, {"start": True}, {})
|
||||
|
||||
|
||||
async def test_startstop_cover_assumed(hass):
|
||||
"""Test startStop trait support for cover domain of assumed state."""
|
||||
trt = trait.StartStopTrait(
|
||||
hass,
|
||||
State(
|
||||
"cover.bla",
|
||||
cover.STATE_CLOSED,
|
||||
{ATTR_SUPPORTED_FEATURES: cover.SUPPORT_STOP, ATTR_ASSUMED_STATE: True},
|
||||
),
|
||||
BASIC_CONFIG,
|
||||
)
|
||||
|
||||
stop_calls = async_mock_service(hass, cover.DOMAIN, cover.SERVICE_STOP_COVER)
|
||||
await trt.execute(trait.COMMAND_STARTSTOP, BASIC_DATA, {"start": False}, {})
|
||||
assert len(stop_calls) == 1
|
||||
assert stop_calls[0].data == {ATTR_ENTITY_ID: "cover.bla"}
|
||||
|
||||
|
||||
async def test_color_setting_color_light(hass):
|
||||
"""Test ColorSpectrum trait support for light domain."""
|
||||
assert helpers.get_google_type(light.DOMAIN, None) is not None
|
||||
|
||||
Reference in New Issue
Block a user