#peripheral battery not updated when get by BLE GATT

1 messages · Page 1 of 1 (latest)

spiral lion
#

def process_battery_level(characteristic, battery_level):
    device_type = "Unknown device"
    if characteristic.attribute_handle == MAIN_DEVICE_HANDLE:
        device_type = "Main device"
        file_path = "C:\\Users\\Luerl\\Documents\\Rainmeter\\Skins\\ZMK\\@Resources\\battery_level_main.txt"
    elif characteristic.attribute_handle == PERIPHERAL_DEVICE_HANDLE:
        device_type = "Peripheral device"
        file_path = "C:\\Users\\Luerl\\Documents\\Rainmeter\\Skins\\ZMK\\@Resources\\battery_level_peripheral.txt"

    with open(file_path, "w") as file:
        file.write(str(battery_level))
    print(f"{device_type} Battery Level: {battery_level}%")

asyncio.run(main())
ionic brook
#

Can you tell us a bit more what you're having issues with?

spiral lion