fix separate treatment of Type 3A and Type 3C connectors

fixes #356
This commit is contained in:
johan12345
2024-08-16 23:40:55 +02:00
parent be4115af33
commit 520d753b16
14 changed files with 28 additions and 24 deletions

View File

@@ -48,7 +48,8 @@ private val plugNames = mapOf(
Chargepoint.TYPE_2_UNKNOWN to R.string.plug_type_2,
Chargepoint.TYPE_2_PLUG to R.string.plug_type_2,
Chargepoint.TYPE_2_SOCKET to R.string.plug_type_2,
Chargepoint.TYPE_3 to R.string.plug_type_3,
Chargepoint.TYPE_3A to R.string.plug_type_3a,
Chargepoint.TYPE_3C to R.string.plug_type_3c,
Chargepoint.CCS_UNKNOWN to R.string.plug_ccs,
Chargepoint.CCS_TYPE_1 to R.string.plug_ccs,
Chargepoint.CCS_TYPE_2 to R.string.plug_ccs,

View File

@@ -4,7 +4,6 @@ import com.squareup.moshi.FromJson
import com.squareup.moshi.JsonClass
import com.squareup.moshi.Moshi
import com.squareup.moshi.ToJson
import net.vonforst.evmap.api.availability.tesla.LocalTimeAdapter
import net.vonforst.evmap.model.ChargeLocation
import net.vonforst.evmap.model.Chargepoint
import net.vonforst.evmap.utils.distanceBetween
@@ -15,7 +14,6 @@ import retrofit2.http.GET
import retrofit2.http.Path
import retrofit2.http.Query
import java.time.Instant
import java.time.LocalTime
private const val coordRange = 0.005 // range of latitude and longitude for loading the map
private const val maxDistance = 60 // max distance between reported positions in meters
@@ -202,7 +200,8 @@ class EnBwAvailabilityDetector(client: OkHttpClient, baseUrl: String? = null) :
val id = index.toLong()
val power = connector.maxPowerInKw ?: 0.0
val type = when (connector.plugTypeName) {
"Typ 3A" -> Chargepoint.TYPE_3
"Typ 3A" -> Chargepoint.TYPE_3A
"Typ 3C \"Scame\"" -> Chargepoint.TYPE_3C
"Typ 2" -> Chargepoint.TYPE_2_UNKNOWN
"Typ 1" -> Chargepoint.TYPE_1
"Steckdose(D)" -> Chargepoint.SCHUKO

View File

@@ -1,6 +1,5 @@
package net.vonforst.evmap.api.availability
import androidx.car.app.model.DateTimeWithZone
import com.squareup.moshi.FromJson
import com.squareup.moshi.JsonClass
import com.squareup.moshi.Moshi
@@ -13,12 +12,8 @@ import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
import retrofit2.http.GET
import retrofit2.http.Path
import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneOffset
import java.time.ZonedDateTime
import java.time.format.DateTimeParseException
import java.util.*
import java.util.Locale
private const val coordRange = 0.005 // range of latitude and longitude for loading the map
private const val maxDistance = 60 // max distance between reported positions in meters
@@ -180,7 +175,7 @@ class NewMotionAvailabilityDetector(client: OkHttpClient, baseUrl: String? = nul
val id = connector.uid
val power = connector.electricalProperties.getPower()
val type = when (connector.connectorType.lowercase(Locale.ROOT)) {
"type3" -> Chargepoint.TYPE_3
"type3" -> Chargepoint.TYPE_3C
"type2" -> Chargepoint.TYPE_2_UNKNOWN
"type1" -> Chargepoint.TYPE_1
"domestic" -> Chargepoint.SCHUKO

View File

@@ -208,7 +208,7 @@ data class GEChargepoint(val type: String, val power: Double, val count: Int) {
return when (type) {
Chargepoint.TYPE_1 -> "Typ1"
Chargepoint.TYPE_2_UNKNOWN -> "Typ2"
Chargepoint.TYPE_3 -> "Typ3"
Chargepoint.TYPE_3C -> "Typ3"
Chargepoint.CCS_UNKNOWN -> "CCS"
Chargepoint.CCS_TYPE_2 -> "Typ2"
Chargepoint.SCHUKO -> "Schuko"
@@ -225,7 +225,7 @@ data class GEChargepoint(val type: String, val power: Double, val count: Int) {
return when (type) {
"Typ1" -> Chargepoint.TYPE_1
"Typ2" -> Chargepoint.TYPE_2_UNKNOWN
"Typ3" -> Chargepoint.TYPE_3
"Typ3" -> Chargepoint.TYPE_3C
"Tesla Supercharger CCS" -> Chargepoint.CCS_UNKNOWN
"CCS" -> Chargepoint.CCS_UNKNOWN
"Schuko" -> Chargepoint.SCHUKO

View File

@@ -180,8 +180,8 @@ data class OCMConnection(
25L -> Chargepoint.TYPE_2_SOCKET
1036L -> Chargepoint.TYPE_2_PLUG
1L -> Chargepoint.TYPE_1
36L -> Chargepoint.TYPE_3
26L -> Chargepoint.TYPE_3
36L -> Chargepoint.TYPE_3A
26L -> Chargepoint.TYPE_3C
else -> title ?: ""
}
}

View File

@@ -434,7 +434,8 @@ data class Chargepoint(
const val TYPE_2_UNKNOWN = "Type 2 (either plug or socket)"
const val TYPE_2_SOCKET = "Type 2 socket"
const val TYPE_2_PLUG = "Type 2 plug"
const val TYPE_3 = "Type 3"
const val TYPE_3A = "Type 3A"
const val TYPE_3C = "Type 3C"
const val CCS_TYPE_2 = "CCS Type 2"
const val CCS_TYPE_1 = "CCS Type 1"
const val CCS_UNKNOWN = "CCS (either Type 1 or Type 2)"

View File

@@ -303,7 +303,8 @@
<string name="network">Síť</string>
<string name="not_implemented">zatím není implementováno</string>
<string name="pref_navigate_use_maps_off">Navigační tlačítko otevře aplikaci map s umístěním nabíječky</string>
<string name="plug_type_3">Typ 3A</string>
<string name="plug_type_3c">Typ 3C</string>
<string name="plug_type_3a">Typ 3A</string>
<string name="map_type_terrain">Terén</string>
<string name="map_type">Typ mapy</string>
<string name="location_error">Nepodařilo se zjistit polohu. Zkontrolujte prosím nastavení systému</string>

View File

@@ -59,7 +59,8 @@
<string name="filter_connectors">Anschlüsse</string>
<string name="plug_type_1">Typ 1</string>
<string name="plug_type_2">Typ 2</string>
<string name="plug_type_3">Typ 3A</string>
<string name="plug_type_3c">Typ 3C</string>
<string name="plug_type_3a">Typ 3A</string>
<string name="plug_ccs">CCS</string>
<string name="plug_schuko">Schuko</string>
<string name="plug_chademo">CHAdeMO</string>

View File

@@ -145,7 +145,8 @@
<string name="oss_licenses">Licences</string>
<string name="realtime_data_source">Source du statut en temps réel (bêta) : %s</string>
<string name="plug_type_2">Type 2</string>
<string name="plug_type_3">Type 3A</string>
<string name="plug_type_3c">Type 3C</string>
<string name="plug_type_3a">Type 3A</string>
<string name="plug_cee_rot">CEE Rouge</string>
<string name="all">tous</string>
<string name="fault_report_date">Rapport d\'anomalie (dernière mise à jour : %s)</string>

View File

@@ -97,7 +97,8 @@
<string name="plug_schuko">Schuko</string>
<string name="plug_supercharger">Tesla Supercharger</string>
<string name="plug_type_2">Type 2</string>
<string name="plug_type_3">Type 3A</string>
<string name="plug_type_3c">Type 3C</string>
<string name="plug_type_3a">Type 3A</string>
<string name="all">alle</string>
<string name="none">ingen</string>
<string name="show_less">færre …</string>

View File

@@ -62,7 +62,8 @@
<string name="filter_free_parking">Alleen laadpunten met gratis parking</string>
<string name="filter_min_connectors">Minimaal aantal connecteren</string>
<string name="filter_connectors">Connectoren</string>
<string name="plug_type_3">Type 3A</string>
<string name="plug_type_3c">Type 3C</string>
<string name="plug_type_3a">Type 3A</string>
<string name="plug_schuko">Schuko</string>
<string name="plug_chademo">CHAdeMO</string>
<string name="plug_cee_rot">CEE Red</string>

View File

@@ -256,7 +256,8 @@
<string name="filter_connectors">Conectores</string>
<string name="plug_type_1">Tipo 1</string>
<string name="plug_type_2">Tipo 2</string>
<string name="plug_type_3">Tipo 3A</string>
<string name="plug_type_3c">Tipo 3C</string>
<string name="plug_type_3a">Tipo 3A</string>
<string name="plug_ccs">CCS</string>
<string name="plug_schuko">Schuko</string>
<string name="plug_chademo">CHAdeMO</string>

View File

@@ -58,7 +58,8 @@
<string name="filter_connectors">Conectori</string>
<string name="plug_type_1">Type 1</string>
<string name="plug_type_2">Type 2</string>
<string name="plug_type_3">Type 3A</string>
<string name="plug_type_3c">Type 3C</string>
<string name="plug_type_3a">Type 3A</string>
<string name="plug_ccs">CCS</string>
<string name="plug_schuko">Schuko</string>
<string name="plug_chademo">CHAdeMO</string>

View File

@@ -59,7 +59,8 @@
<string name="filter_connectors">Connectors</string>
<string name="plug_type_1">Type 1</string>
<string name="plug_type_2">Type 2</string>
<string name="plug_type_3">Type 3A</string>
<string name="plug_type_3a">Type 3A</string>
<string name="plug_type_3c">Type 3C</string>
<string name="plug_ccs">CCS</string>
<string name="plug_schuko">Schuko</string>
<string name="plug_chademo">CHAdeMO</string>