mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Use reference strings in Coolmaster (#41066)
* Update strings.json * Update config_flow.py * Update test_config_flow.py
This commit is contained in:
parent
135be787e2
commit
65611320d4
@ -54,7 +54,7 @@ class CoolmasterConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
if not result:
|
||||
errors["base"] = "no_units"
|
||||
except (OSError, ConnectionRefusedError, TimeoutError):
|
||||
errors["base"] = "connection_error"
|
||||
errors["base"] = "cannot_connect"
|
||||
|
||||
if errors:
|
||||
return self.async_show_form(
|
||||
|
@ -15,7 +15,7 @@
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
"connection_error": "Failed to connect to CoolMasterNet instance. Please check your host.",
|
||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
||||
"no_units": "Could not find any HVAC units in CoolMasterNet host."
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ async def test_form_timeout(hass):
|
||||
)
|
||||
|
||||
assert result2["type"] == "form"
|
||||
assert result2["errors"] == {"base": "connection_error"}
|
||||
assert result2["errors"] == {"base": "cannot_connect"}
|
||||
|
||||
|
||||
async def test_form_connection_refused(hass):
|
||||
@ -78,7 +78,7 @@ async def test_form_connection_refused(hass):
|
||||
)
|
||||
|
||||
assert result2["type"] == "form"
|
||||
assert result2["errors"] == {"base": "connection_error"}
|
||||
assert result2["errors"] == {"base": "cannot_connect"}
|
||||
|
||||
|
||||
async def test_form_no_units(hass):
|
||||
|
Loading…
x
Reference in New Issue
Block a user