wacom: fetch the battery state during register
Any decent UI will want to know this given the device is online right now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
f488d4e130
commit
05fd213940
|
@ -939,6 +939,12 @@ class WacomProtocolSlate(WacomProtocolSpark):
|
||||||
fw_high = self.get_firmware_version(0)
|
fw_high = self.get_firmware_version(0)
|
||||||
fw_low = self.get_firmware_version(1)
|
fw_low = self.get_firmware_version(1)
|
||||||
logger.info(f'firmware is {fw_high}-{fw_low}')
|
logger.info(f'firmware is {fw_high}-{fw_low}')
|
||||||
|
battery, charging = self.get_battery_info()
|
||||||
|
if charging:
|
||||||
|
logger.debug(f'device is plugged in and charged at {battery}%')
|
||||||
|
else:
|
||||||
|
logger.debug(f'device is discharging: {battery}%')
|
||||||
|
self.emit('battery-status', battery, charging)
|
||||||
|
|
||||||
def retrieve_data(self):
|
def retrieve_data(self):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue