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

new API

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@2118 b32b6428-25c9-4566-ad07-03861ab6144f
parent bccdb831
Branches
No related tags found
No related merge requests found
from xaal.schemas import devices
from xaal.lib import Engine,helpers
def setup(engine):
dev = devices.lamp()
dev.product_id = 'Dummy Mini Lamp'
dev.dump()
# methods
def on():
dev.attributes['light'] = True
def off():
dev.attributes['light'] = False
dev.methods['on'] = on
dev.methods['off'] = off
engine.add_device(dev)
return True
if __name__ =='__main__':
helpers.run_package('lamp_minimal',setup)
\ 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