mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Merge pull request #820 from NightMean/main
Some checks are pending
docker / docker_dev (push) Waiting to run
Some checks are pending
docker / docker_dev (push) Waiting to run
Update MQTT to send model as device name - thanks to @NightMean 🙏
This commit is contained in:
@@ -92,7 +92,8 @@ class sensor_config:
|
|||||||
self.sensorType = sensorType
|
self.sensorType = sensorType
|
||||||
self.sensorName = sensorName
|
self.sensorName = sensorName
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
self.mac = mac
|
self.mac = mac
|
||||||
|
self.model = deviceName
|
||||||
self.state_topic = ''
|
self.state_topic = ''
|
||||||
self.json_attr_topic = ''
|
self.json_attr_topic = ''
|
||||||
self.topic = ''
|
self.topic = ''
|
||||||
@@ -142,7 +143,8 @@ class sensor_config:
|
|||||||
"device":
|
"device":
|
||||||
{
|
{
|
||||||
"identifiers" : [self.deviceId+"_sensor", self.unique_id],
|
"identifiers" : [self.deviceId+"_sensor", self.unique_id],
|
||||||
"manufacturer" : "NetAlertX",
|
"manufacturer" : "NetAlertX",
|
||||||
|
"model": self.model if self.model else "Unknown",
|
||||||
"name" : self.deviceName
|
"name" : self.deviceName
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -430,6 +432,7 @@ def mqtt_start(db):
|
|||||||
"is_new": str(device["dev_NewDevice"]),
|
"is_new": str(device["dev_NewDevice"]),
|
||||||
"vendor": sanitize_string(device["dev_Vendor"]),
|
"vendor": sanitize_string(device["dev_Vendor"]),
|
||||||
"mac_address": str(device["dev_MAC"]),
|
"mac_address": str(device["dev_MAC"]),
|
||||||
|
"model": devDisplayName,
|
||||||
"last_connection": str(device["dev_LastConnection"]),
|
"last_connection": str(device["dev_LastConnection"]),
|
||||||
"first_connection": str(device["dev_FirstConnection"])
|
"first_connection": str(device["dev_FirstConnection"])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user