示例#1
0
文件: server.py 项目: jhpaul/power-pi
 def toggle():
     if request.method in ('PUT',"POST"):
         return redirect(url_for('light'), code=302)
     else:
         return helpers.toggle()
示例#2
0
文件: server.py 项目: jhpaul/power-pi
 def lights():
     if request.method in ('PUT', 'POST'):
         helpers.toggle()
     else:
         return light.status() + "\n"