Skip to content

Commit e72346c

Browse files
authored
data grand lyon: exception translations (home-assistant#170188)
1 parent 266f7b8 commit e72346c

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

homeassistant/components/data_grand_lyon/coordinator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ async def _async_update_data(self) -> dict[str, list[TclPassage]]:
6464
403,
6565
):
6666
raise ConfigEntryAuthFailed(
67-
"Authentication failed for Data Grand Lyon"
67+
translation_domain=DOMAIN,
68+
translation_key="auth_failed",
6869
) from result
6970
LOGGER.warning(
7071
"Error fetching departures for stop %s: %s",
@@ -75,5 +76,8 @@ async def _async_update_data(self) -> dict[str, list[TclPassage]]:
7576
stops[subentry.subentry_id] = result
7677

7778
if stop_subentries and not stops:
78-
raise UpdateFailed("Error fetching DataGrandLyon data: all requests failed")
79+
raise UpdateFailed(
80+
translation_domain=DOMAIN,
81+
translation_key="update_failed_all_stops",
82+
)
7983
return stops

homeassistant/components/data_grand_lyon/quality_scale.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ rules:
5959
entity-category: done
6060
entity-device-class: done
6161
entity-disabled-by-default: done
62-
entity-translations: todo
63-
exception-translations: todo
62+
entity-translations: done
63+
exception-translations: done
6464
icon-translations: done
6565
reconfiguration-flow: todo
6666
repair-issues:

homeassistant/components/data_grand_lyon/strings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,13 @@
9393
}
9494
}
9595
}
96+
},
97+
"exceptions": {
98+
"auth_failed": {
99+
"message": "Authentication failed for Data Grand Lyon."
100+
},
101+
"update_failed_all_stops": {
102+
"message": "Error fetching Data Grand Lyon data: all requests failed."
103+
}
96104
}
97105
}

0 commit comments

Comments
 (0)