diff --git a/homeassistant/components/switchbot_cloud/coordinator.py b/homeassistant/components/switchbot_cloud/coordinator.py index 962d72557b9d..9f5cc174d4fc 100644 --- a/homeassistant/components/switchbot_cloud/coordinator.py +++ b/homeassistant/components/switchbot_cloud/coordinator.py @@ -86,4 +86,7 @@ class SwitchBotCoordinator(DataUpdateCoordinator[Status]): translation_key="invalid_auth", ) from err except SwitchBotConnectionError as err: - raise UpdateFailed(f"Error communicating with API: {err}") from err + raise UpdateFailed( + translation_domain=DOMAIN, + translation_key="update_connection_error", + ) from err diff --git a/homeassistant/components/switchbot_cloud/services.py b/homeassistant/components/switchbot_cloud/services.py index 761f77eef963..3a4cf901c8ae 100644 --- a/homeassistant/components/switchbot_cloud/services.py +++ b/homeassistant/components/switchbot_cloud/services.py @@ -39,7 +39,10 @@ async def handle_upload_image(call: ServiceCall) -> None: (iid[1] for iid in device.identifiers if iid[0] == DOMAIN), None ) if device_mac is None: - raise ServiceValidationError("No valid MAC address obtained.") + raise ServiceValidationError( + translation_domain=DOMAIN, + translation_key="no_valid_mac_address", + ) await config_entry.runtime_data.api.send_command( device_id=device_mac, diff --git a/homeassistant/components/switchbot_cloud/strings.json b/homeassistant/components/switchbot_cloud/strings.json index f5e4534cae07..223cbc31ca81 100644 --- a/homeassistant/components/switchbot_cloud/strings.json +++ b/homeassistant/components/switchbot_cloud/strings.json @@ -121,6 +121,12 @@ }, "invalid_auth": { "message": "Invalid authentication while connecting to the SwitchBot API" + }, + "no_valid_mac_address": { + "message": "No valid MAC address obtained." + }, + "update_connection_error": { + "message": "An error occurred while retrieving data from SwitchBot Cloud" } }, "services": {