Skip to content

Instantly share code, notes, and snippets.

View Sico93's full-sized avatar

Sico93 / nano / fala Sico93

View GitHub Profile
@350d
350d / config.json
Last active October 10, 2020 14:05 — forked from johannrichard/homebridge
Full install + Systemd Service for Homebridge
{
"bridge": {
"name": "Homebridge",
"username": "{MAC}",
"port": 51826,
"pin": "{PIN}"
},
"description": "This is an example configuration file. You can use this as a template for creating your own configuration file containing devices you actually own.",
//from
//https://bikeshedeffect.weebly.com/arduino-piezo-sounds.html
/* insert sound code into setup to play once, main loop to repeat, or into sound() function to call when wanted (button push, etc...)// Speaker must be on pin 8, see setup here: http://www.arduino.cc/en/Tutorial/PlayMelody
*/
#include "pitches.h" // must include open source pitches.h found online in libraries folder or make a new tab => https://docs.arduino.cc/built-in-examples/digital/toneMelody
void setup() {
// do nothing
set -l data_status (curl -s https://iceportal.de/api1/rs/status)
set -l data_trip (curl -s https://iceportal.de/api1/rs/tripInfo/trip)
# next stop
echo  (echo $data_trip | jq -r '([ .trip.stops[] | select(.info.passed==false) ]
| first).station.name')
# train number
echo  (echo $data_trip | jq -r '"\(.trip.trainType)-\(.trip.vzn)"')
# speed
echo speed (echo $data_status | jq -r '"\(.speed) km/h"')