pierr3 / TrackAudio

A next generation Audio-For-VATSIM ATC Client for macOS, Linux and Windows
Other
36 stars 8 forks source link

Add websocket message for enabling/disabling station tx/rx/xc #52

Closed neilenns closed 2 months ago

neilenns commented 4 months ago

I'd like to be able to POST to an endpoint to enable/disable TX/RX for a station.

The use case is to create a StreamDeck button that will call the endpoint when pressed to enable/disable secondary stations that I listen to on the side but may want to turn off when they get busy. Something like POST /station with a JSON body like this:

{
   "pCallsign": "SEA_GND",
   "tx": false, // or true to enable or undefined to leave as-is
   "rx": false, // or true to enable or undefined to leave as-is
   "xc": false // or true to enable or undefined to leave as-is
}
neilenns commented 4 months ago

Thinking about this a bit more, for my use case, I'd need a way to toggle the state of Rx without knowing the current state of the frequency. Maybe that could just be a POST request like this /Rx/toggle/SEA_GND or similar, and it could return a JSON blob with the resulting state of the station ?

pierr3 commented 4 months ago

So the HTTP endpoint is deprecated, everything should go through WebSocket now, so we can add something like this in the web socket protocol if you prefer.

neilenns commented 4 months ago

I updated the title to say websocket 😀

bostjanlaba commented 4 months ago

I like this idea aswell! +1