Skip to content

Commit

Permalink
invert min_rssi check (#5150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorre05 authored and jesserockz committed Aug 1, 2023
1 parent dec044a commit c63cdae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion esphome/components/ble_presence/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _validate(config):
cv.Optional(CONF_IBEACON_MINOR): cv.uint16_t,
cv.Optional(CONF_IBEACON_UUID): cv.uuid,
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)
),
}
)
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/ble_presence/ble_presence_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BLEPresenceDevice : public binary_sensor::BinarySensorInitiallyOff,
this->found_ = false;
}
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;
}
switch (this->match_by_) {
Expand Down

0 comments on commit c63cdae

Please sign in to comment.