mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-01 13:04:28 +02:00
added docstrings to all functions and classes
This commit is contained in:
parent
d1f8a7f56b
commit
b2c268a1c0
3 changed files with 33 additions and 17 deletions
|
@ -76,6 +76,7 @@ class MikrotikAPI:
|
|||
# error_to_strings
|
||||
# ---------------------------
|
||||
def error_to_strings(self, error):
|
||||
"""Translate error output to error string."""
|
||||
self.error = "cannot_connect"
|
||||
if error == "invalid user name or password (6)":
|
||||
self.error = "wrong_login"
|
||||
|
@ -121,6 +122,7 @@ class MikrotikAPI:
|
|||
# update
|
||||
# ---------------------------
|
||||
def update(self, path, param, value, mod_param, mod_value):
|
||||
"""Modify a parameter"""
|
||||
response = self.path(path)
|
||||
if response is None:
|
||||
return False
|
||||
|
@ -145,6 +147,7 @@ class MikrotikAPI:
|
|||
# run_script
|
||||
# ---------------------------
|
||||
def run_script(self, name):
|
||||
"""Run script"""
|
||||
response = self.path('/system/script')
|
||||
if response is None:
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue