mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +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:
|
if not result:
|
||||||
errors["base"] = "no_units"
|
errors["base"] = "no_units"
|
||||||
except (OSError, ConnectionRefusedError, TimeoutError):
|
except (OSError, ConnectionRefusedError, TimeoutError):
|
||||||
errors["base"] = "connection_error"
|
errors["base"] = "cannot_connect"
|
||||||
|
|
||||||
if errors:
|
if errors:
|
||||||
return self.async_show_form(
|
return self.async_show_form(
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"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."
|
"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["type"] == "form"
|
||||||
assert result2["errors"] == {"base": "connection_error"}
|
assert result2["errors"] == {"base": "cannot_connect"}
|
||||||
|
|
||||||
|
|
||||||
async def test_form_connection_refused(hass):
|
async def test_form_connection_refused(hass):
|
||||||
@ -78,7 +78,7 @@ async def test_form_connection_refused(hass):
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert result2["type"] == "form"
|
assert result2["type"] == "form"
|
||||||
assert result2["errors"] == {"base": "connection_error"}
|
assert result2["errors"] == {"base": "cannot_connect"}
|
||||||
|
|
||||||
|
|
||||||
async def test_form_no_units(hass):
|
async def test_form_no_units(hass):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user