Translate missing exceptions in SamsungTV (#143628)

* Translate missing exceptions in SamsungTV

* apply review comment
This commit is contained in:
Simone Chemelli 2025-04-26 22:43:07 +02:00 committed by GitHub
parent 18f51abfe6
commit 40752dcfb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -35,6 +35,7 @@ from .const import (
CONF_SESSION_ID,
CONF_SSDP_MAIN_TV_AGENT_LOCATION,
CONF_SSDP_RENDERING_CONTROL_LOCATION,
DOMAIN,
ENTRY_RELOAD_COOLDOWN,
LEGACY_PORT,
LOGGER,
@ -126,7 +127,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: SamsungTVConfigEntry) ->
if entry.data.get(CONF_METHOD) == METHOD_ENCRYPTED_WEBSOCKET:
if not entry.data.get(CONF_TOKEN) or not entry.data.get(CONF_SESSION_ID):
raise ConfigEntryAuthFailed(
"Token and session id are required in encrypted mode"
translation_domain=DOMAIN, translation_key="encrypted_mode_auth_failed"
)
bridge = await _async_create_bridge_with_updated_data(hass, entry)
@ -195,7 +196,8 @@ async def _async_create_bridge_with_updated_data(
load_info_attempted = True
if not port or not method:
raise ConfigEntryNotReady(
"Failed to determine connection method, make sure the device is on."
translation_domain=DOMAIN,
translation_key="failed_to_determine_connection_method",
)
LOGGER.debug("Updated port to %s and method to %s for %s", port, method, host)

View File

@ -67,6 +67,12 @@
},
"service_unsupported": {
"message": "Entity {entity} does not support this action."
},
"encrypted_mode_auth_failed": {
"message": "Token and session ID are required in encrypted mode."
},
"failed_to_determine_connection_method": {
"message": "Failed to determine connection method, make sure the device is on."
}
}
}