How resistanceto/miniwatts works
MiniWatts is an on-device iPhone charging and battery monitor. Its main workflow samples private power and thermal sensors, builds a live power snapshot, and presents charger-to-cell power, heat, adapter, and cable details. PowerMonitor also tracks charge sessions and persists their history. The app exposes readings through its screens, a floating Picture-in-Picture meter, widgets, a charging Live Activity, and Shortcuts. The graph follows documented capabilities and sampled ownership; some unsampled subsystem wiring is intentionally left out.
Main entry points: PowerMonitor.swift Power monitor · SensorProbe.swift Sensor probe · RootView.swift Root coordinator · FloatingMeterController.swift Floating meter
Components 34
Sensor acquisition
- Sensor probe
MiniWatts/Core/Sensors/SensorProbe.swift - Sensor catalog
MiniWatts/Core/Sensors/SensorCatalog.swift - HID sensors
MiniWatts/Core/Sensors/HIDSensors.swift - Accessory probe
MiniWatts/Core/Sensors/AccessoryProbe.swift - Battery Center bridge
MiniWatts/Core/Sensors/BatteryCenterBridge.swift - IOKit battery
MiniWatts/Core/Sensors/IOKitBattery.swift - Thermal monitor
MiniWatts/Core/Sensors/ThermalMonitor.swift
Monitoring and history
- Power monitor
MiniWatts/Core/PowerMonitor.swift - Power snapshot
MiniWatts/Core/Model/PowerSnapshot.swift - Energy accumulator
MiniWatts/Core/Model/EnergyAccumulator.swift - Path resistance
MiniWatts/Core/Model/PathResistance.swift - Session model and store
MiniWatts/Core/Model/ChargeSession.swift
App experience
- App entry
MiniWatts/MiniWattsApp.swift - Root coordinator
MiniWatts/Features/RootView.swift - Power dashboard
MiniWatts/Features/Dashboard/DashboardView.swift - Adapter analysis
MiniWatts/Features/Adapter/AdapterView.swift - Thermal view
MiniWatts/Features/Thermal/ThermalView.swift - Device inventory
MiniWatts/Features/Devices/DevicesView.swift - Session history
MiniWatts/Features/Sessions/SessionsView.swift - Settings and debug
MiniWatts/Features/Debug/SettingsView.swift
Glance surfaces
- Floating meter
MiniWatts/Floating/FloatingMeterController.swift - Floating telemetry
MiniWatts/Floating/FloatingMeterTelemetry.swift - Widget publisher
MiniWatts/Widgets/WidgetPublisher.swift - Shared charge reading
MiniWatts/Shared/ChargeReading.swift - Battery widget
Widget/BatteryWidget.swift - Widget reading probe
Widget/ReadingProbe.swift - Live Activity controller
MiniWatts/Widgets/ChargeActivityController.swift - Live Activity surface
Widget/ChargeLiveActivity.swift - Get reading intent
MiniWatts/Shortcuts/GetReadingIntent.swift
Other components
- iPhone user
- iOS sensor APIs
- WidgetKit
- ActivityKit
- Picture in Picture
Connections 36
- iPhone user → App entry: opens
- App entry → Root coordinator: shows
- Root coordinator → Power monitor: starts and ticks
- Power monitor → Sensor probe: reads sensors
- Power monitor → Thermal monitor: updates
- Sensor probe → Sensor catalog: consults
- Sensor probe → HID sensors: reads
- Sensor probe → Accessory probe: probes
- Sensor probe → Battery Center bridge: queries
- Sensor probe → IOKit battery: reads
- Sensor probe → iOS sensor APIs: accesses
- Sensor probe → Power snapshot: produces
- Power monitor → Power snapshot: publishes
- Power monitor → Energy accumulator: accumulates
- Power monitor → Path resistance: fits resistance
- Power monitor → Session model and store: records and loads
- Power dashboard → Power monitor: reads
- Adapter analysis → Power monitor: reads
- Thermal view → Power monitor: reads
- Device inventory → Power monitor: requests inventory
- Session history → Power monitor: reads history
- Settings and debug → Power monitor: configures
- Settings and debug → Floating meter: starts or stops
- Root coordinator → Live Activity controller: syncs readings
- Live Activity controller → ActivityKit: updates activity
- Live Activity surface → ActivityKit: renders activity
- Root coordinator → Widget publisher: publishes readings
- Widget publisher → Shared charge reading: creates
- Widget publisher → WidgetKit: reloads timelines
- Battery widget → Widget reading probe: requests reading
- Widget reading probe → iOS sensor APIs: reads sensors
- Battery widget → WidgetKit: provides timeline
- Get reading intent → Power monitor: requests fresh read
- Root coordinator → Floating meter: renders snapshots
- Floating meter → Floating telemetry: creates telemetry
- Floating meter → Picture in Picture: starts Picture in Picture