From 4c1e92af3404080f40f349f5531f779ebaaa0fa3 Mon Sep 17 00:00:00 2001 From: steadramon <866195+steadramon@users.noreply.github.com> Date: Sat, 24 Feb 2024 11:45:33 +0000 Subject: [PATCH] Use gcounter functions --- ESPGeiger/src/Mqtt/MQTT_Client.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ESPGeiger/src/Mqtt/MQTT_Client.cpp b/ESPGeiger/src/Mqtt/MQTT_Client.cpp index 784657b..ad241d0 100644 --- a/ESPGeiger/src/Mqtt/MQTT_Client.cpp +++ b/ESPGeiger/src/Mqtt/MQTT_Client.cpp @@ -114,17 +114,17 @@ void MQTT_Client::loop() publish(buildTopic(teleTopic, topicStatus).c_str(), buffer, false); - publish(buildTopic(statTopic, PSTR("CPM")).c_str(), String(status.geigerTicks.get()*60.0).c_str(), false); + publish(buildTopic(statTopic, PSTR("CPM")).c_str(), String(gcounter.get_cpmf()).c_str(), false); publish(buildTopic(statTopic, PSTR("uSv")).c_str(), String(gcounter.get_usv()).c_str(), false); #ifndef DISABLE_MQTT_CPS - publish(buildTopic(statTopic, PSTR("CPS")).c_str(), String(status.geigerTicks.get()).c_str(), false); + publish(buildTopic(statTopic, PSTR("CPS")).c_str(), String(gcounter.get_cps()).c_str(), false); #endif - publish(buildTopic(statTopic, PSTR("CPM5")).c_str(), String(status.geigerTicks5.get()*60.0).c_str(), false); + publish(buildTopic(statTopic, PSTR("CPM5")).c_str(), String(gcounter.get_cpm5f()).c_str(), false); - publish(buildTopic(statTopic, PSTR("CPM15")).c_str(), String(status.geigerTicks15.get()*60.0).c_str(), false); + publish(buildTopic(statTopic, PSTR("CPM15")).c_str(), String(gcounter.get_cpm15f()).c_str(), false); #ifdef ESPGEIGER_HW publish(buildTopic(statTopic, PSTR("HV")).c_str(), String(status.hvReading.get()).c_str(), false);