mirror of
https://github.com/home-assistant/core.git
synced 2026-09-03 10:05:58 -05:00
Victron GX: Add exception translations (#168762)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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}."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user