diff --git a/usermods/Battery/usermod_v2_Battery.h b/usermods/Battery/usermod_v2_Battery.h index c46a8791..62b7b82d 100644 --- a/usermods/Battery/usermod_v2_Battery.h +++ b/usermods/Battery/usermod_v2_Battery.h @@ -198,7 +198,7 @@ class UsermodBattery : public Usermod // still don't know much about MQTT and/or HA if (WLED_MQTT_CONNECTED) { char buf[64]; // buffer for snprintf() - snprintf_P(buf, 63, PSTR("/voltage"), mqttDeviceTopic); + snprintf_P(buf, 63, PSTR("/voltage%s"), mqttDeviceTopic); mqtt->publish(buf, 0, false, String(voltage).c_str()); } @@ -393,7 +393,7 @@ class UsermodBattery : public Usermod } #ifdef ARDUINO_ARCH_ESP32 - newBatteryPin = battery[F("pin"] | newBatteryPin; + newBatteryPin = battery[F("pin")] | newBatteryPin; #endif // calculateTimeLeftEnabled = battery[F("time-left")] | calculateTimeLeftEnabled; setMinBatteryVoltage(battery[F("min-Voltage")] | minBatteryVoltage); @@ -727,4 +727,4 @@ const char UsermodBattery::_enabled[] PROGMEM = "enabled"; const char UsermodBattery::_threshold[] PROGMEM = "threshold"; const char UsermodBattery::_preset[] PROGMEM = "preset"; const char UsermodBattery::_duration[] PROGMEM = "duration"; -const char UsermodBattery::_init[] PROGMEM = "init"; \ No newline at end of file +const char UsermodBattery::_init[] PROGMEM = "init";