diff --git a/homeassistant/components/coolmaster/config_flow.py b/homeassistant/components/coolmaster/config_flow.py index c674146fd15..7c9b4d5d065 100644 --- a/homeassistant/components/coolmaster/config_flow.py +++ b/homeassistant/components/coolmaster/config_flow.py @@ -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( diff --git a/homeassistant/components/coolmaster/strings.json b/homeassistant/components/coolmaster/strings.json index fd91e5576d2..7afc012a191 100644 --- a/homeassistant/components/coolmaster/strings.json +++ b/homeassistant/components/coolmaster/strings.json @@ -15,8 +15,8 @@ } }, "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 newline at end of file +} diff --git a/tests/components/coolmaster/test_config_flow.py b/tests/components/coolmaster/test_config_flow.py index fc296a53ddf..b758a37db1d 100644 --- a/tests/components/coolmaster/test_config_flow.py +++ b/tests/components/coolmaster/test_config_flow.py @@ -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):