Skip to content

Commit 5516ca4

Browse files
committed
- added NL
- added json_src as attr for messages
1 parent 3885f59 commit 5516ca4

File tree

4 files changed

+361
-10
lines changed

4 files changed

+361
-10
lines changed

custom_components/fordconnect_query/const.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
FORD_EV_SESSIONS_TEMP: Final = "{base_url}/fccs?startDate={start}&endDate={end}"
3434

3535
TRANSLATIONS: Final = {
36-
"de":{
36+
"de": {
3737
"account": "Konto",
3838
"coord_null_data": "Es konnten keine Daten abgerufen werden. Bitte prüfe Dein Home Assistant System Protokoll auf mögliche Fehlermeldungen der Integration.",
3939
"coord_no_vehicle_data": "Es konnten keine Daten zu Deinem konfigurierten Fahrzeug abgerufen werden. Bitte prüfe Dein Home Assistant System Protokoll auf mögliche Fehlermeldungen der Integration."
@@ -42,5 +42,10 @@
4242
"account": "Account",
4343
"coord_null_data": "Coordinator could not provided any data. Please check your Home Assistant system log for possible error messages.",
4444
"coord_no_vehicle_data": "Coordinator could not fetch essential information from your configured vehicle. Please check your Home Assistant system log for possible error messages."
45+
},
46+
"nl": {
47+
"account": "Account",
48+
"coord_null_data": "Coördinator kon geen gegevens leveren. Controleer uw Home Assistant-systeemlogboek op mogelijke foutmeldingen.",
49+
"coord_no_vehicle_data": "Coördinator kon essentiële informatie van uw geconfigureerde voertuig niet ophalen. Controleer uw Home Assistant-systeemlogboek op mogelijke foutmeldingen."
4550
}
4651
}

custom_components/fordconnect_query/fordpass_handler.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ def get_alarm_attr(data, units:UnitSystem):
328328
attrs["panicAlarmStatus"] = val
329329
return attrs or None
330330

331-
332331
# DOOR_LOCK state
333332
def get_door_lock_state(data, prev_state=None):
334333
# EXAMPLE data:
@@ -965,13 +964,16 @@ def get_messages_state(data, prev_state=None):
965964

966965
def get_messages_attrs(data, units:UnitSystem):
967966
attrs = {}
968-
count = 1
969-
for a_msg in data.get(ROOT_MESSAGES, []):
970-
attrs[f"msg{count:03}_Date"] = f"{a_msg['createdDate']}"
971-
attrs[f"msg{count:03}_Type"] = f"{a_msg['messageType']}"
972-
attrs[f"msg{count:03}_Subject"] = f"{a_msg['messageSubject']}"
973-
attrs[f"msg{count:03}_Content"] = f"{a_msg['messageBody']}"
974-
count = count + 1
967+
msg_data = data.get(ROOT_MESSAGES, [])
968+
if len(msg_data) > 0:
969+
attrs["json_src"] = msg_data.copy()
970+
count = 1
971+
for a_msg in msg_data:
972+
attrs[f"msg{count:03}_Date"] = f"{a_msg['createdDate']}"
973+
attrs[f"msg{count:03}_Type"] = f"{a_msg['messageType']}"
974+
attrs[f"msg{count:03}_Subject"] = f"{a_msg['messageSubject']}"
975+
attrs[f"msg{count:03}_Content"] = f"{a_msg['messageBody']}"
976+
count = count + 1
975977
return attrs
976978

977979

custom_components/fordconnect_query/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"iot_class": "cloud_polling",
99
"issue_tracker": "https://github.com/marq24/ha-fordconnect-query/issues",
1010
"requirements": [],
11-
"version": "2026.1.4"
11+
"version": "2026.1.5"
1212
}

0 commit comments

Comments
 (0)