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

@@ -1050,7 +1050,18 @@ void Network::publishHassTopic(const String& mqttDeviceType,
for(const auto& entry : additionalEntries)
{
json[entry.first] = entry.second;
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;
}
}
serializeJson(json, _buffer, _bufferSize);