2014-12-21, 21:18
service.sleeptimer
Description: This service addon makes Kodi stop any playback if it exceeds a given idle time. If you have that awful habit of leaving Kodi playing live content after you fell asleep, this addon is for you! It gives extended control over the playback time. Step mute the audio, enable the screensaver or run a custom command after the playback is stopped.
Usefull information:
-> Sleeptimer checks kodi idle time (xbmc.getGlobalIdleTime()). This idle time is different from the overall playback time so it assumes you're watching content with no interaction with the user interface.
-> The service has a debug mode which will check and stop based on one minute intervals.
-> For any changes/setting to take effect you need to restart kodi
Why you need it
-If you have a family member that never stops the playback, leaving content playing "forever" from network-based locations.
-If you fall asleep leaving kodi playing without any timer and find kodi still playing in the morning.
-To be sure any playback is being stopped on every kodi htpc around the house.
Settings
General tab:
Service check time -> Interval in minutes for kodi to check your idle time and compute the difference between this idle time and the max time allowed for playback/idle.
Waiting time -> Time you have to tell kodi you want to continue watching a given content. (Dialog progress)
Slow mute the audio -> Option to low the volume of the video/audio before playback is stopped (volume will be changed again to default after stop)
Enable screensaver -> Option to enable the screensaver after playback is stopped.
Custom command -> You can define a command to be run after the playback is stopped. The service runs this command using os.system("command").
Audio Video supervision tab:
Apply the service checks for audio and video and define maximum allowed playback/idle time when playing each one of them.
Debug tab:
Overwrite all settings to the minimum interval possible for testing purposes. Again, the service checks for idle time not for total playback time. So, if you have any interaction with kodi (mouse, keyboard) idle time will be 0!
Screenshot
Download:
This service is now on the official repository. Settings -> addons -> get addons -> kodi repository -> services -> Sleep Timer -> install
Source code / Translations
https://github.com/enen92/service.sleeptimer
License
GPL V2
Cheers