added run_script service #30

This commit is contained in:
tomaae 2020-04-20 11:05:49 +02:00
parent 46f7c582ab
commit 4e66101038
4 changed files with 23 additions and 1 deletions

View file

@ -193,6 +193,10 @@ class MikrotikControllerData:
# ---------------------------
def run_script(self, name):
"""Run script using Mikrotik API"""
if type(name) != str:
if CONF_NAME in name.data:
name = name.data.get(CONF_NAME)
try:
self.api.run_script(name)
except ApiEntryNotFound as error: