2014-05-28, 10:33
Hello,
I've written a service that polls a communication port and runs in a while-loop. A good idea is using the new Monitor() class with the event onSettingsChanged() when the settings of my service has changed. But I'm getting stuck to implement this. I want to call my method 'getAddonProperties() in MyClass instead of deactivate/activate my addon every time the settings has changed. Is there an example outside anyway?
Some code:
I've written a service that polls a communication port and runs in a while-loop. A good idea is using the new Monitor() class with the event onSettingsChanged() when the settings of my service has changed. But I'm getting stuck to implement this. I want to call my method 'getAddonProperties() in MyClass instead of deactivate/activate my addon every time the settings has changed. Is there an example outside anyway?
Some code:
Code:
class MyClass():
def __init__(self):
self.getAddonProperties()
def getAddonProperties(self):
# get settings, this stuff work...
self._LS = __settings__.getLocalizedString
self._server = __settings__.getSetting('server')
# ...
while not xbmc.abortRequested():
# do my service
# ...