data-repository-impl¶
Concrete implementation of the repository interfaces defined in domain-repository-api. This module orchestrates various data sources (Database, Preferences, Platform, MQTT) to provide a unified data access layer for the domain.
Features¶
- Source Orchestration: Combines data from Room databases, DataStore preferences, and Android system APIs.
- Data Mapping: Uses bidirectional mappers to convert between Data Layer Resources (DTOs) and Domain Layer Models.
- Reactive Streams: Provides
Flow-based implementations for real-time data observation across the application.
Implementation Details¶
The repositories in this module are implemented as singletons and bound to their respective interfaces using Koin annotations.
Key Repositories¶
ApplicationRepositoryImpl: Manages applications by coordinatingApplicationDatabaseSource(loading persisted selection) andApplicationPlatformSource(getting system-installed apps).ConfigureRepositoryImpl: Manages all user settings by interacting with multiplePreferenceSourceimplementations.@since 1.4.0it also exposesgetCameraSource()/setCameraSource()/observeCameraSource(), orchestratingCameraPreferenceSourcewith the newCameraPreferenceMapper(falls back toCameraSourceModel.Autofor unknown/empty stored modes).MqttRepositoryImpl: Handles MQTT connectivity and telemetry reporting. Forwards the devicemodel("tv"/"tablet") fromconnect(...)to the telemetry source for form-factor-aware Home Assistant registration.
Screen State¶
ScreenStateResourceMapper bidirectionally maps ScreenStateResource and ScreenStateModel, including the DarkOverlay state (@since 1.2.0) — a plain dark overlay used as a stand-in for powering the screen off on devices such as Android TV where the panel cannot be turned off.