File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
homeassistant/components/tessie Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 2121 "already inactive" : "already_inactive" ,
2222 "incorrect pin" : "incorrect_pin" ,
2323 "no cable" : "no_cable" ,
24+ "cpd_enabled" : "cpd_enabled" ,
2425}
2526
2627
Original file line number Diff line number Diff line change 517517 "command_failed" : {
518518 "message" : " Command failed, {message}"
519519 },
520+ "cpd_enabled" : {
521+ "message" : " Child presence detection has blocked the command, remove weight from seats."
522+ },
520523 "incorrect_pin" : {
521524 "message" : " Incorrect PIN for {name}."
522525 },
Original file line number Diff line number Diff line change @@ -130,3 +130,21 @@ async def test_errors(hass: HomeAssistant) -> None:
130130 )
131131 mock_set .assert_called_once ()
132132 assert error .value .__cause__ == ERROR_UNKNOWN
133+
134+ # Test setting climate with child presence detection error
135+ with (
136+ patch (
137+ "homeassistant.components.tessie.climate.start_climate_preconditioning" ,
138+ return_value = {"result" : False , "reason" : "cpd_enabled" },
139+ ) as mock_set ,
140+ pytest .raises (HomeAssistantError ) as error ,
141+ ):
142+ await hass .services .async_call (
143+ CLIMATE_DOMAIN ,
144+ SERVICE_SET_HVAC_MODE ,
145+ {ATTR_ENTITY_ID : [entity_id ], ATTR_HVAC_MODE : HVACMode .HEAT_COOL },
146+ blocking = True ,
147+ )
148+ mock_set .assert_called_once ()
149+ assert error .value .translation_domain == "tessie"
150+ assert error .value .translation_key == "cpd_enabled"
You can’t perform that action at this time.
0 commit comments