Action Button for Sensors added

This commit is contained in:
Manuel83
2017-07-05 21:16:40 +02:00
parent 62f31e2dd4
commit 3af76d0a1e
3 changed files with 42 additions and 28 deletions
+5
View File
@@ -12,6 +12,11 @@ class SensorView(BaseView):
model = Sensor
cache_key = "sensors"
@route('<int:id>/action/<method>', methods=["POST"])
def action(self, id, method):
cbpi.cache.get("sensors").get(id).instance.__getattribute__(method)()
return ('', 204)
def _post_post_callback(self, m):
cbpi.init_sensor(m.id)