Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
d021d7c29d | |||
ae7e408b4e | |||
7b3b746a1b | |||
37989e25ae | |||
922dbf98b9 | |||
34089f1add | |||
4c710f7a0a | |||
b766c0ce04 | |||
32fe442cce |
@@ -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));
|
||||
if (isnormal(dist)) (*doc)["distance"] = serialized(std::to_string(dist));
|
||||
if (isnormal(vari)) (*doc)["var"] = serialized(std::to_string(vari));
|
||||
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));
|
||||
if (humidity) (*doc)["rh"] = serialized(std::to_string(humidity));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@ async def to_code(config):
|
||||
cg.add(var.set_room(config[CONF_ROOM_KEY]))
|
||||
# cg.add(var.set_base_topic(config[CONF_BASE_TOPIC_KEY]))
|
||||
# cg.add(var.set_addresses(config[CONF_MAC_KEY]))
|
||||
# cg.add(var.set_max_distance(config[CONF_MAX_DISTANCE]))
|
||||
cg.add(var.set_max_distance(config[CONF_MAX_DISTANCE]))
|
||||
|
||||
add_idf_sdkconfig_option("CONFIG_BT_ENABLED", True)
|
||||
add_idf_sdkconfig_option("CONFIG_BT_BLUEDROID_ENABLED", False)
|
||||
|
@@ -78,6 +78,7 @@ namespace esphome
|
||||
{
|
||||
BleFingerprintCollection::Setup();
|
||||
xTaskCreatePinnedToCore(scanTask, "scanTask", SCAN_TASK_STACK_SIZE, nullptr, 1, &scanTaskHandle, CONFIG_BT_NIMBLE_PINNED_TO_CORE);
|
||||
publishDevices = true;
|
||||
}
|
||||
|
||||
void ESP32Presense::loop()
|
||||
@@ -113,8 +114,9 @@ namespace esphome
|
||||
}
|
||||
|
||||
if (f->hasReport()) {
|
||||
if (reportBuffer(f))
|
||||
if (reportBuffer(f)) {
|
||||
f->clearReport();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user