mirror of
https://github.com/Manuel83/craftbeerpi3
synced 2026-08-09 18:52:40 +02:00
Actor Action added
This commit is contained in:
@@ -60,6 +60,13 @@ class ActorView(BaseView):
|
|||||||
t = self.api.socketio.start_background_task(target=self.toggleTimeJob, id=id, t=t)
|
t = self.api.socketio.start_background_task(target=self.toggleTimeJob, id=id, t=t)
|
||||||
return ('', 204)
|
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)
|
@cbpi.initalizer(order=1000)
|
||||||
def init(cbpi):
|
def init(cbpi):
|
||||||
ActorView.register(cbpi.app, route_base='/api/actor')
|
ActorView.register(cbpi.app, route_base='/api/actor')
|
||||||
|
|||||||
@@ -166,7 +166,9 @@ def update_addon(name):
|
|||||||
|
|
||||||
def loadCorePlugins():
|
def loadCorePlugins():
|
||||||
for filename in os.listdir("./modules/base_plugins"):
|
for filename in os.listdir("./modules/base_plugins"):
|
||||||
if filename.endswith(".py") or filename.endswith(".pyc"):
|
|
||||||
|
|
||||||
|
if os.path.isdir("./modules/base_plugins/"+filename) is False:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
modules[filename] = import_module("modules.base_plugins.%s" % (filename))
|
modules[filename] = import_module("modules.base_plugins.%s" % (filename))
|
||||||
@@ -178,7 +180,7 @@ def loadCorePlugins():
|
|||||||
|
|
||||||
def loadPlugins():
|
def loadPlugins():
|
||||||
for filename in os.listdir("./modules/plugins"):
|
for filename in os.listdir("./modules/plugins"):
|
||||||
if filename.endswith(".py") or filename.endswith(".pyc"):
|
if os.path.isdir("./modules/plugins/" + filename) is False:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
modules[filename] = import_module("modules.plugins.%s" % (filename))
|
modules[filename] = import_module("modules.plugins.%s" % (filename))
|
||||||
|
|||||||
+43
-43
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user