mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Merge branch 'dev' into dev2
This commit is contained in:
@@ -632,7 +632,7 @@ void System::send_info_mqtt() {
|
||||
}
|
||||
|
||||
// create the json for heartbeat
|
||||
bool System::heartbeat_json(JsonObject output) {
|
||||
void System::heartbeat_json(JsonObject output) {
|
||||
uint8_t bus_status = EMSESP::bus_status();
|
||||
if (bus_status == EMSESP::BUS_STATUS_TX_ERRORS) {
|
||||
output["bus_status"] = "txerror";
|
||||
@@ -684,8 +684,6 @@ bool System::heartbeat_json(JsonObject output) {
|
||||
output["wifistrength"] = wifi_quality(rssi);
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// send periodic MQTT message with system information
|
||||
@@ -700,9 +698,8 @@ void System::send_heartbeat() {
|
||||
JsonDocument doc;
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
|
||||
if (heartbeat_json(json)) {
|
||||
Mqtt::queue_publish(F_(heartbeat), json); // send to MQTT with retain off. This will add to MQTT queue.
|
||||
}
|
||||
heartbeat_json(json);
|
||||
Mqtt::queue_publish(F_(heartbeat), json); // send to MQTT with retain off. This will add to MQTT queue.
|
||||
}
|
||||
|
||||
// initializes network
|
||||
@@ -1471,7 +1468,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject output
|
||||
#if defined(EMSESP_TEST)
|
||||
// run a test, e.g. http://ems-esp/api?device=system&cmd=test&data=boiler
|
||||
bool System::command_test(const char * value, const int8_t id) {
|
||||
return Test::run_test(value, id);
|
||||
return Test::test(value, id);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user