Commit Graph

13 Commits

Author SHA1 Message Date
Thomas Farstrike a4e167d0e6 Fix OSUpdate 2026-02-11 23:20:23 +01:00
Thomas Farstrike f96500cec8 OSUpdate app: replace "force update" checkbox with improved button labels 2026-01-27 21:33:02 +01:00
Thomas Farstrike c2ae169638 Rename PackageManager to AppManager 2026-01-25 00:19:38 +01:00
Thomas Farstrike 30b3764710 Harmonize frameworks
All frameworks now follow the same singleton class pattern with class methods:

AudioFlinger (already had this pattern)
DownloadManager (refactored)
ConnectivityManager (refactored)
CameraManager (refactored)
SensorManager (refactored)
Pattern Structure:

class FrameworkName:
    _initialized = False
    _instance_data = {}

    @classmethod
    def init(cls, *args, **kwargs):
        """Initialize the framework"""
        cls._initialized = True
        # initialization logic

    @classmethod
    def is_available(cls):
        """Check if framework is available"""
        return cls._initialized

    @classmethod
    def method_name(cls, *args):
        """Framework methods as class methods"""
        # implementation

2. Standardized Imports in __init__.py
All frameworks are now imported consistently as classes:

from .content.package_manager import PackageManager
from .config import SharedPreferences
from .net.connectivity_manager import ConnectivityManager
from .net.wifi_service import WifiService
from .audio.audioflinger import AudioFlinger
from .net.download_manager import DownloadManager
from .task_manager import TaskManager
from .camera_manager import CameraManager
from .sensor_manager import SensorManager
3. Updated Board Initialization Files
Fixed imports in all board files to use the new class-based pattern:

linux.py
fri3d_2024.py
fri3d_2026.py
waveshare_esp32_s3_touch_lcd_2.py
4. Updated UI Components
Fixed topmenu.py to import SensorManager as a class instead of a module.

5. Benefits of This Harmonization
 Consistency: All frameworks follow the same pattern - no more mixing of module imports and class imports  Simplicity: Single, clear way to use frameworks - always as classes with class methods  Functionality: All frameworks work identically - init(), is_available(), and other methods are consistent  Maintainability: New developers see one pattern to follow across all frameworks  No Breaking Changes: Apps continue to work without modification (Quasi apps, Lightning Piggy, etc.)

6. Testing
All tests pass successfully, confirming:

Framework initialization works correctly
Board hardware detection functions properly
UI components render without errors
No regressions in existing functionality
The harmonization is complete and production-ready. All frameworks now provide a unified, predictable interface that's easy to understand and extend.
2026-01-23 15:31:47 +01:00
Thomas Farstrike 84be8f699f Fix failing test 2025-12-24 14:53:22 +01:00
Thomas Farstrike 4b9a147deb OSUpdate app: eliminate thread by using TaskManager and DownloadManager 2025-12-17 14:40:30 +01:00
Thomas Farstrike 61379985e9 OSUpdate app: resume when wifi reconnects 2025-11-24 18:20:06 +01:00
Thomas Farstrike ce8b36e3a8 OSUpdate: pause when wifi goes away, then redownload 2025-11-24 18:03:02 +01:00
Thomas Farstrike 76095048fc Fix tests/test_osupdate.py 2025-11-22 11:28:01 +01:00
Thomas Farstrike 8ed59476c6 Simplify OSUpdate by using ConnectivityManager 2025-11-18 12:20:01 +01:00
Thomas Farstrike aa1b358fac Add unit tests 2025-11-18 12:04:00 +01:00
Thomas Farstrike 28d41e3a92 Prevent tests from running twice 2025-11-16 01:57:04 +01:00
Thomas Farstrike 6f86f57a70 OSUpdate app: Major rework with improved reliability and user experience 2025-11-15 09:19:19 +01:00