Commits

clach04 committed 292e32e Draft

refactor, move init code with main loop.

Comments (0)

Files changed (1)

         d.clear_lines(TextLines.ALL, bg)
         return d
 
-    d = PluggableLCDSysInfo(connect_and_reset)
-    ignore_missing_sensors = conf.get('temperature.ignore_missing_sensors', True)
-    debug_temps = conf.get('temperature.debug_temps', False)
-    sensors = TemperatureSensors(
-                ignore_missing_sensors=ignore_missing_sensors,
-                temp_cpu_location=conf.get('temperature.temp_cpu'),
-                temp_mb_location=conf.get('temperature.temp_mb'),
-                debug_temps=debug_temps,
-            )
-
     def display_datetime_icon():
         """Quick and dirty icon text painter.
         NOTE requires large icons to be pre-loaded."""
         (5 * 60, display_hdspace),  # call every 5 mins - NOTE on disconnect, reconnect this leaves disk space blank for (up to) 5 mins
         (10, display_temps),  # call every 10 secs
     ]
-    
+
+    d = PluggableLCDSysInfo(connect_and_reset)
+    ignore_missing_sensors = conf.get('temperature.ignore_missing_sensors', True)
+    debug_temps = conf.get('temperature.debug_temps', False)
+    sensors = TemperatureSensors(
+                ignore_missing_sensors=ignore_missing_sensors,
+                temp_cpu_location=conf.get('temperature.temp_cpu'),
+                temp_mb_location=conf.get('temperature.temp_mb'),
+                debug_temps=debug_temps,
+            )
+
     # paint screen once
     for dummy, func in events:
         func()