From ca59d35a22c7cdb7a94c06fc57d33a5eea298ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6gberg?= Date: Thu, 21 Nov 2024 23:33:01 +0100 Subject: [PATCH] Add evseId to class Chargepoint .. and populate it in nobil data source --- app/src/main/java/net/vonforst/evmap/api/nobil/NobilModel.kt | 3 ++- app/src/main/java/net/vonforst/evmap/model/ChargersModel.kt | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/vonforst/evmap/api/nobil/NobilModel.kt b/app/src/main/java/net/vonforst/evmap/api/nobil/NobilModel.kt index 326249e58..d29c23a7e 100644 --- a/app/src/main/java/net/vonforst/evmap/api/nobil/NobilModel.kt +++ b/app/src/main/java/net/vonforst/evmap/api/nobil/NobilModel.kt @@ -219,8 +219,9 @@ data class NobilChargerStation( val connectionVoltage = if (attribs["12"]?.attrVal is String) attribs["12"]?.attrVal.toString().toDoubleOrNull() else null val connectionCurrent = if (attribs["31"]?.attrVal is String) attribs["31"]?.attrVal.toString().toDoubleOrNull() else null + val evseId = if (attribs["28"]?.attrVal is String) attribs["28"]?.attrVal.toString() else null - return Chargepoint(connectionType, connectionPower, 1, connectionCurrent, connectionVoltage) + return Chargepoint(connectionType, connectionPower, 1, connectionCurrent, connectionVoltage, listOf(evseId)) } } } diff --git a/app/src/main/java/net/vonforst/evmap/model/ChargersModel.kt b/app/src/main/java/net/vonforst/evmap/model/ChargersModel.kt index 2329e5d9c..24afac0a1 100644 --- a/app/src/main/java/net/vonforst/evmap/model/ChargersModel.kt +++ b/app/src/main/java/net/vonforst/evmap/model/ChargersModel.kt @@ -405,7 +405,9 @@ data class Chargepoint( // Max voltage in V (or null if unknown). // note that for DC chargers: current * voltage may be larger than power // (each of the three can be separately limited) - val voltage: Double? = null + val voltage: Double? = null, + // Electric Vehicle Supply Equipment Ids for this Chargepoint's plugs/sockets + val evseIds: List = emptyList() ) : Equatable, Parcelable { fun hasKnownPower(): Boolean = power != null fun hasKnownVoltageAndCurrent(): Boolean = voltage != null && current != null