Add translations for exceptions and data descriptions to pyLoad integration (#138896)

This commit is contained in:
Manu 2025-02-24 17:23:14 +01:00 committed by GitHub
parent 351e594fe4
commit 461039f06a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 7 deletions

View File

@ -78,10 +78,14 @@ class PyLoadCoordinator(DataUpdateCoordinator[PyLoadData]):
return self.data return self.data
except CannotConnect as e: except CannotConnect as e:
raise UpdateFailed( raise UpdateFailed(
"Unable to connect and retrieve data from pyLoad API" translation_domain=DOMAIN,
translation_key="setup_request_exception",
) from e ) from e
except ParserError as 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: async def _async_setup(self) -> None:
"""Set up the coordinator.""" """Set up the coordinator."""

View File

@ -12,7 +12,11 @@
}, },
"data_description": { "data_description": {
"host": "The hostname or IP address of the device running your pyLoad instance.", "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": { "reconfigure": {
@ -25,8 +29,12 @@
"port": "[%key:common::config_flow::data::port%]" "port": "[%key:common::config_flow::data::port%]"
}, },
"data_description": { "data_description": {
"host": "The hostname or IP address of the device running your pyLoad instance.", "host": "[%key:component::pyload::config::step::user::data_description::host%]",
"port": "pyLoad uses port 8000 by default." "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": { "reauth_confirm": {
@ -34,6 +42,10 @@
"data": { "data": {
"username": "[%key:common::config_flow::data::username%]", "username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]" "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": { "exceptions": {
"setup_request_exception": { "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": { "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": { "setup_authentication_exception": {
"message": "Authentication failed for {username}, verify your login credentials" "message": "Authentication failed for {username}, verify your login credentials"