mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Use reference strings in rainmachine (#41216)
This commit is contained in:
parent
f50976a0b3
commit
b7ff0a5a49
@ -69,7 +69,7 @@ class RainMachineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
ssl=user_input.get(CONF_SSL, True),
|
ssl=user_input.get(CONF_SSL, True),
|
||||||
)
|
)
|
||||||
except RainMachineError:
|
except RainMachineError:
|
||||||
return await self._show_form({CONF_PASSWORD: "invalid_credentials"})
|
return await self._show_form({CONF_PASSWORD: "invalid_auth"})
|
||||||
|
|
||||||
# Unfortunately, RainMachine doesn't provide a way to refresh the
|
# Unfortunately, RainMachine doesn't provide a way to refresh the
|
||||||
# access token without using the IP address and password, so we have to
|
# access token without using the IP address and password, so we have to
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"identifier_exists": "Account already registered",
|
"identifier_exists": "[%key:common::config_flow::abort::already_configured_account%]",
|
||||||
"invalid_credentials": "Invalid credentials"
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]"
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"already_configured": "This RainMachine controller is already configured."
|
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ async def test_invalid_password(hass):
|
|||||||
side_effect=RainMachineError,
|
side_effect=RainMachineError,
|
||||||
):
|
):
|
||||||
result = await flow.async_step_user(user_input=conf)
|
result = await flow.async_step_user(user_input=conf)
|
||||||
assert result["errors"] == {CONF_PASSWORD: "invalid_credentials"}
|
assert result["errors"] == {CONF_PASSWORD: "invalid_auth"}
|
||||||
|
|
||||||
|
|
||||||
async def test_show_form(hass):
|
async def test_show_form(hass):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user