Skip to content

Commit 97d26cd

Browse files
webalexeuclaude
andcommitted
fix(ui): show real battery charge/discharge/idle under watt-level solar control
FORK deviation from upstream: watt-level solar control keeps the battery in HOLD mode (RS485 enabled) while actively charging/discharging, so the mode-priority status and gauge mislabelled it "discharge locked". - BatteryStatusCard.statusState: drop HOLD from the mode short-circuit so the status follows measured power; add an "idle" label for tiered-off units (0W) that previously showed nothing. - SocGauge: drop HOLD from LOCKED_MODES and from the Pause-icon condition, so a discharging HOLD battery shows the arrow, not arrow+pause overlaid. All deviations marked FORK; restore the HOLD lines to follow upstream. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f8fb2c3 commit 97d26cd

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

assets/js/components/Battery/BatteryStatusCard.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ export default defineComponent({
9292
| "discharging"
9393
| "idle" {
9494
if (this.controllable) {
95-
if (this.batteryMode === BATTERY_MODE.HOLD) return BATTERY_MODE.HOLD;
95+
// FORK (feat/battery_loop): HOLD intentionally omitted here. Watt-level solar
96+
// control keeps the battery in HOLD (RS485 enabled) while actively charging/
97+
// discharging, so mode-priority would mislabel it "discharge locked". Fall
98+
// through to the power-based status instead. Restore the HOLD line to follow
99+
// upstream if watt-level control is dropped.
96100
if (this.batteryMode === BATTERY_MODE.HOLDCHARGE) return BATTERY_MODE.HOLDCHARGE;
97101
if (this.batteryMode === BATTERY_MODE.CHARGE) return BATTERY_MODE.CHARGE;
98102
}
@@ -112,6 +116,11 @@ export default defineComponent({
112116
return this.$t("battery.card.charging");
113117
case "discharging":
114118
return this.$t("battery.card.discharging");
119+
// FORK (feat/battery_loop): label idle batteries (tiered-off units under
120+
// watt-level control sit at 0W) instead of showing no status. Remove to
121+
// follow upstream.
122+
case "idle":
123+
return this.$t("battery.card.idle");
115124
default:
116125
return undefined;
117126
}

assets/js/components/Battery/SocGauge.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@
3535
:class="{ 'layer--active': isCharging || isDischarging }"
3636
:style="{ '--rotate': arrowRotate }"
3737
/>
38+
<!-- FORK (feat/battery_loop): BATTERY_MODE.HOLD removed from the pause condition -
39+
under watt-level control HOLD is active, not paused, so the arrow/dot icons
40+
drive it. Re-add `mode === BATTERY_MODE.HOLD ||` to follow upstream. -->
3841
<Pause
3942
:size="ICON_SIZE.S"
4043
class="layer"
4144
:class="{
42-
'layer--active': mode === BATTERY_MODE.HOLD || mode === BATTERY_MODE.HOLDCHARGE,
45+
'layer--active': mode === BATTERY_MODE.HOLDCHARGE,
4346
}"
4447
/>
4548
<Dot :size="ICON_SIZE.S" class="layer" :class="{ 'layer--active': isIdle }" />
@@ -62,8 +65,10 @@ const C = SIZE / 2;
6265
const R = (SIZE - STROKE) / 2;
6366
const CIRCUMFERENCE = 2 * Math.PI * R;
6467
68+
// FORK (feat/battery_loop): BATTERY_MODE.HOLD intentionally omitted — see
69+
// BatteryStatusCard.statusState. Watt-level solar control drives charge/discharge while the
70+
// mode stays HOLD, so the gauge should show real power, not a lock. Restore HOLD to follow upstream.
6571
const LOCKED_MODES: BATTERY_MODE[] = [
66-
BATTERY_MODE.HOLD,
6772
BATTERY_MODE.HOLDCHARGE,
6873
BATTERY_MODE.CHARGE,
6974
];

i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"gridCharge": "grid charging",
2828
"hold": "discharge locked",
2929
"holdCharge": "charge locked",
30+
"idle": "idle",
3031
"ofTotal": "of {total}",
3132
"power": "Power",
3233
"soc": "Battery level"

0 commit comments

Comments
 (0)