mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
mqtt and newdev name regex
This commit is contained in:
@@ -473,7 +473,10 @@ def mqtt_start(db):
|
|||||||
"model": devDisplayName,
|
"model": devDisplayName,
|
||||||
"last_connection": prepTimeStamp(str(device["devLastConnection"])),
|
"last_connection": prepTimeStamp(str(device["devLastConnection"])),
|
||||||
"first_connection": prepTimeStamp(str(device["devFirstConnection"])),
|
"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
|
# bulk update device sensors in home assistant
|
||||||
|
|||||||
@@ -398,7 +398,8 @@
|
|||||||
"XC5sYW4=",
|
"XC5sYW4=",
|
||||||
"XC5ob21l",
|
"XC5ob21l",
|
||||||
"LVthLWZBLUYwLTldezMyfQ==",
|
"LVthLWZBLUYwLTldezMyfQ==",
|
||||||
"Iy4q"
|
"Iy4q",
|
||||||
|
"XC5cYg=="
|
||||||
],
|
],
|
||||||
"options": [],
|
"options": [],
|
||||||
"localized": [
|
"localized": [
|
||||||
|
|||||||
@@ -624,7 +624,7 @@ def cleanDeviceName(str, match_IP):
|
|||||||
str = re.sub(rgx, "", str)
|
str = re.sub(rgx, "", str)
|
||||||
mylog('trace', ["[cleanDeviceName] name after regex : " + 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 = 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
|
str = str.replace(". (IP match)", " (IP match)") # Remove dot if (IP match) is added
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user