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

Added support for write_ack on the hug itself



git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2658 b32b6428-25c9-4566-ad07-03861ab6144f
parent 950c87e4
No related branches found
No related tags found
No related merge requests found
......@@ -365,8 +365,10 @@ class Gateway(AqaraDev):
logger.warning("Unknow device %s" % pload)
if cmd == 'write_ack':
# some gateway report states after a write write_ack
logger.debug(pkt)
data = json.loads(pload.get('data','{}'))
self.report(data)
#========================================================================
## RGB Leds
......@@ -453,9 +455,12 @@ class Gateway(AqaraDev):
def on_report(self,data):
rgb = data.get('rgb',None)
if rgb:
if rgb != None:
rgb = int(rgb)
if rgb != 0:
if rgb == 0 :
self.devices[0].attributes['light'] = False
else:
self.devices[0].attributes['light'] = True
self.rgb = rgb
val = data.get('illumination',None)
if val:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment