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

Method load_gamification_data

shared.py:1217–1247  ·  view source on GitHub ↗

Load persistent gamification progress from disk.

(self)

Source from the content-addressed store, hash-verified

1215 profile = DISPLAY_PROFILES.get(epd_type, fallback_profile) or fallback_profile
1216 self.width = self.config.get('ref_width', profile['ref_width'])
1217 self.height = self.config.get('ref_height', profile['ref_height'])
1218 self.screen_reversed = normalize_rotation(self.config.get('screen_reversed', 0))
1219 self.web_screen_reversed = 0
1220
1221 # NOTE: Test image code below was used to verify EPD hardware.
1222 # Commented out to allow normal Ragnar display to show.
1223 # Uncomment if you need to test the display again.
1224 # from PIL import ImageDraw
1225 # test_image = Image.new('1', (self.width, self.height), 255)
1226 # draw = ImageDraw.Draw(test_image)
1227 # draw.text((10, 10), "EPD Test", fill=0)
1228 # if self.config.get("reversed", False):
1229 # test_image = test_image.rotate(180)
1230 # self.epd_helper.epd.display(self.epd_helper.epd.getbuffer(test_image))
1231 # logger.info("Test image displayed on EPD.")
1232
1233 def initialize_variables(self):
1234 """Initialize the variables."""
1235 self.should_exit = False
1236 self.display_should_exit = False
1237 self.orchestrator_should_exit = False
1238 self.webapp_should_exit = False
1239 self.web_portal_active = True # Tracks whether the web portal is currently running
1240 self.ragnar_instance = None
1241 self.gateway_info = {} # Populated by NetworkScanner.get_gateway_info()
1242 self.wifichanged = False
1243 self.bluetooth_active = False
1244 self.bluetooth_scan_active = False
1245 self.bluetooth_scan_start_time = 0.0
1246 self.wifi_connected = False
1247 self.wifi_signal_dbm = None # Latest RSSI value for display
1248 self.wifi_signal_quality = None # Normalized 0-100 quality percentage
1249 self.pan_connected = False
1250 self.usb_active = False

Callers 1

__init__Method · 0.95

Calls 3

warningMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected