1 Commits
Author SHA1 Message Date
AurumandKremeCN 30d6d39597 feat: add socket control and temperature humidity modules (#7)
## Summary
- **Smart Socket Module**:
  - Implemented `SocketUiState` and `SocketViewModel` with support for querying power state, toggle control, duplicate click debouncing, and state confirmation timestamping.
  - Implemented Material 3 responsive `SocketScreen` with power indicator badge, toggle action, explicit on/off buttons, offline banner, and error handling.
- **Temperature & Humidity Module**:
  - Implemented `TemperatureHumidityUiState` and `TemperatureHumidityViewModel` for read-only environmental telemetry.
  - Implemented `TemperatureHumidityScreen` featuring distinct temperature and humidity cards, read-only notice, no-data placeholder, and pull-to-refresh actions.
- **Common & Infrastructure**:
  - Added `UiText` and `DomainErrorMapper` for localizing domain errors (`DomainError`).
  - Added navigation graph extensions (`deviceDetailGraph`) in `DeviceDetailNavigation.kt` and wired into `ABoxManagerApp.kt`.
  - Added `ReleaseModule` for Hilt dependency injection in release builds.
  - Added full English and Simplified Chinese resource translations in `values/strings.xml` and `values-zh-rCN/strings.xml`.
- **Testing**:
  - Added `SocketViewModelTest` and `TemperatureHumidityViewModelTest` covering normal operations, offline states, error mapping, and refresh scenarios.

## Test Plan
- [x] Run `./gradlew test` (all modules passed)
- [x] Run `./gradlew :android:app:testDebugUnitTest` (passed)
- [x] Run `./gradlew assembleDebug` (build successful)

?? Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: KremeCN <3265494849@qq.com>
Reviewed-on: #7
Co-authored-by: Aurum <aurum_197@outlook.com>
2026-08-25 15:41:34 +08:00