fix bool values in auto discovery

This commit is contained in:
technyon
2023-04-02 10:06:13 +02:00
parent cddf7c5000
commit 5c6eef5b9c

View File

@@ -1049,9 +1049,20 @@ void Network::publishHassTopic(const String& mqttDeviceType,
} }
for(const auto& entry : additionalEntries) for(const auto& entry : additionalEntries)
{
if(strcmp(entry.second, "true") == 0)
{
json[entry.first] = true;
}
else if(strcmp(entry.second, "false") == 0)
{
json[entry.first] = false;
}
else
{ {
json[entry.first] = entry.second; json[entry.first] = entry.second;
} }
}
serializeJson(json, _buffer, _bufferSize); serializeJson(json, _buffer, _bufferSize);