mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-01-06 05:48:17 -05:00
mqtt and newdev name regex
This commit is contained in:
@@ -473,7 +473,10 @@ def mqtt_start(db):
|
||||
"model": devDisplayName,
|
||||
"last_connection": prepTimeStamp(str(device["devLastConnection"])),
|
||||
"first_connection": prepTimeStamp(str(device["devFirstConnection"])),
|
||||
"sync_node": device["devSyncHubNode"]
|
||||
"sync_node": device["devSyncHubNode"],
|
||||
"group": device["devGroup"],
|
||||
"location": device["devLocation"],
|
||||
"parent_mac": device["devParentMAC"]
|
||||
}
|
||||
|
||||
# bulk update device sensors in home assistant
|
||||
|
||||
@@ -398,7 +398,8 @@
|
||||
"XC5sYW4=",
|
||||
"XC5ob21l",
|
||||
"LVthLWZBLUYwLTldezMyfQ==",
|
||||
"Iy4q"
|
||||
"Iy4q",
|
||||
"XC5cYg=="
|
||||
],
|
||||
"options": [],
|
||||
"localized": [
|
||||
|
||||
@@ -624,7 +624,7 @@ def cleanDeviceName(str, match_IP):
|
||||
str = re.sub(rgx, "", str)
|
||||
mylog('trace', ["[cleanDeviceName] name after regex : " + str])
|
||||
|
||||
str = re.sub(r'\.\b', '', str) # trailing dot after words
|
||||
# str = re.sub(r'\.\b', '', str) # trailing dot after words
|
||||
str = re.sub(r'\.$', '', str) # trailing dot at the end of the string
|
||||
str = str.replace(". (IP match)", " (IP match)") # Remove dot if (IP match) is added
|
||||
|
||||
|
||||
Reference in New Issue
Block a user