2015-12-06, 19:14
Its probably the second one. xx returns AM or PM so it was planned. System.time is probably returning AM/PM and breaking the logic. I'll do some tests at home
(2015-12-31, 16:19)Swifty Wrote: Is it possible to have the addon work like a normal tv sleep timer? - ie. press a button and pop a notification saying sleeping in x minutes, press again and it increases, finally going back to zero after a couple of presses?
I'd like this functionality but would like to make use of the additions in this addon such as soft mute and running a command before sleeping (i need to tell my harmony hub that the activity is now off - otherwise it gets all confused as it still thinks the TV is on )
(2016-01-17, 21:53)Swifty Wrote: Thanks for your reply, I figured it probably wouldn't work that way, but wanted to check
My idea is have a service addon will always be running with Kodi, then have a remote button mapped to run a particular function within that addon (lets call it 'Arm_SleepTimer')
Each time the function was called (by pressing the remote button) the 'Arm_SleepTimer' function would run and step one iteration through the following timer values (as an example); 10m, 20m, 30m, 60m, 90m, 0m (disable)
Then when the timer runs out it would fire the event to soft mute Kodi, stop playback and then execute a custom command (in my case a wget/curl which tells my Harmony hub to sleep the Kodi box and turn off the TV/AVR)
I've got the basics up and running in an addon, but I don't have much experience in making them or Python, so I'm stuck on two bits;
- Persisting the current 'timer' setting in a variable in the addon, so that the next time the remote button is pressed I know what the last timer value was, so I can step to the correct value. I don't want to use a file to hold this, incase of early (manual) shutdown/sleep as it would then be out of step with reality
- Mapping a button press in Kodi to a particular function within a service addon... I literally have no idea how to do that
(2016-02-06, 19:46)Atreyu Wrote: The feature you are discussing is one that exists with most dvr's and tv's, even older ones.
I really like the current sleeptimer service, but would certainly welcome the 'revival' of the good ol' sleeptimer function!
(2016-02-27, 13:58)robwebset Wrote:Exactly whati was looking for indeed.(2016-02-06, 19:46)Atreyu Wrote: The feature you are discussing is one that exists with most dvr's and tv's, even older ones.
I really like the current sleeptimer service, but would certainly welcome the 'revival' of the good ol' sleeptimer function!
I did a search to "prod" threads where users had made a request for a "TV Like Sleep Timer" so that people are aware that I've just released one (So they get notified if they are subscribed to the thread)
I have been unsure if I should post on this thread as it's for a "Sleep Timer" - however my timer does not actually do what this addon does, so I'm hoping that no-one minds (If there are any objections, then I'm willing to delete this post).
Anyway, Atreyu, I think the Sleep Addon that I've done may do what you are looking for:
http://forum.kodi.tv/showthread.php?tid=261959
NOTE: Please do not post to this thread about the "Sleep" Addon - I don't want to pollute Sleep Timer's thread! (Use the thread in the link above)
Thanks
Rob