invert min_rssi check (#5150)

This commit is contained in:
Joris S 2023-07-31 00:30:21 +02:00 committed by Jesse Hills
parent dec044ad8b
commit c63cdae84f
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A
2 changed files with 2 additions and 2 deletions

View file

@ -39,7 +39,7 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_IBEACON_MINOR): cv.uint16_t, cv.Optional(CONF_IBEACON_MINOR): cv.uint16_t,
cv.Optional(CONF_IBEACON_UUID): cv.uuid, cv.Optional(CONF_IBEACON_UUID): cv.uuid,
cv.Optional(CONF_MIN_RSSI): cv.All( cv.Optional(CONF_MIN_RSSI): cv.All(
cv.decibel, cv.int_range(min=-90, max=-30) cv.decibel, cv.int_range(min=-100, max=-30)
), ),
} }
) )

View file

@ -51,7 +51,7 @@ class BLEPresenceDevice : public binary_sensor::BinarySensorInitiallyOff,
this->found_ = false; this->found_ = false;
} }
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override { bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override {
if (this->check_minimum_rssi_ && this->minimum_rssi_ <= device.get_rssi()) { if (this->check_minimum_rssi_ && this->minimum_rssi_ > device.get_rssi()) {
return false; return false;
} }
switch (this->match_by_) { switch (this->match_by_) {