mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 02:07:54 +00:00
Fix Home Connect service validation error placeholders (#131294)
This commit is contained in:
parent
c61e94dac2
commit
53b87f47fb
@ -329,10 +329,10 @@ async def async_migrate_entry(
|
||||
|
||||
def get_dict_from_home_connect_error(err: api.HomeConnectError) -> dict[str, Any]:
|
||||
"""Return a dict from a Home Connect error."""
|
||||
return (
|
||||
err.args[0]
|
||||
return {
|
||||
"description": cast(dict[str, Any], err.args[0]).get("description", "?")
|
||||
if len(err.args) > 0 and isinstance(err.args[0], dict)
|
||||
else {"description": err.args[0]}
|
||||
else err.args[0]
|
||||
if len(err.args) > 0 and isinstance(err.args[0], str)
|
||||
else {}
|
||||
)
|
||||
else "?",
|
||||
}
|
||||
|
@ -38,13 +38,13 @@
|
||||
"message": "Error while trying to set color of {entity_id}: {description}"
|
||||
},
|
||||
"set_setting": {
|
||||
"message": "Error while trying to assign the value \"{value}\" to the setting \"{key}\" for {entity_id}: {description}"
|
||||
"message": "Error while trying to assign the value \"{value}\" to the setting \"{setting_key}\" for {entity_id}: {description}"
|
||||
},
|
||||
"turn_on": {
|
||||
"message": "Error while trying to turn on {entity_id} ({key}): {description}"
|
||||
"message": "Error while trying to turn on {entity_id} ({setting_key}): {description}"
|
||||
},
|
||||
"turn_off": {
|
||||
"message": "Error while trying to turn off {entity_id} ({key}): {description}"
|
||||
"message": "Error while trying to turn off {entity_id} ({setting_key}): {description}"
|
||||
},
|
||||
"start_program": {
|
||||
"message": "Error while trying to start program {program}: {description}"
|
||||
|
@ -162,7 +162,7 @@ async def test_switch_functionality(
|
||||
SERVICE_TURN_OFF,
|
||||
"set_setting",
|
||||
"Dishwasher",
|
||||
r"Error.*turn.*off.*appliance.*value",
|
||||
r"Error.*turn.*off.*",
|
||||
),
|
||||
(
|
||||
"switch.dishwasher_power",
|
||||
@ -170,7 +170,7 @@ async def test_switch_functionality(
|
||||
SERVICE_TURN_ON,
|
||||
"set_setting",
|
||||
"Dishwasher",
|
||||
r"Error.*turn.*on.*appliance.*",
|
||||
r"Error.*turn.*on.*",
|
||||
),
|
||||
(
|
||||
"switch.dishwasher_child_lock",
|
||||
@ -178,7 +178,7 @@ async def test_switch_functionality(
|
||||
SERVICE_TURN_ON,
|
||||
"set_setting",
|
||||
"Dishwasher",
|
||||
r"Error.*turn.*on.*key.*",
|
||||
r"Error.*turn.*on.*",
|
||||
),
|
||||
(
|
||||
"switch.dishwasher_child_lock",
|
||||
@ -186,7 +186,7 @@ async def test_switch_functionality(
|
||||
SERVICE_TURN_OFF,
|
||||
"set_setting",
|
||||
"Dishwasher",
|
||||
r"Error.*turn.*off.*key.*",
|
||||
r"Error.*turn.*off.*",
|
||||
),
|
||||
],
|
||||
indirect=["problematic_appliance"],
|
||||
@ -297,7 +297,7 @@ async def test_ent_desc_switch_functionality(
|
||||
SERVICE_TURN_ON,
|
||||
"set_setting",
|
||||
"FridgeFreezer",
|
||||
r"Error.*turn.*on.*key.*",
|
||||
r"Error.*turn.*on.*",
|
||||
),
|
||||
(
|
||||
"switch.fridgefreezer_freezer_super_mode",
|
||||
@ -305,7 +305,7 @@ async def test_ent_desc_switch_functionality(
|
||||
SERVICE_TURN_OFF,
|
||||
"set_setting",
|
||||
"FridgeFreezer",
|
||||
r"Error.*turn.*off.*key.*",
|
||||
r"Error.*turn.*off.*",
|
||||
),
|
||||
],
|
||||
indirect=["problematic_appliance"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user