Skip to content

Commit dd96d59

Browse files
committed
Fix TypeError in AC power calculation
pv_power is a dict with keys 'pv1', 'pv2', 'pv3', 'total', but was being added directly to battery_power (float). Changed to use pv_power['total'] for AC power calculation. Fixes: TypeError: unsupported operand type(s) for +: 'dict' and 'float'
1 parent 51ca51a commit dd96d59

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

emulator/simulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def update(self) -> None:
106106
grid_power = self._calculate_grid_power(pv_power, battery_power)
107107

108108
# Calculate AC output
109-
ac_power = pv_power + battery_power # Total output to grid/load
109+
ac_power = pv_power['total'] + battery_power # Total output to grid/load
110110

111111
# Calculate temperatures
112112
temps = self._calculate_temperatures(ac_power)

0 commit comments

Comments
 (0)