Use reference strings in Alarmdecoder (#41392)

This commit is contained in:
SNoof85 2020-10-07 14:46:17 +02:00 committed by GitHub
parent d2d3749223
commit b7c2e117be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -111,7 +111,7 @@ class AlarmDecoderFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
title=title, data={CONF_PROTOCOL: self.protocol, **connection} title=title, data={CONF_PROTOCOL: self.protocol, **connection}
) )
except NoDeviceError: except NoDeviceError:
errors["base"] = "service_unavailable" errors["base"] = "cannot_connect"
except Exception: # pylint: disable=broad-except except Exception: # pylint: disable=broad-except
_LOGGER.exception("Unexpected exception during AlarmDecoder setup") _LOGGER.exception("Unexpected exception during AlarmDecoder setup")
errors["base"] = "unknown" errors["base"] = "unknown"

View File

@ -18,7 +18,7 @@
} }
}, },
"error": { "error": {
"service_unavailable": "[%key:common::config_flow::error::cannot_connect%]" "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
}, },
"create_entry": { "default": "Successfully connected to AlarmDecoder." }, "create_entry": { "default": "Successfully connected to AlarmDecoder." },
"abort": { "abort": {

View File

@ -126,7 +126,7 @@ async def test_setup_connection_error(hass: HomeAssistant):
result["flow_id"], connection_settings result["flow_id"], connection_settings
) )
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result["errors"] == {"base": "service_unavailable"} assert result["errors"] == {"base": "cannot_connect"}
async def test_options_arm_flow(hass: HomeAssistant): async def test_options_arm_flow(hass: HomeAssistant):