From 7b3b746a1bd90155155ed3c17375ef69110a7d3e Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Sun, 10 Dec 2023 13:37:46 +0300 Subject: [PATCH] fix --- components/esp32_presense/BleFingerprint.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/esp32_presense/BleFingerprint.cpp b/components/esp32_presense/BleFingerprint.cpp index 0a81034..8364881 100644 --- a/components/esp32_presense/BleFingerprint.cpp +++ b/components/esp32_presense/BleFingerprint.cpp @@ -443,17 +443,17 @@ bool BleFingerprint::fill(JsonObject *doc) { (*doc)["rssi@1m"] = get1mRssi(); (*doc)["rssi"] = rssi; - if (isnormal(raw)) (*doc)["raw"] = serialized(std::string(raw, 2)); - if (isnormal(dist)) (*doc)["distance"] = serialized(std::string(dist, 2)); - if (isnormal(vari)) (*doc)["var"] = serialized(std::string(vari, 2)); + if (isnormal(raw)) (*doc)["raw"] = serialized(std::to_string(raw, 2)); + if (isnormal(dist)) (*doc)["distance"] = serialized(std::to_string(dist, 2)); + if (isnormal(vari)) (*doc)["var"] = serialized(std::to_string(vari, 2)); if (close) (*doc)["close"] = true; (*doc)["int"] = (millis() - firstSeenMillis) / seenCount; if (mv) (*doc)["mV"] = mv; if (battery != 0xFF) (*doc)["batt"] = battery; - if (temp) (*doc)["temp"] = serialized(std::string(temp, 1)); - if (humidity) (*doc)["rh"] = serialized(std::string(humidity, 1)); + if (temp) (*doc)["temp"] = serialized(std::to_string(temp, 1)); + if (humidity) (*doc)["rh"] = serialized(std::to_string(humidity, 1)); return true; }