@@ -37,6 +37,27 @@ async def test_start_vacuum_intent(hass: HomeAssistant) -> None:
3737 assert call .data == {"entity_id" : entity_id }
3838
3939
40+ async def test_start_vacuum_without_name (hass : HomeAssistant ) -> None :
41+ """Test starting a vacuum without specifying the name."""
42+ await vacuum_intent .async_setup_intents (hass )
43+
44+ entity_id = f"{ DOMAIN } .test_vacuum"
45+ hass .states .async_set (entity_id , STATE_IDLE )
46+ calls = async_mock_service (hass , DOMAIN , SERVICE_START )
47+
48+ response = await intent .async_handle (
49+ hass , "test" , vacuum_intent .INTENT_VACUUM_START , {}
50+ )
51+ await hass .async_block_till_done ()
52+
53+ assert response .response_type == intent .IntentResponseType .ACTION_DONE
54+ assert len (calls ) == 1
55+ call = calls [0 ]
56+ assert call .domain == DOMAIN
57+ assert call .service == SERVICE_START
58+ assert call .data == {"entity_id" : entity_id }
59+
60+
4061async def test_stop_vacuum_intent (hass : HomeAssistant ) -> None :
4162 """Test HassTurnOff intent for vacuums."""
4263 await vacuum_intent .async_setup_intents (hass )
@@ -59,3 +80,24 @@ async def test_stop_vacuum_intent(hass: HomeAssistant) -> None:
5980 assert call .domain == DOMAIN
6081 assert call .service == SERVICE_RETURN_TO_BASE
6182 assert call .data == {"entity_id" : entity_id }
83+
84+
85+ async def test_stop_vacuum_without_name (hass : HomeAssistant ) -> None :
86+ """Test stopping a vacuum without specifying the name."""
87+ await vacuum_intent .async_setup_intents (hass )
88+
89+ entity_id = f"{ DOMAIN } .test_vacuum"
90+ hass .states .async_set (entity_id , STATE_IDLE )
91+ calls = async_mock_service (hass , DOMAIN , SERVICE_RETURN_TO_BASE )
92+
93+ response = await intent .async_handle (
94+ hass , "test" , vacuum_intent .INTENT_VACUUM_RETURN_TO_BASE , {}
95+ )
96+ await hass .async_block_till_done ()
97+
98+ assert response .response_type == intent .IntentResponseType .ACTION_DONE
99+ assert len (calls ) == 1
100+ call = calls [0 ]
101+ assert call .domain == DOMAIN
102+ assert call .service == SERVICE_RETURN_TO_BASE
103+ assert call .data == {"entity_id" : entity_id }
0 commit comments