Load persistent gamification progress from disk.
(self)
| 1215 | self.apply_display_profile(epd_type_cfg) |
| 1216 | logger.info( |
| 1217 | f"Non-EPD display '{epd_type_cfg}' configured: {self.width}x{self.height}" |
| 1218 | " — skipping EPD buffer init" |
| 1219 | ) |
| 1220 | return |
| 1221 | |
| 1222 | try: |
| 1223 | logger.info("Initializing EPD display...") |
| 1224 | epd_type = self.config.get("epd_type", DEFAULT_EPD_TYPE) |
| 1225 | |
| 1226 | # Auto-detect if set to "auto" OR if still on factory default (user never ran installer with detection) |
| 1227 | needs_detect = epd_type == "auto" |
| 1228 | if not needs_detect: |
| 1229 | # Also auto-detect if the configured driver doesn't exist or can't load |
| 1230 | try: |
| 1231 | EPDHelper(epd_type) |
| 1232 | except Exception: |
| 1233 | logger.warning(f"Configured EPD driver '{epd_type}' failed to load, switching to auto-detect") |
| 1234 | needs_detect = True |
| 1235 | |
| 1236 | if needs_detect: |
| 1237 | logger.info("EPD auto-detection running...") |
| 1238 | result = EPDHelper.auto_detect() |
| 1239 | if result: |
| 1240 | epd_type = result[0] |
| 1241 | logger.info(f"Auto-detected EPD: {epd_type} ({result[1]}x{result[2]})") |
| 1242 | self.config['epd_type'] = epd_type |
| 1243 | self.save_config() |
| 1244 | else: |
| 1245 | logger.warning("Auto-detection found no display, using default") |
| 1246 | epd_type = DEFAULT_EPD_TYPE |
| 1247 | |
| 1248 | self.epd_helper = EPDHelper(epd_type) |
| 1249 | self.apply_display_profile(epd_type) |
| 1250 | self.screen_reversed = normalize_rotation(self.config.get("screen_reversed", 0)) |
no test coverage detected