Exemple #1
0
 def toggle():
     if request.method in ('PUT',"POST"):
         return redirect(url_for('light'), code=302)
     else:
         return helpers.toggle()
Exemple #2
0
 def lights():
     if request.method in ('PUT', 'POST'):
         helpers.toggle()
     else:
         return light.status() + "\n"