Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions homeassistant/components/smappee/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async def async_step_zeroconf_confirm(self, user_input=None):
smappee_api = api.api.SmappeeLocalApi(ip=ip_address)
logon = await self.hass.async_add_executor_job(smappee_api.logon)
if logon is None:
return self.async_abort(reason="connection_error")
return self.async_abort(reason="cannot_connect")

return self.async_create_entry(
title=f"{DOMAIN}{serial_number}",
Expand Down Expand Up @@ -149,7 +149,7 @@ async def async_step_local(self, user_input=None):
smappee_api = api.api.SmappeeLocalApi(ip=ip_address)
logon = await self.hass.async_add_executor_job(smappee_api.logon)
if logon is None:
return self.async_abort(reason="connection_error")
return self.async_abort(reason="cannot_connect")

advanced_config = await self.hass.async_add_executor_job(
smappee_api.load_advanced_config
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/smappee/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"abort": {
"already_configured_device": "[%key:common::config_flow::abort::already_configured_device%]",
"already_configured_local_device": "Local device(s) is already configured. Please remove those first before configuring a cloud device.",
"authorize_url_timeout": "Timeout generating authorize url.",
"connection_error": "Failed to connect to Smappee device.",
"missing_configuration": "The component is not configured. Please follow the documentation.",
"authorize_url_timeout": "[%key:common::config_flow::abort::oauth2_authorize_url_timeout%]",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"missing_configuration": "[%key:common::config_flow::abort::oauth2_missing_configuration%]",
"invalid_mdns": "Unsupported device for the Smappee integration.",
"no_url_available": "[%key:common::config_flow::abort::oauth2_no_url_available%]"
}
Expand Down
4 changes: 2 additions & 2 deletions tests/components/smappee/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async def test_show_zeroconf_connection_error_form(hass):
)

assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
assert result["reason"] == "connection_error"
assert result["reason"] == "cannot_connect"
assert len(hass.config_entries.async_entries(DOMAIN)) == 0


Expand All @@ -95,7 +95,7 @@ async def test_connection_error(hass):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], {"host": "1.2.3.4"}
)
assert result["reason"] == "connection_error"
assert result["reason"] == "cannot_connect"
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT


Expand Down