Skip to content

Commit

Permalink
Merge pull request #820 from NightMean/main
Browse files Browse the repository at this point in the history
Update MQTT to send model as device name - thanks to @NightMean 🙏
  • Loading branch information
jokob-sk authored Oct 1, 2024
2 parents 97a5cb6 + c6fe09d commit dd948b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions front/plugins/_publisher_mqtt/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def __init__(self, deviceId, deviceName, sensorType, sensorName, icon, mac):
self.sensorType = sensorType
self.sensorName = sensorName
self.icon = icon
self.mac = mac
self.mac = mac
self.model = deviceName
self.state_topic = ''
self.json_attr_topic = ''
self.topic = ''
Expand Down Expand Up @@ -142,7 +143,8 @@ def __init__(self, deviceId, deviceName, sensorType, sensorName, icon, mac):
"device":
{
"identifiers" : [self.deviceId+"_sensor", self.unique_id],
"manufacturer" : "NetAlertX",
"manufacturer" : "NetAlertX",
"model": self.model if self.model else "Unknown",
"name" : self.deviceName
},
}
Expand Down Expand Up @@ -430,6 +432,7 @@ def mqtt_start(db):
"is_new": str(device["dev_NewDevice"]),
"vendor": sanitize_string(device["dev_Vendor"]),
"mac_address": str(device["dev_MAC"]),
"model": devDisplayName,
"last_connection": str(device["dev_LastConnection"]),
"first_connection": str(device["dev_FirstConnection"])
}
Expand Down

0 comments on commit dd948b5

Please sign in to comment.