Skip to content

Commit 191494e

Browse files
moresdpgeorge
authored andcommitted
aioble/examples/temp_sensor.py: Properly notify on update.
This ensures that the peripheral notifies subscribed clients when the characteristic is written to. Signed-off-by: Stephen More <stephen.more@gmail.com>
1 parent 2b0d761 commit 191494e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

micropython/bluetooth/aioble/examples/temp_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _encode_temperature(temp_deg_c):
4040
async def sensor_task():
4141
t = 24.5
4242
while True:
43-
temp_characteristic.write(_encode_temperature(t))
43+
temp_characteristic.write(_encode_temperature(t), send_update=True)
4444
t += random.uniform(-0.5, 0.5)
4545
await asyncio.sleep_ms(1000)
4646

0 commit comments

Comments
 (0)