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())
#peripheral battery not updated when get by BLE GATT
1 messages · Page 1 of 1 (latest)
Can you tell us a bit more what you're having issues with?
The battery charge of the peripheral half is not updated when I check it using winsdk in python, if it comes out of deep sleep. When connecting the keyboard to ZMKSplit https://github.com/Maksim-Isakau/zmk-split-battery The charge of the peripheral half is updated as well as updated when the peripheral half is turned off/on