fix: hide charger section on DC charge details (PR #66)

Changes from contributor MARMdeveloper:
- Change Voltage & Current section visibility to show only for AC charges
- Unify voltage and current charts visibility under isDcCharge condition
- Add Spanish translations for asleep_since and yesterday
- Add Italian translations for asleep_since and yesterday

Resolves #65

Co-Authored-By: MARMdeveloper <48967356+MARMdeveloper@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Davide Ferrari
2026-01-19 09:51:34 +01:00
parent 76a8ed84a3
commit 4ff6e7d354
3 changed files with 22 additions and 7 deletions
@@ -234,7 +234,8 @@ private fun ChargeDetailContent(
}
// Voltage & Current section
if (s.voltageMax > 0) {
// Shown only for AC charges
if (!isDcCharge) {
StatsSectionCard(
title = chargerLabel,
icon = Icons.Default.ElectricalServices,
@@ -291,12 +292,14 @@ private fun ChargeDetailContent(
if (chargePoints.any { (it.chargerPower ?: 0) > 0 }) {
PowerChartCard(chargePoints = chargePoints, timeLabels = timeLabels, title = powerProfileTitle)
}
// Only show voltage chart for AC charges
if (!isDcCharge && chargePoints.any { (it.chargerVoltage ?: 0) > 0 }) {
VoltageChartCard(chargePoints = chargePoints, timeLabels = timeLabels, title = voltageProfileTitle)
}
if (chargePoints.any { (it.chargerCurrent ?: 0) > 0 }) {
CurrentChartCard(chargePoints = chargePoints, timeLabels = timeLabels, title = currentProfileTitle)
// Only show voltage and current charts for AC charges
if (!isDcCharge) {
if (chargePoints.any { (it.chargerVoltage ?: 0) > 0 }) {
VoltageChartCard(chargePoints = chargePoints, timeLabels = timeLabels, title = voltageProfileTitle)
}
if (chargePoints.any { (it.chargerCurrent ?: 0) > 0 }) {
CurrentChartCard(chargePoints = chargePoints, timeLabels = timeLabels, title = currentProfileTitle)
}
}
if (chargePoints.any { it.outsideTemp != null }) {
TemperatureChartCard(chargePoints = chargePoints, units = units, timeLabels = timeLabels, title = temperatureLabel)
+6
View File
@@ -78,6 +78,12 @@
<!-- Tooltip shown when climate control is inactive -->
<string name="climate_inactive">Clima inactivo</string>
<!-- Tooltip shown when car is asleep, %s is the time when it went to sleep -->
<string name="asleep_since">Dormido desde %s</string>
<!-- Word for yesterday used in timestamps -->
<string name="yesterday">ayer</string>
<!-- Content description for the car image, indicates it's tappable -->
<string name="car_image_tap_for_stats">Imagen del coche - toca para estadísticas</string>
+6
View File
@@ -78,6 +78,12 @@
<!-- Tooltip shown when climate control is inactive -->
<string name="climate_inactive">Clima inattivo</string>
<!-- Tooltip shown when car is asleep, %s is the time when it went to sleep -->
<string name="asleep_since">In riposo da %s</string>
<!-- Word for yesterday used in timestamps -->
<string name="yesterday">ieri</string>
<!-- Content description for the car image, indicates it's tappable -->
<string name="car_image_tap_for_stats">Immagine auto - tocca per statistiche</string>