X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/2e874fa14264bf37f17ae9b9375e26059e7f35ec..17d12fc3339d68b023ab6f388a3576af2bcb4949:/lib/python/Components/Converter/Poll.py diff --git a/lib/python/Components/Converter/Poll.py b/lib/python/Components/Converter/Poll.py index 3ba5e87f..6db93ef5 100644 --- a/lib/python/Components/Converter/Poll.py +++ b/lib/python/Components/Converter/Poll.py @@ -3,7 +3,7 @@ from enigma import eTimer class Poll(object): def __init__(self): self.__poll_timer = eTimer() - self.__poll_timer.timeout.get().append(self.changed) + self.__poll_timer.callback.append(self.poll) self.__interval = 1000 self.__enabled = False @@ -20,3 +20,14 @@ class Poll(object): poll_interval = property(lambda self: self.__interval, __setInterval) poll_enabled = property(lambda self: self.__enabled, __setEnable) + + def poll(self): + self.changed((self.CHANGED_POLL,)) + + def doSuspend(self, suspended): + self.enabled = not suspended + if not suspended: + self.poll() + + def destroy(self): + self.__poll_timer.callback.remove(self.poll)