Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for the Monta LCD 'SoC' display message and upgraded the vehicle API for Enode 2024 data model #9

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ import java.time.Instant

data class EnodeVehicle(
val id: String,
val isReachable: Boolean,
val userId: String,
val vendor: String,
val isReachable: Boolean?,
val lastSeen: Instant?,
val chargeState: ChargeState?,
val information: Information?,
val odometer: Odometer?,
val location: Location?
val location: Location?,
val scopes: List<String>,
val locationId: String?
) {
data class Information(
val brand: String,
val model: String,
val year: Int,
val brand: String?,
val model: String?,
val year: Int?,
val vin: String?
)

Expand All @@ -34,7 +38,8 @@ data class EnodeVehicle(
val chargeTimeRemaining: Int?,
val isFullyCharged: Boolean?,
val lastUpdated: Instant?,
val powerDeliveryState: String
val powerDeliveryState: String,
val maxCurrent: Int?
)

data class Location(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ internal fun defaultVehicle(

return EnodeVehicle(
id = externalVehicleId,
userId = "montaTestUser",
vendor = "monta",
isReachable = true,
lastSeen = now,
chargeState = EnodeVehicle.ChargeState(
Expand All @@ -67,7 +69,8 @@ internal fun defaultVehicle(
chargeTimeRemaining = 10,
isFullyCharged = false,
lastUpdated = now,
powerDeliveryState = "PLUGGED_IN:CHARGING"
powerDeliveryState = "PLUGGED_IN:CHARGING",
maxCurrent = 32
),
information = EnodeVehicle.Information(
brand = "Monta",
Expand All @@ -83,6 +86,8 @@ internal fun defaultVehicle(
latitude = 34.165152,
longitude = -118.281788,
lastUpdated = now
)
),
locationId = null,
scopes = emptyList()
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class ChargePointDAO(
"SmartChargingEnabled" -> displayLines[0] = if (request.data == "true") "Smart Charging" else "Charging"
"StartTime" -> displayLines[2] = "Start at: ${request.data}"
"EndTime" -> displayLines[3] = "Will be finished at: ${request.data}"
"SoC" -> displayLines[4] = "Battery at: ${request.data}%"
"ClearDisplay" -> displayLines = List(5) { "" }.toMutableList()
else -> return false
}
Expand Down
Loading