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>
pull/835/head
Stephen More 2024-03-25 08:49:00 -04:00 zatwierdzone przez Damien George
rodzic 2b0d7610ce
commit 191494ede7
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -40,7 +40,7 @@ def _encode_temperature(temp_deg_c):
async def sensor_task():
t = 24.5
while True:
temp_characteristic.write(_encode_temperature(t))
temp_characteristic.write(_encode_temperature(t), send_update=True)
t += random.uniform(-0.5, 0.5)
await asyncio.sleep_ms(1000)