Skip to content
5 changes: 3 additions & 2 deletions packages/modules/devices/shelly/shelly/bat.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ def update(self) -> None:
bat_state = BatState(
power=power,
imported=imported,
exported=exported,
currents=currents
exported=exported
)
if 'currents' in locals():
bat_state.currents = currents
self.store.set(bat_state)
except KeyError:
log.exception("unsupported shelly device.")
Expand Down
5 changes: 3 additions & 2 deletions packages/modules/devices/shelly/shelly/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ def update(self) -> None:
_, exported = self.sim_counter.sim_count(power)
inverter_state = InverterState(
power=power,
exported=exported,
currents=currents
exported=exported
)
if 'currents' in locals():
inverter_state.currents = currents
self.store.set(inverter_state)
except KeyError:
log.exception("unsupported shelly device.")
Expand Down