Skip to content
Snippets Groups Projects
Commit 59e04f10 authored by jkerdreu's avatar jkerdreu
Browse files

Fix on/off



git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@2223 b32b6428-25c9-4566-ad07-03861ab6144f
parent 257fe318
Branches
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ class RGBBulb(core.ZDevice):
self.get_value('color').data = '#000000FFFF'
def _blink(self):
self.on()
# turn on, but avoid the timer..
if self._blink_color == 0:
self.red()
self._blink_color = 1
......@@ -52,9 +52,11 @@ class RGBBulb(core.ZDevice):
def blink(self):
eng = self.gw.engine
state = self.devices[0].attributes["light"]
#self.set_value('level',0x63)
self.on()
eng.add_timer(self.white,19,1)
if state == False:
eng.add_timer(self.white,19,0)
eng.add_timer(self.off,20,0)
eng.add_timer(self.off,20,1)
self.gw.engine.add_timer(self._blink,1,15)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment