kopia lustrzana https://github.com/micropython/micropython-lib
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
rodzic
2b0d7610ce
commit
191494ede7
|
@ -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)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue