Add solar charge controller integration and firmware

App:
- New DeviceRole.solar with its own BLE session/protocol/state
  (SolarSession, VanAlignSolarProtocol, SolarState), mirroring the
  leveling sensor but deliberately not wired into the Live Activity.
- BluetoothManager now keeps an in-memory history per metric (voltage,
  current, power) instead of a single primary-metric series; cleared on
  app restart by design, not persisted to disk.
- DeviceDetailView shows a channel picker above the history chart when a
  device has more than one chartable metric.
- AddDeviceView recognizes the solar service UUID during setup.
- DemoData gets a simulated solar device so the integration can be
  checked in the simulator without hardware.

Firmware:
- Add esp32_ble_solar.yaml (Votronic solar charge controller over BLE)
  and simulated variants (esp32_ble_sim.yaml, esp32_ble_solar_sim.yaml)
  for testing without a vehicle.
- esp32_ble.yaml: set flash_size/psram for the ESP32-S3 N16R8 module.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
fototeddy
2026-09-05 00:04:20 +02:00
co-authored by Claude Sonnet 5
parent 9a3b5cb472
commit 6d7b32d622
14 changed files with 1257 additions and 22 deletions
+3 -3
View File
@@ -4,33 +4,33 @@ import Foundation
/// welche Kennzahl als "Hauptwert" auf der Kachel gross dargestellt wird.
enum DeviceRole: String, Codable, CaseIterable, Identifiable, Sendable {
//case chargeBooster
//case solarCharger
//case batteryMonitor
//case bms
//case fridge
case leveling
case solar
var id: String { rawValue }
var title: String {
switch self {
//case .chargeBooster: return "Ladebooster"
//case .solarCharger: return "Solarladeregler"
//case .batteryMonitor: return "Batteriemonitor"
//case .bms: return "Batterie / BMS"
//case .fridge: return "Kühlbox"
case .leveling: return "Nivellierung"
case .solar: return "Solarladeregler"
}
}
var symbol: String {
switch self {
//case .chargeBooster: return "bolt.car"
//case .solarCharger: return "sun.max"
//case .batteryMonitor: return "gauge.with.dots.needle.bottom.50percent"
//case .bms: return "battery.100percent.bolt"
//case .fridge: return "refrigerator"
case .leveling: return "level"
case .solar: return "sun.max"
}
}