Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated BLEDevice.rssi by AdvertisementData.rssi #114

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions TheengsGateway/ble_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,7 @@ async def ble_scan_loop(self):

def detection_callback(self, device, advertisement_data):
"""Detect device in received advertisement data."""
logger.debug(
"%s RSSI:%d %s", device.address, device.rssi, advertisement_data
)
logger.debug("%s:%s", device.address, advertisement_data)

# Try to add the device to dictionary of clocks to synchronize time.
self.add_clock(device.address)
Expand Down Expand Up @@ -319,7 +317,7 @@ def detection_callback(self, device, advertisement_data):

if data_json:
data_json["id"] = device.address
data_json["rssi"] = device.rssi
data_json["rssi"] = advertisement_data.rssi
decoded_json = decodeBLE(json.dumps(data_json))

if decoded_json:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
setup_requires=setup_requires,
include_package_data=True,
install_requires=[
"bleak>=0.15.0",
"bleak>=0.19.0",
"bluetooth-clocks<1.0",
"bluetooth-numbers>=1.0,<2.0",
"paho-mqtt>=1.6.1",
Expand Down