Websocket API : sleep

I discovered how to use the API and I’m really happy to be able to start developing my project. :slight_smile: However when I set sleep mode with the API the rpi shutdown when the timer ends ! The sleep feature is working fine with the webUI.

Here is an example :

[code]volumio@volumio:~$ python
Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

from socketIO_client import SocketIO, LoggingNamespace
socketIO = SocketIO(‘localhost’, 3000)
socketIO.emit(‘setSleep’, {“enabled”:“true”, “time”:“00:02”})
[/code]
I’ve my doubts about the documentation for this feature, but I think I’m using it correctly.
Can you help me please?

I’ve a RPI 2 B and I’m using Volumio 2.041 (I made the update from Volumio 2.001 for this bug but it doesn’t change a thing)

I updated my post but the bug is still here!
Check this screenshot I noticed the timer is correct but the On/Off isn’t.
17-02-02 at 18.46.JPG

I looked into the code (github.com/volumio/Volumio2/blo … k/index.js) and found the problem : I need to add a parameter for the action so the correct call is :

socketIO.emit('setSleep', {"enabled":"true", "time":"00:05", "action":"stop"})

And btw the UI bug is still here

Thank you for your “auto response” !!!