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

Method _seed_counts_from_db

shared.py:1197–1215  ·  view source on GitHub ↗

Populate target/port counters from the active network's SQLite store.

(self)

Source from the content-addressed store, hash-verified

1195 self.save_config()
1196 logger.info(f"EPD {epd_type} initialized via fallback with size: {self.width}x{self.height}")
1197 return
1198 except Exception as e2:
1199 logger.error(f"Fallback auto-detection also failed: {e2}")
1200 logger.warning("Continuing without EPD display support")
1201 self.epd_helper = None
1202 fallback_profile = DISPLAY_PROFILES.get(DEFAULT_EPD_TYPE, {"ref_width": 122, "ref_height": 250, "default_flip": False})
1203 epd_type = self.config.get('epd_type') or DEFAULT_EPD_TYPE
1204 profile = DISPLAY_PROFILES.get(epd_type, fallback_profile) or fallback_profile
1205 self.width = self.config.get('ref_width', profile['ref_width'])
1206 self.height = self.config.get('ref_height', profile['ref_height'])
1207 self.screen_reversed = normalize_rotation(self.config.get('screen_reversed', 0))
1208 self.web_screen_reversed = 0
1209
1210 # NOTE: Test image code below was used to verify EPD hardware.
1211 # Commented out to allow normal Ragnar display to show.
1212 # Uncomment if you need to test the display again.
1213 # from PIL import ImageDraw
1214 # test_image = Image.new('1', (self.width, self.height), 255)
1215 # draw = ImageDraw.Draw(test_image)
1216 # draw.text((10, 10), "EPD Test", fill=0)
1217 # if self.config.get("reversed", False):
1218 # test_image = test_image.rotate(180)

Callers 1

initialize_variablesMethod · 0.95

Calls 5

get_dbFunction · 0.90
get_count_snapshotMethod · 0.80
debugMethod · 0.80
infoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected