mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Translate missing exceptions in SamsungTV (#143628)
* Translate missing exceptions in SamsungTV * apply review comment
This commit is contained in:
parent
18f51abfe6
commit
40752dcfb6
@ -35,6 +35,7 @@ from .const import (
|
|||||||
CONF_SESSION_ID,
|
CONF_SESSION_ID,
|
||||||
CONF_SSDP_MAIN_TV_AGENT_LOCATION,
|
CONF_SSDP_MAIN_TV_AGENT_LOCATION,
|
||||||
CONF_SSDP_RENDERING_CONTROL_LOCATION,
|
CONF_SSDP_RENDERING_CONTROL_LOCATION,
|
||||||
|
DOMAIN,
|
||||||
ENTRY_RELOAD_COOLDOWN,
|
ENTRY_RELOAD_COOLDOWN,
|
||||||
LEGACY_PORT,
|
LEGACY_PORT,
|
||||||
LOGGER,
|
LOGGER,
|
||||||
@ -126,7 +127,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: SamsungTVConfigEntry) ->
|
|||||||
if entry.data.get(CONF_METHOD) == METHOD_ENCRYPTED_WEBSOCKET:
|
if entry.data.get(CONF_METHOD) == METHOD_ENCRYPTED_WEBSOCKET:
|
||||||
if not entry.data.get(CONF_TOKEN) or not entry.data.get(CONF_SESSION_ID):
|
if not entry.data.get(CONF_TOKEN) or not entry.data.get(CONF_SESSION_ID):
|
||||||
raise ConfigEntryAuthFailed(
|
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)
|
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
|
load_info_attempted = True
|
||||||
if not port or not method:
|
if not port or not method:
|
||||||
raise ConfigEntryNotReady(
|
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)
|
LOGGER.debug("Updated port to %s and method to %s for %s", port, method, host)
|
||||||
|
@ -67,6 +67,12 @@
|
|||||||
},
|
},
|
||||||
"service_unsupported": {
|
"service_unsupported": {
|
||||||
"message": "Entity {entity} does not support this action."
|
"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."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user