mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Add translations for exceptions and data descriptions to pyLoad integration (#138896)
This commit is contained in:
parent
351e594fe4
commit
461039f06a
@ -78,10 +78,14 @@ class PyLoadCoordinator(DataUpdateCoordinator[PyLoadData]):
|
||||
return self.data
|
||||
except CannotConnect as e:
|
||||
raise UpdateFailed(
|
||||
"Unable to connect and retrieve data from pyLoad API"
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="setup_request_exception",
|
||||
) from e
|
||||
except ParserError as e:
|
||||
raise UpdateFailed("Unable to parse data from pyLoad API") from e
|
||||
raise UpdateFailed(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="setup_parse_exception",
|
||||
) from e
|
||||
|
||||
async def _async_setup(self) -> None:
|
||||
"""Set up the coordinator."""
|
||||
|
@ -12,7 +12,11 @@
|
||||
},
|
||||
"data_description": {
|
||||
"host": "The hostname or IP address of the device running your pyLoad instance.",
|
||||
"port": "pyLoad uses port 8000 by default."
|
||||
"username": "The username used to access the pyLoad instance.",
|
||||
"password": "The password associated with the pyLoad account.",
|
||||
"port": "pyLoad uses port 8000 by default.",
|
||||
"ssl": "If enabled, the connection to the pyLoad instance will use HTTPS.",
|
||||
"verify_ssl": "If checked, the SSL certificate will be validated to ensure a secure connection."
|
||||
}
|
||||
},
|
||||
"reconfigure": {
|
||||
@ -25,8 +29,12 @@
|
||||
"port": "[%key:common::config_flow::data::port%]"
|
||||
},
|
||||
"data_description": {
|
||||
"host": "The hostname or IP address of the device running your pyLoad instance.",
|
||||
"port": "pyLoad uses port 8000 by default."
|
||||
"host": "[%key:component::pyload::config::step::user::data_description::host%]",
|
||||
"verify_ssl": "[%key:component::pyload::config::step::user::data_description::verify_ssl%]",
|
||||
"username": "[%key:component::pyload::config::step::user::data_description::username%]",
|
||||
"password": "[%key:component::pyload::config::step::user::data_description::password%]",
|
||||
"port": "[%key:component::pyload::config::step::user::data_description::port%]",
|
||||
"ssl": "[%key:component::pyload::config::step::user::data_description::ssl%]"
|
||||
}
|
||||
},
|
||||
"reauth_confirm": {
|
||||
@ -34,6 +42,10 @@
|
||||
"data": {
|
||||
"username": "[%key:common::config_flow::data::username%]",
|
||||
"password": "[%key:common::config_flow::data::password%]"
|
||||
},
|
||||
"data_description": {
|
||||
"username": "[%key:component::pyload::config::step::user::data_description::username%]",
|
||||
"password": "[%key:component::pyload::config::step::user::data_description::password%]"
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -91,10 +103,10 @@
|
||||
},
|
||||
"exceptions": {
|
||||
"setup_request_exception": {
|
||||
"message": "Unable to connect and retrieve data from pyLoad API, try again later"
|
||||
"message": "Unable to connect and retrieve data from pyLoad API"
|
||||
},
|
||||
"setup_parse_exception": {
|
||||
"message": "Unable to parse data from pyLoad API, try again later"
|
||||
"message": "Unable to parse data from pyLoad API"
|
||||
},
|
||||
"setup_authentication_exception": {
|
||||
"message": "Authentication failed for {username}, verify your login credentials"
|
||||
|
Loading…
x
Reference in New Issue
Block a user