import sys sys.path.append("") from micropython import const import uasyncio as asyncio import aioble import bluetooth import random import struct # org.bluetooth.service.environmental_sensing _ENV_SENSE_UUID = bluetooth.UUID(0x181A) # org.bluetooth.characteristic.temperature _ENV_SENSE_TEMP_UUID = bluetooth.UUID(0x2A6E) # Helper to decode the temperature characteristic encoding (sint16, hundredths of a degree). def _decode_temperature(data): return struct.unpack("