From 398407350c5242dfbe38cf9a59b5c04727e94883 Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Fri, 10 Apr 2020 08:52:56 +0200 Subject: [PATCH] Fixed typ-o in MQTT topic for temperature and moved voltage bootup check into compiler option SELF_POWERED --- src/AmsToMqttBridge.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AmsToMqttBridge.ino b/src/AmsToMqttBridge.ino index 6b2835dc..b43cc7e2 100644 --- a/src/AmsToMqttBridge.ino +++ b/src/AmsToMqttBridge.ino @@ -86,6 +86,7 @@ void setup() { debugI("Voltage: %.2fV", vcc); } +#if SELF_POWERED if (vcc > 2.5 && vcc < 3.25) { // Only sleep if voltage is realistic and too low if(Debug.isActive(RemoteDebug::INFO)) { debugI("Votltage is too low, sleeping"); @@ -93,6 +94,7 @@ void setup() { } ESP.deepSleep(10000000); //Deep sleep to allow output cap to charge up } +#endif #if HAS_RGB_LED // Initialize RGB LED pins @@ -705,7 +707,7 @@ void sendSystemStatusToMqtt() { } mqtt.publish(config.getMqttPublishTopic() + "/rssi", String(hw.getWifiRssi())); if(temperature != DEVICE_DISCONNECTED_C) { - mqtt.publish(config.getMqttPublishTopic() + "/vcc", String(temperature, 2)); + mqtt.publish(config.getMqttPublishTopic() + "/temperature", String(temperature, 2)); } }