🔌UNIFI work
Some checks are pending
docker / docker_dev (push) Waiting to run

This commit is contained in:
jokob-sk
2024-08-05 11:56:42 +10:00
parent 7203c335e4
commit 239ebd40b9
2 changed files with 11 additions and 2 deletions

View File

@@ -49,6 +49,15 @@ def handleEmpty(input):
input = re.sub(r'[^\x00-\x7F]+', ' ', input)
input = input.replace('\n', '') # Removing new lines
return input
# -------------------------------------------------------------------
# Sanitizes string
def rmBadChars(input):
input = handleEmpty(input)
input = input.replace("'", '_') # Removing ' (single quotes)
return input
# -------------------------------------------------------------------
# Check if a valid MAC address

View File

@@ -19,7 +19,7 @@ from pyunifi.controller import Controller
INSTALL_PATH="/app"
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
from plugin_helper import Plugin_Object, Plugin_Objects
from plugin_helper import Plugin_Object, Plugin_Objects, rmBadChars
from logger import mylog
from helper import timeNowTZ, get_setting_value
import conf
@@ -200,7 +200,7 @@ def get_unifi_val(obj, key, default='null'):
def get_name(*names: str) -> str:
for name in names:
if name and name != 'null':
return name
return rmBadChars(name)
return 'null'
# -----------------------------------------------------------------------------