mirror of
https://github.com/vale981/rmview
synced 2025-03-04 08:41:39 -05:00
Fix device version detection (fixes #43)
This commit is contained in:
parent
001950e945
commit
2d1808d781
1 changed files with 3 additions and 3 deletions
|
@ -226,10 +226,10 @@ class rMViewApp(QApplication):
|
|||
|
||||
_,out,_ = ssh.exec_command("cat /sys/devices/soc0/machine")
|
||||
rmv = out.read().decode("utf-8")
|
||||
version = re.fullmatch(r"reMarkable (\d+)\..*\n", rmv)
|
||||
version = re.fullmatch(r"reMarkable(?: Prototype)? (\d+)(\.\d+)*\n", rmv)
|
||||
if version is None or version[1] not in ["1", "2"]:
|
||||
log.error("Device is unsupported: '%s' [%s]", rmv, version[1] if version else "unknown device")
|
||||
QMessageBox.critical(None, "Unsupported device", 'The detected device is %s.\nrmView currently only supports reMarkable 1.' % rmv)
|
||||
log.error("Device is unsupported: '%s' [%s]", rmv.strip(), version[1] if version else "unknown device")
|
||||
QMessageBox.critical(None, "Unsupported device", "The detected device is '%s'.\nrmView currently only supports reMarkable 1 and 2." % rmv.strip())
|
||||
self.quit()
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue