import chirospython as chp
@chp.app.route('/off')
def off():
chp.save_local_state(0, "state")
led.off()
chp.send_status(0, "state")
return chp.Response(
status=200
)
@chp.app.route('/switch', methods=['POST'])
def switch():
state = 1 - chp.get_saved_state("state")
if state:
led.on()
else:
led.off()
chp.save_local_state(state, "state")
chp.send_status(state, "state")
return chp.Response(
"status: {}".format(data['value']),
status=200
)
chp.launch_app(5006)
-
Notifications
You must be signed in to change notification settings - Fork 0
sebastien-lb/chirospython
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Python and Flask implementation for Chiros objects
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published