wacom: use .format instead of hex to generate the timestring
hex() skips leading zeroes, so 180123 turns into 18, 12, 3
This commit is contained in:
parent
790f2337dc
commit
7aa4314c3d
|
@ -368,7 +368,7 @@ class WacomDevice(GObject.Object):
|
||||||
expected_opcode=0xcf)
|
expected_opcode=0xcf)
|
||||||
# logger.debug(f'cc returned {data} ')
|
# logger.debug(f'cc returned {data} ')
|
||||||
count = int.from_bytes(data[0:4], byteorder='little')
|
count = int.from_bytes(data[0:4], byteorder='little')
|
||||||
str_timestamp = ''.join([hex(d)[2:] for d in data[4:]])
|
str_timestamp = ''.join(['{:02x}'.format(d) for d in data[4:]])
|
||||||
timestamp = time.strptime(str_timestamp, "%y%m%d%H%M%S")
|
timestamp = time.strptime(str_timestamp, "%y%m%d%H%M%S")
|
||||||
return count, timestamp
|
return count, timestamp
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ class WacomDevice(GObject.Object):
|
||||||
data = self.wait_nordic_data(0xcd, 5)
|
data = self.wait_nordic_data(0xcd, 5)
|
||||||
# logger.debug(f'cc returned {data} ')
|
# logger.debug(f'cc returned {data} ')
|
||||||
|
|
||||||
str_timestamp = ''.join([hex(d)[2:] for d in data])
|
str_timestamp = ''.join(['{:02x}'.format(d) for d in data])
|
||||||
timestamp = time.strptime(str_timestamp, "%y%m%d%H%M%S")
|
timestamp = time.strptime(str_timestamp, "%y%m%d%H%M%S")
|
||||||
return count, timestamp
|
return count, timestamp
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue