Skip to content

Commit

Permalink
Replace deprecated BLEDevice.rssi by AdvertisementData.rssi (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
koenvervloesem authored Apr 5, 2023
1 parent 801718a commit 61f0ed6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/python/ScanAndDecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from TheengsDecoder import getProperties, getAttribute

def detection_callback(device, advertisement_data):
print(device.address, "RSSI:", device.rssi, advertisement_data)
print(f"{device.address}:{advertisement_data}")
data_json = {}

if advertisement_data.service_data:
Expand All @@ -26,7 +26,7 @@ def detection_callback(device, advertisement_data):

if data_json:
data_json["id"] = device.address
data_json["rssi"] = device.rssi
data_json["rssi"] = advertisement_data.rssi
print("data sent to decoder: ", json.dumps(data_json))
data_json = dble(json.dumps(data_json))
print("TheengsDecoder found device:", data_json)
Expand Down

0 comments on commit 61f0ed6

Please sign in to comment.