Example #1
0
 def GET(self, id):
     return response.send_if_found(model.get_property(id, 'fan_mode'))
Example #2
0
 def GET(self, id):
     return response.send_if_found(model.get_property(id, 'current_temp'))
Example #3
0
 def GET(self, id):
     return response.send_if_found(model.get_property(id, 'heat_setpoint'))
Example #4
0
 def GET(self, id):
     return response.send_if_found(model.get(id))
Example #5
0
 def PUT(self, id):
     new_name = web.data()
     return response.send_if_found(model.update(id, {'name': new_name}))
Example #6
0
 def GET(self, id):
     return response.send_if_found(model.get_property(id, "fan_mode"))
Example #7
0
def set_range_value(id, prop, value, allowed_values):
    if lib.value_in_range(value, allowed_values):
        return response.send_if_found(model.update(id, {prop: value}))
    else:
        return response.generic_failure('Cannot update: invalid value.', 400)
Example #8
0
 def GET(self, id):
     return response.send_if_found(model.get_property(id, "heat_setpoint"))
Example #9
0
 def GET(self, id):
     return response.send_if_found(model.get_property(id, "current_temp"))
Example #10
0
 def PUT(self, id):
     new_name = web.data()
     return response.send_if_found(model.update(id, {"name": new_name}))
Example #11
0
 def GET(self, id):
     return response.send_if_found(model.get(id))
Example #12
0
def set_range_value(id, prop, value, allowed_values):
    if lib.value_in_range(value, allowed_values):
        return response.send_if_found(model.update(id, {prop: value}))
    else:
        return response.generic_failure("Cannot update: invalid value.", 400)