MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / normalize_mac

Method normalize_mac

shared.py:1274–1296  ·  view source on GitHub ↗

Return a normalized MAC address suitable for persistence.

(self, mac_address: str)

Source from the content-addressed store, hash-verified

1272 if not needs_detect:
1273 # Also auto-detect if the configured driver doesn't exist or can't load
1274 try:
1275 EPDHelper(epd_type)
1276 except Exception:
1277 logger.warning(f"Configured EPD driver '{epd_type}' failed to load, switching to auto-detect")
1278 needs_detect = True
1279
1280 if needs_detect:
1281 logger.info("EPD auto-detection running...")
1282 result = EPDHelper.auto_detect()
1283 if result:
1284 epd_type = result[0]
1285 logger.info(f"Auto-detected EPD: {epd_type} ({result[1]}x{result[2]})")
1286 self.config['epd_type'] = epd_type
1287 self.save_config()
1288 else:
1289 logger.warning("Auto-detection found no display, using default")
1290 epd_type = DEFAULT_EPD_TYPE
1291
1292 self.epd_helper = EPDHelper(epd_type)
1293 self.apply_display_profile(epd_type)
1294 self.screen_reversed = normalize_rotation(self.config.get("screen_reversed", 0))
1295 self.web_screen_reversed = 0
1296 logger.info(f"EPD type: {epd_type} | size: {self.epd_helper.epd.width}x{self.epd_helper.epd.height} | rotation: {self.screen_reversed}°")
1297 self.epd_helper.init_full_update()
1298 self.width, self.height = self.epd_helper.epd.width, self.epd_helper.epd.height
1299

Callers 1

Calls 2

rangeFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected