mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-01 04:54:29 +02:00
added run_script service #30
This commit is contained in:
parent
46f7c582ab
commit
4e66101038
4 changed files with 23 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue