Skip to content

Commit

Permalink
Only check K firmware version
Browse files Browse the repository at this point in the history
Makes no sense to error out on the X fw version
  • Loading branch information
pelrun committed Feb 6, 2024
1 parent 396d184 commit ce3288d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gpdconfig/wincontrols/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,16 @@ def _parseResponse(self, response):
info = struct.unpack_from("<8xBBBBB11xII", response)
return {
'ready': info[0],
'firmware': f"X{info[1]:x}{info[2]:02x}K{info[3]:x}{info[4]:02x}",
'Xfirmware': f"X{info[1]:x}{info[2]:02x}",
'Kfirmware': f"K{info[3]:x}{info[4]:02x}",
'checksum': info[5]
}

def _checkDevice(self):
supported = ['X510K504', 'X408K407']
supported = ['K504', 'K407']
info = self._parseResponse(self._response)
if info['firmware'] not in supported:
raise RuntimeError(f"Unsupported firmware version: {info['firmware']}")
if info['Kfirmware'] not in supported:
raise RuntimeError(f"Unsupported firmware version: {info['Xfirmware']}{info['Kfirmware']}")

def _waitReady(self, id):
self._response = None
Expand Down

0 comments on commit ce3288d

Please sign in to comment.