Skip to content

Commit 013354d

Browse files
committed
Fix grid import status changing when allow_export is set
The gridImportExport API expects a `disallow_charge_from_grid_with_solar_installed` parameter (true = disallow), but the `onoff.charge_grid` capability stores the inverted value (true = allowed). The `allow_export` listener and `flowSetAllowExport` were passing the capability value without negating it, causing the charge-from-grid setting to flip whenever the export setting was changed. https://claude.ai/code/session_011vUXXaaXMLMPQgdM18heMx
1 parent f2360f4 commit 013354d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/battery/device.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export default class PowerwallDevice extends TeslemetryDevice {
106106
return this.action(
107107
this.site.api.gridImportExport(
108108
value,
109-
this.getCapabilityValue("onoff.charge_grid"),
109+
!this.getCapabilityValue("onoff.charge_grid"),
110110
),
111111
);
112112
});
@@ -149,7 +149,7 @@ export default class PowerwallDevice extends TeslemetryDevice {
149149
await this.action(
150150
this.site.api.gridImportExport(
151151
mode,
152-
this.getCapabilityValue("onoff.charge_grid"),
152+
!this.getCapabilityValue("onoff.charge_grid"),
153153
),
154154
);
155155
}

0 commit comments

Comments
 (0)