mirror of
https://github.com/liclac/ambient
synced 2024-11-21 19:33:08 +00:00
CZ_CD: Add support for České dráhy trains (and their cross-border ECs)
This commit is contained in:
parent
ec843236df
commit
75e1d3aee4
2 changed files with 16 additions and 0 deletions
13
ambient.d/trains/CZ_CD.fish
Normal file
13
ambient.d/trains/CZ_CD.fish
Normal 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")'
|
3
widgets.d/trains/CZ_CD.fish
Normal file
3
widgets.d/trains/CZ_CD.fish
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
if set -q AMBIENT_CZ_CD_SPEED
|
||||||
|
echo "💨 $AMBIENT_CZ_CD_SPEED km/h"
|
||||||
|
end
|
Loading…
Reference in a new issue