Actor Action added

This commit is contained in:
Manuel83
2017-07-12 15:18:14 +02:00
parent fd5ac5ce77
commit 929db1df81
3 changed files with 54 additions and 45 deletions
+7
View File
@@ -60,6 +60,13 @@ class ActorView(BaseView):
t = self.api.socketio.start_background_task(target=self.toggleTimeJob, id=id, t=t)
return ('', 204)
@route('<int:id>/action/<method>', methods=["POST"])
def action(self, id, method):
cbpi.cache.get("actors").get(id).instance.__getattribute__(method)()
return ('', 204)
@cbpi.initalizer(order=1000)
def init(cbpi):
ActorView.register(cbpi.app, route_base='/api/actor')