OnScreensaverActivated triggered during musicplayback
#1
Hello,
since my AV consumes a woping 120 watts idle, i hacked a plugin to switch it off when the screensaver activates via OnScreensaverActivated.

unfortunately when playing music, after the screensaver timeout, that function is called even though xbmc is still active.
It probably does make sense, since xbmc assumes it's just dimming, but for my case it means the AV switches off :/

Can i reconfigure this somehow?
Reply
#2
the easiest way would be to adjust your plugin i guess.

you could check if xbmc is playing audio and only switch of the AV if it returns False
Code:
xbmc.getCondVisibility('Player.HasAudio')
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
(2013-02-07, 00:30)ronie Wrote: you could check if xbmc is playing audio and only switch of the AV if it returns False
Code:
xbmc.getCondVisibility('Player.HasAudio')


smart idea, but then i don't get notified if the music stopped and i can actually switch it off.
Reply
#4
that shouldn't be too difficult to overcome.

you could try something like this for instance:
Code:
def onScreensaverActivated( self ):
    self.screensaver_active = True
    while xbmc.getCondVisibility('Player.HasAudio') and self.screensaver_active:
        xbmc.sleep(5000)
    if self.screensaver_active:
        self.shutdown_AV()

def onScreensaverDeactivated( self ):
    self.screensaver_active = False
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
Hi aeep, would you mind to share your screensaver code? I don't care if it isn't pretty, I just need a starting point Smile.

I would like to accomplish something similar: I want to have my TV turned off when the screensaver turns on even if there is music playing(XBMC doesn't do that at the moment).

Thanks in advance!
Reply

Logout Mark Read Team Forum Stats Members Help
OnScreensaverActivated triggered during musicplayback0