Skip to content

Commit

Permalink
▶ First/Last session sent in MQTT #697
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Jun 7, 2024
1 parent 1e3cea0 commit ebe41ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion front/plugins/_publisher_mqtt/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ def mqtt_start(db):
create_sensor(mqtt_client, deviceId, deviceNameDisplay, 'sensor', 'mac_address', 'folder-key-network', device["dev_MAC"])
create_sensor(mqtt_client, deviceId, deviceNameDisplay, 'sensor', 'is_new', 'bell-alert-outline', device["dev_MAC"])
create_sensor(mqtt_client, deviceId, deviceNameDisplay, 'sensor', 'vendor', 'cog', device["dev_MAC"])
create_sensor(mqtt_client, deviceId, deviceNameDisplay, 'sensor', 'first_connection', 'calendar-start', device["dev_MAC"])
create_sensor(mqtt_client, deviceId, deviceNameDisplay, 'sensor', 'last_connection', 'calendar-end', device["dev_MAC"])

# update device sensors in home assistant

Expand All @@ -337,7 +339,9 @@ def mqtt_start(db):
"last_ip": device["dev_LastIP"],
"is_new": str(device["dev_NewDevice"]),
"vendor": sanitize_string(device["dev_Vendor"]),
"mac_address": str(device["dev_MAC"])
"mac_address": str(device["dev_MAC"]),
"last_connection": str(device["dev_LastConnection"]),
"first_connection": str(device["dev_FirstConnection"])
}
)

Expand Down

0 comments on commit ebe41ab

Please sign in to comment.