Added version to system json

This commit is contained in:
Gunnar Skjold 2022-08-23 19:49:19 +02:00
parent 4e451c51e1
commit a6f3bc3f71
3 changed files with 7 additions and 3 deletions

View File

@ -203,7 +203,8 @@ bool HomeAssistantMqttHandler::publishSystem(HwTools* hw) {
(uint32_t) (millis64()/1000),
hw->getVcc(),
hw->getWifiRssi(),
hw->getTemperature()
hw->getTemperature(),
VERSION
);
mqtt->publish(topic + "/state", json);
}

View File

@ -1,4 +1,5 @@
#include "JsonMqttHandler.h"
#include "version.h"
#include "hexutils.h"
#include "Uptime.h"
#include "web/root/json1_json.h"
@ -280,7 +281,8 @@ bool JsonMqttHandler::publishSystem(HwTools* hw) {
(uint32_t) (millis64()/1000),
hw->getVcc(),
hw->getWifiRssi(),
hw->getTemperature()
hw->getTemperature(),
VERSION
);
init = mqtt->publish(topic, json);
return init;

View File

@ -4,5 +4,6 @@
"up" : %d,
"vcc" : %.3f,
"rssi": %d,
"temp": %.2f
"temp": %.2f,
"version": "%s"
}