CZ_CD: Add support for České dráhy trains (and their cross-border ECs)

This commit is contained in:
embr 2023-12-26 17:21:47 +01:00
parent ec843236df
commit 75e1d3aee4
2 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,13 @@
ambient_is_ssid "CDWiFi"; or exit
curl -s http://cdwifi.cz/portal/api/vehicle/realtime | jq -r '{
"AMBIENT_CZ_CD_GPS_LAT": (.gpsLat),
"AMBIENT_CZ_CD_GPS_LNG": (.gpsLng),
"AMBIENT_CZ_CD_PREV_GPS_LAT": (.gpsLat),
"AMBIENT_CZ_CD_PREV_GPS_LNG": (.gpsLng),
"AMBIENT_CZ_CD_PREV_GPS_LNG": (.gpsLng),
"AMBIENT_CZ_CD_SPEED": (.speed),
"AMBIENT_CZ_CD_DELAY": (.delay),
"AMBIENT_CZ_CD_ALTITUDE": (.altitude),
"AMBIENT_CZ_CD_TEMPERATURE": (.temperature),
} | to_entries | map(select(.value != null)) | map(.key + "=" + (.value | tostring)) | join("\n")'

View file

@ -0,0 +1,3 @@
if set -q AMBIENT_CZ_CD_SPEED
echo "💨 $AMBIENT_CZ_CD_SPEED km/h"
end