forked from fritob/Camper-Monitor
DeviceRole-Fälle für Victron- und Votronic-Solar eindeutig benennen
.solarCharger und .solar sahen im Code zu ähnlich aus, um auf einen Blick zu erkennen, welches der Victron-Solarladeregler (passives BLE-Advertisement) und welches der Votronic-Solarladeregler (aktive GATT-Verbindung über die ESP32-Bridge) ist. Jetzt .victronSolarCharger und .votronicSolar, samt allen abgeleiteten Bezeichnern in DemoData, WatchDemo und Tests. Die rawValues bleiben "solarCharger"/"solar", damit bereits gespeicherte Geräte beim Decodieren nicht auf einen unbekannten Rollen-Wert treffen. VictronAdvertisement.RecordType.solarCharger (das rohe Protokollfeld) bleibt unverändert – schon durch den Typnamen eindeutig, und passend zur offiziellen Victron-Bezeichnung des Datensatztyps. run-tests.sh fehlten VehicleGraphicStyle.swift und VehicleTilt.swift, seit ConfiguredDevice sie referenziert – ergänzt, Testlauf grün. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
e9b9c5bcd5
commit
83ea85f3b8
@@ -13,7 +13,7 @@ enum WatchDemo {
|
||||
private static let profile = Profile(name: "Kastenwagen", symbol: "box.truck",
|
||||
trackWidth: 1.85, wheelbase: 3.50)
|
||||
|
||||
private static let solarID = UUID(uuidString: "00000000-0000-0000-0000-000000000050")!
|
||||
private static let victronSolarID = UUID(uuidString: "00000000-0000-0000-0000-000000000050")!
|
||||
private static let batteryID = UUID(uuidString: "00000000-0000-0000-0000-0000000000A0")!
|
||||
private static let fridgeID = UUID(uuidString: "00000000-0000-0000-0000-0000000000F0")!
|
||||
private static let levelID = UUID(uuidString: "00000000-0000-0000-0000-0000000000E0")!
|
||||
@@ -30,9 +30,9 @@ enum WatchDemo {
|
||||
level.pitchOffset = 0.4
|
||||
level.rollOffset = -0.2
|
||||
|
||||
var solar = DeviceSnapshot(deviceID: solarID, timestamp: now, rssi: -58)
|
||||
solar.state = "Konstantspannung (Absorption)"
|
||||
solar.metrics = [
|
||||
var victronSolar = DeviceSnapshot(deviceID: victronSolarID, timestamp: now, rssi: -58)
|
||||
victronSolar.state = "Konstantspannung (Absorption)"
|
||||
victronSolar.metrics = [
|
||||
Metric("pv_power", "PV-Leistung", 284 + 40 * swing, unit: "W", precision: 0, primary: true),
|
||||
Metric("battery_voltage", "Batteriespannung", 14.12, unit: "V", precision: 2),
|
||||
Metric("battery_current", "Ladestrom", 18.6, unit: "A", precision: 1),
|
||||
@@ -67,8 +67,8 @@ enum WatchDemo {
|
||||
WatchDevice(id: batteryID, name: "Bulltron 200 Ah", role: .bms,
|
||||
link: .live, snapshot: battery, level: nil,
|
||||
orientation: nil, fridge: nil),
|
||||
WatchDevice(id: solarID, name: "Solar Dach", role: .solarCharger,
|
||||
link: .live, snapshot: solar, level: nil,
|
||||
WatchDevice(id: victronSolarID, name: "Solar Dach", role: .victronSolarCharger,
|
||||
link: .live, snapshot: victronSolar, level: nil,
|
||||
orientation: nil, fridge: nil),
|
||||
WatchDevice(id: fridgeID, name: "Kühlbox", role: .fridge,
|
||||
link: .live, snapshot: fridge, level: nil, orientation: nil,
|
||||
|
||||
Reference in New Issue
Block a user