Victron GX: Add exception translations (#168762)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Tomer
2026-04-23 22:30:47 +02:00
committed by GitHub
co-authored by Copilot
parent 7bf3e75bc8
commit 86ffb9eccb
3 changed files with 15 additions and 3 deletions
+6 -2
View File
@@ -89,11 +89,15 @@ class Hub:
await self._hub.connect()
except AuthenticationError as auth_error:
raise ConfigEntryAuthFailed(
f"Authentication failed for {self.host}: {auth_error}"
translation_domain=DOMAIN,
translation_key="authentication_failed",
translation_placeholders={"host": self.host},
) from auth_error
except CannotConnectError as connect_error:
raise ConfigEntryNotReady(
f"Cannot connect to the hub at {self.host}: {connect_error}"
translation_domain=DOMAIN,
translation_key="cannot_connect",
translation_placeholders={"host": self.host},
) from connect_error
async def stop(self) -> None:
@@ -57,7 +57,7 @@ rules:
entity-device-class: done
entity-disabled-by-default: done
entity-translations: done
exception-translations: todo
exception-translations: done
icon-translations:
status: exempt
comment: |
@@ -1977,5 +1977,13 @@
"name": "ESS BatteryLife schedule charge {slot} start"
}
}
},
"exceptions": {
"authentication_failed": {
"message": "Authentication failed for {host}."
},
"cannot_connect": {
"message": "Cannot connect to the GX device at {host}."
}
}
}