fix bool values in auto discovery
This commit is contained in:
11
Network.cpp
11
Network.cpp
@@ -1049,9 +1049,20 @@ void Network::publishHassTopic(const String& mqttDeviceType,
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
serializeJson(json, _buffer, _bufferSize);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user