UM Battery: fix compilation error + bad snprintf
This commit is contained in:
parent
983aca515d
commit
4a09e18d9a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user