From aba3cdc7b31899fdaadc1accfe8b1f159b183044 Mon Sep 17 00:00:00 2001 From: Davey Chu Date: Fri, 2 Oct 2020 03:16:15 +0200 Subject: [PATCH] Use references in guardian strings.json (#40987) --- homeassistant/components/guardian/config_flow.py | 2 +- homeassistant/components/guardian/strings.json | 6 +++--- tests/components/guardian/test_config_flow.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/guardian/config_flow.py b/homeassistant/components/guardian/config_flow.py index 71ec271753e..760cf960e43 100644 --- a/homeassistant/components/guardian/config_flow.py +++ b/homeassistant/components/guardian/config_flow.py @@ -83,7 +83,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): async def async_step_zeroconf(self, discovery_info): """Handle the configuration via zeroconf.""" if discovery_info is None: - return self.async_abort(reason="connection_error") + return self.async_abort(reason="cannot_connect") pin = async_get_pin_from_discovery_hostname(discovery_info["hostname"]) await self._async_set_unique_id(pin) diff --git a/homeassistant/components/guardian/strings.json b/homeassistant/components/guardian/strings.json index baa1bf6aa7d..d1732c9a63b 100644 --- a/homeassistant/components/guardian/strings.json +++ b/homeassistant/components/guardian/strings.json @@ -6,7 +6,7 @@ "description": "Configure a local Elexa Guardian device.", "data": { "ip_address": "[%key:common::config_flow::data::ip%]", - "port": "Port" + "port": "[%key:common::config_flow::data::port%]" } }, "zeroconf_confirm": { @@ -14,9 +14,9 @@ } }, "abort": { - "already_configured": "This Guardian device has already been configured.", + "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", "already_in_progress": "Guardian device configuration is already in process.", - "connection_error": "Failed to connect to the Guardian device." + "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]" } } } diff --git a/tests/components/guardian/test_config_flow.py b/tests/components/guardian/test_config_flow.py index a10bee374f8..db0cf877d37 100644 --- a/tests/components/guardian/test_config_flow.py +++ b/tests/components/guardian/test_config_flow.py @@ -138,4 +138,4 @@ async def test_step_zeroconf_no_discovery_info(hass): DOMAIN, context={"source": SOURCE_ZEROCONF} ) assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT - assert result["reason"] == "connection_error" + assert result["reason"] == "cannot_connect"