mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Use reference strings in Alarmdecoder (#41392)
This commit is contained in:
parent
d2d3749223
commit
b7c2e117be
@ -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"
|
||||||
|
@ -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": {
|
||||||
|
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user