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

Some testing..


git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2933 b32b6428-25c9-4566-ad07-03861ab6144f
parent 5273512b
Branches
No related tags found
No related merge requests found
import asyncio
from xaal.lib import AsyncEngine,tools
from xaal.schemas import devices
LAMPS=['cdef8707-f268-11e9-84a2-7085c2a4a6bd','41998f5e-b1a6-11ec-b598-d6bd5fe18701']
def run():
eng = AsyncEngine()
dev = devices.hmi(tools.get_random_uuid())
eng.add_device(dev)
eng.start()
async def loop():
lamps = [tools.get_uuid(l) for l in LAMPS]
color = 0
while 1:
eng.send_request(dev,lamps,'set_hsv',{'hsv':(color,1,1)})
color = color + 2
if color > 360:color = 0
await asyncio.sleep(2)
eng.on_start(loop)
eng.run()
try:
run()
except KeyboardInterrupt:
print('Bye')
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment