Hi,
I’m testing the battery threshold functions so have two python scripts where I find the current voltage and then set the threshold above/below that so I can ‘pretend’ a battery going flat. Example of setting the threshold to above the current battery voltage:
import zymkey
import time
battLevel = zymkey.client.get_batt_volt()
print(f'Current battery level: {battLevel}v')
threshold = battLevel - 0.2
zymkey.client.set_battery_voltage_threshold(threshold)
print(f'Set threshold to: {threshold}')
However, this fails producing the following output:
Current battery level: 3.064746141433716v Traceback (most recent call last): File "./zk_set_batt_above_threshold.py", line 12, in <module> zymkey.client.set_battery_voltage_threshold(threshold) File "/usr/local/lib/python3.8/dist-packages/zymkey/__init__.py", line 1807, in set_battery_voltage_threshold raise AssertionError("bad return code %d" % ret) AssertionError: bad return code -110
Thanks
Haydon