From 5c6eef5b9c4457b9e63cfc835284ce633747cfbc Mon Sep 17 00:00:00 2001 From: technyon Date: Sun, 2 Apr 2023 10:06:13 +0200 Subject: [PATCH] fix bool values in auto discovery --- Network.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Network.cpp b/Network.cpp index 70a3a8d..35f32e4 100644 --- a/Network.cpp +++ b/Network.cpp @@ -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);