Hi everyone, I’m currently stuck during plugin development and can’t find any more information. My plugin needs to listen to play/pause/stop signals from the volumio service.
While the Wiki and the docs on Github list a number of events on the Websocket API section, I get the feeling that events like play/pause/stop can only be emitted by the client to be caught by the server and not vice versa. Is this correct? Which efficient way is there to listen to play/pause/stop events, rather than wastefully polling the status in short intervals?
My MWE:
1.
var io = require('socket.io-client');
var socket = io.connect('http://localhost:3000');
socket.emit('play')
var io = require('socket.io-client');
var socket = io.connect('http://localhost:3000');
socket.on('play',function () {console.log('FOO');})
Executing (1) makes volumio play music, but executing (2) and the starting music in volumio will do nothing.