From ddca73b0438c58e1f2367e8e0fc78c7b9924009b Mon Sep 17 00:00:00 2001 From: PeterJT Date: Tue, 13 Sep 2022 01:42:45 -0400 Subject: [PATCH] Updates to the Kobo driver to add support for the Kobo Clara 2e. --- src/calibre/devices/kobo/driver.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index aa9d633f06..6182b9e714 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -10,6 +10,7 @@ Driver for Kobo eReaders. Supports all e-ink devices. Originally developed by Timothy Legge . Extended to support Touch firmware 2.0.0 and later and newer devices by David Forrester +Additional maintenance performed by Peter Thomas ''' import os, time, shutil, re @@ -1380,7 +1381,7 @@ class KOBOTOUCH(KOBO): 'Communicate with the Kobo Touch, Glo, Mini, Aura HD,' ' Aura H2O, Glo HD, Touch 2, Aura ONE, Aura Edition 2,' ' Aura H2O Edition 2, Clara HD, Forma, Libra H2O, Elipsa,' - ' Sage and Libra 2 eReaders.' + ' Sage ,Libra 2 and Clara 2E eReaders.' ' Based on the existing Kobo driver by %s.') % KOBO.author # icon = 'devices/kobotouch.jpg' @@ -1419,6 +1420,7 @@ class KOBOTOUCH(KOBO): min_elipsa_fwversion = (4, 28, 17820) min_libra2_fwversion = (4, 29, 18730) min_sage_fwversion = (4, 29, 18730) + min_clara2e_fwversion = (4, 33, 19759) min_fwversion_audiobooks = (4, 29, 18730) min_fwversion_bookstats = (4, 32, 19501) @@ -1447,6 +1449,7 @@ class KOBOTOUCH(KOBO): AURA_H2O_EDITION2_PRODUCT_ID = [0x4227] AURA_ONE_PRODUCT_ID = [0x4225] CLARA_HD_PRODUCT_ID = [0x4228] + CLARA_2E_PRODUCT_ID = [0x4235] ELIPSA_PRODUCT_ID = [0x4233] FORMA_PRODUCT_ID = [0x4229] GLO_PRODUCT_ID = [0x4173] @@ -1464,7 +1467,7 @@ class KOBOTOUCH(KOBO): MINI_PRODUCT_ID + TOUCH_PRODUCT_ID + TOUCH2_PRODUCT_ID + \ AURA_ONE_PRODUCT_ID + CLARA_HD_PRODUCT_ID + FORMA_PRODUCT_ID + LIBRA_H2O_PRODUCT_ID + \ NIA_PRODUCT_ID + ELIPSA_PRODUCT_ID + \ - SAGE_PRODUCT_ID + LIBRA2_PRODUCT_ID + SAGE_PRODUCT_ID + LIBRA2_PRODUCT_ID + CLARA_2E_PRODUCT_ID BCD = [0x0110, 0x0326, 0x401, 0x409] @@ -1506,7 +1509,7 @@ class KOBOTOUCH(KOBO): # Kobo officially advertised the screen resolution with those chopped off. ' - N3_FULL.parsed': [(758,1014),0, 200,True,], } - # Glo HD and Clara HD share resolution, so the image sizes should be the same. + # Glo HD, Clara HD and Clara 2E share resolution, so the image sizes should be the same. GLO_HD_COVER_FILE_ENDINGS = { # Used for screensaver, home screen ' - N3_FULL.parsed': [(1072,1448), 0, 200,True,], @@ -3555,6 +3558,9 @@ class KOBOTOUCH(KOBO): def isClaraHD(self): return self.detected_device.idProduct in self.CLARA_HD_PRODUCT_ID + def isClara2E(self): + return self.detected_device.idProduct in self.CLARA_2E_PRODUCT_ID + def isElipsa(self): return self.detected_device.idProduct in self.ELIPSA_PRODUCT_ID @@ -3603,6 +3609,8 @@ class KOBOTOUCH(KOBO): _cover_file_endings = self.AURA_ONE_COVER_FILE_ENDINGS elif self.isClaraHD(): _cover_file_endings = self.GLO_HD_COVER_FILE_ENDINGS + elif self.isClara2E(): + _cover_file_endings = self.GLO_HD_COVER_FILE_ENDINGS elif self.isElipsa(): _cover_file_endings = self.AURA_ONE_COVER_FILE_ENDINGS elif self.isForma(): @@ -3649,6 +3657,8 @@ class KOBOTOUCH(KOBO): device_name = 'Kobo Aura ONE' elif self.isClaraHD(): device_name = 'Kobo Clara HD' + elif self.isClara2E(): + device_name = 'Kobo Clara 2E' elif self.isElipsa(): device_name = 'Kobo Elipsa' elif self.isForma():