Skip to content

Commit 858d2e8

Browse files
committed
add actions
1 parent 0239a19 commit 858d2e8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

python/shared/actions.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import sys
2+
from core import osgi
3+
4+
actions = osgi.find_services("org.openhab.core.model.script.engine.action.ActionService", None)
5+
6+
_MODULE = sys.modules[__name__]
7+
8+
for action in actions:
9+
action_class = action.actionClass
10+
name = str(action_class.simpleName)
11+
setattr(_MODULE, name, action_class)
12+
13+
from org.openhab.core.model.script.actions import Exec
14+
from org.openhab.core.model.script.actions import HTTP
15+
from org.openhab.core.model.script.actions import Ping
16+
from org.openhab.core.model.script.actions import ScriptExecution
17+
from org.openhab.core.model.script.actions import Log
18+
19+
STATIC_IMPORTS = [Exec, HTTP, Log, Ping, ScriptExecution]
20+
21+
for action in STATIC_IMPORTS:
22+
name = str(action.simpleName)
23+
setattr(_MODULE, name, action)

0 commit comments

Comments
 (0)