ets2-local-radio icon indicating copy to clipboard operation
ets2-local-radio copied to clipboard

Additional API / Showing Radio Data

Open N95JPL opened this issue 4 years ago • 4 comments

An extra API for people to use http://IPADDRESS/api/radio/

This will show a JSON String with the Current Radio Station & the Signal strength

Like this;

{"Radio":"RAI Radio 1","Signal":"5"}

I wanted to include the Nearest City but it would require a slight change to the main.js (Web one) which isnt hosted locally to try & In-Game Time, but the SDK used by this Program isn't new enough so doesn't include the value

N95JPL avatar Apr 22 '20 19:04 N95JPL

Quick Question: When the server is playing a specific radio station and the signal starts dropping out (Whitenoise starting) - Is the SetRadioStation called again with the Signal Strength? Or is this handled by the setWhitenoise function in web/main.js Thanks, JPL

N95JPL avatar Apr 23 '20 13:04 N95JPL

setWhitenoise, in particular here: https://github.com/Koenvh1/ets2-local-radio/blob/master/web/lib/js/main.js#L308

Koenvh1 avatar Apr 23 '20 14:04 Koenvh1

API Feature - Signal is now dynamic based on the white-noise values and is refreshed along-side:

function refresh(data)

N95JPL avatar Apr 25 '20 23:04 N95JPL

Updated, works more efficiently/reliably now!

N95JPL avatar May 09 '20 18:05 N95JPL