We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 085a5d0 commit e3d64f3Copy full SHA for e3d64f3
main.py
@@ -7,6 +7,7 @@
7
import json
8
9
import bluetooth._bluetooth as bluez
10
+from beacon import Beacon
11
12
dev_id = 0
13
try:
@@ -24,9 +25,9 @@
24
25
returnedList = blescan.parse_events(sock, 10)
26
allbs = {}
27
for beac in returnedList:
- uuid = beac['uuid']
28
- if not uuid.startswith('0613ff4c'):
29
- allbs[uuid] = beac
+ beacon = Beacon(uuid=beac["uuid"], mac=beac["mac"], major=beac["major"],
+ minor=beac["minor"], txpower=beac["txp"], rssi=beac["rssi"])
30
+ allbs[beacon.uuid] = beacon
31
- with open('./beacons.json', 'w') as of:
32
- json.dump(allbs, of)
+ print allbs["aeae72f5af6749aeac60f27b5b6fa92f"]
33
+ print allbs["aeae72f5af6749aeac60f27b5b6fa92f"].getDistance()
0 commit comments