Commit Graph

149 Commits

Author SHA1 Message Date
Thomas Farstrike 180fd0e667 Fix unit tests 2026-02-13 19:10:06 +01:00
Thomas Farstrike a4e167d0e6 Fix OSUpdate 2026-02-11 23:20:23 +01:00
Thomas Farstrike 0632246f50 Simplify 2026-02-10 23:49:28 +01:00
Thomas Farstrike f567e06a39 Fix tests 2026-02-10 23:44:35 +01:00
Thomas Farstrike c30db3ebcf Fix tests/test_graphical_osupdate.py 2026-01-27 22:31:28 +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 a50e3722c9 DownloadManager: don't share aiohttp.ClientSession
It seems to cause SSL/TLS session corruption on ESP32.

There is a performance impact, so maybe it should be reintroduced again later,
but for now, let's keep it simple and fix this bug.
2026-01-27 13:41:15 +01:00
Thomas Farstrike 62d3c9c7d1 Fix unit test 2026-01-27 12:50:24 +01:00
Thomas Farstrike 01db1aa59c Fix unit test 2026-01-26 21:17:11 +01:00
Thomas Farstrike 6a22281ad6 Fix unit test 2026-01-26 19:08:53 +01:00
Thomas Farstrike 94d29d8202 Add test_audiomanager.py 2026-01-26 14:50:44 +01:00
Thomas Farstrike 52972b4beb Replace binary logging with source copy 2026-01-26 14:50:18 +01:00
Thomas Farstrike 1f9eee3a9d Rename AudioFlinger to AudioManager framework 2026-01-26 13:13:54 +01:00
Thomas Farstrike f72b300b53 Fix unit test 2026-01-26 11:11:35 +01:00
Thomas Farstrike d7e49d04dc Add new BatteryManager framework 2026-01-25 23:22:53 +01:00
Thomas Farstrike c2ae169638 Rename PackageManager to AppManager 2026-01-25 00:19:38 +01:00
Thomas Farstrike 31dcfba683 Move mpos.apps functionality to PackageManager 2026-01-25 00:08:01 +01:00
Thomas Farstrike f772fc4b80 Add DeviceInfo and VersionInfo frameworks 2026-01-24 23:32:10 +01:00
Thomas Farstrike 43eb8220c8 Move mpos.apps.good_stack_size() to TaskManager.good_stack_size()
Trying to get every app-facing API as part of an object.
2026-01-24 19:10:51 +01:00
Thomas Farstrike 2f31d14a4e Remove old theme.py 2026-01-23 23:08:58 +01:00
Thomas Farstrike 68b6ff3886 Cleanup WidgetAnimator framework 2026-01-23 21:37:53 +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 7296a4111e Convert npub 2026-01-21 20:57:26 +01:00
Thomas Farstrike 7fd86daeda Increment version 2026-01-16 17:06:41 +01:00
Thomas Farstrike 08d12ba0d7 Fix test_audioflinger.py 2026-01-14 19:35:41 +01:00