Skip to content

Commit 293471f

Browse files
main.py advertise 'not connectable' to be a true broacast beacon
1 parent d0c4011 commit 293471f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

main.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ async def read_sensor():
2828

2929
async def communicate_readings():
3030
print("Constructing advertising payload")
31-
while True:
32-
async with await aioble.advertise(
33-
BLE_ADV_INTERVAL_uS,
34-
adv_data = bthome.pack_advertisement(bthome.TEMPERATURE_SINT16, bthome.HUMIDITY_UINT16)
35-
) as connection:
36-
print("Client connect:", connection.device)
37-
await connection.disconnected(timeout_ms=None)
38-
print("Client disconnect.")
31+
await aioble.advertise(
32+
BLE_ADV_INTERVAL_uS,
33+
adv_data = bthome.pack_advertisement(bthome.TEMPERATURE_SINT16, bthome.HUMIDITY_UINT16),
34+
connectable = False
35+
)
3936

4037

4138
async def main():

0 commit comments

Comments
 (0)