fix: initialize MQTT power meter values to zero

avoid using uninitialized memory.
This commit is contained in:
Bernhard Kirchen 2024-07-22 17:18:15 +02:00 committed by Bernhard Kirchen
parent 415c767d1d
commit 5e5a5253f4

View File

@ -8,6 +8,7 @@
bool PowerMeterMqtt::init()
{
auto subscribe = [this](PowerMeterMqttValue const& val, float* targetVariable) {
*targetVariable = 0;
char const* topic = val.Topic;
if (strlen(topic) == 0) { return; }
MqttSettings.subscribe(topic, 0,