Skip to content

Commit

Permalink
Fix Power sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
zaubererty committed Feb 13, 2022
1 parent 16149e9 commit d13c4e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/mypv/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def state(self):
try:
state = self.coordinator.data[self._data_source][self.type]
if self.type == "power_act":
relOut = self.coordinator.data[self._data_source]["rel1_out"]
loadNom = self.coordinator.data[self._data_source]["load_nom"]
state = (relOut * loadNom) + state
relOut = int(self.coordinator.data[self._data_source]["rel1_out"])
loadNom = int(self.coordinator.data[self._data_source]["load_nom"])
state = (relOut * loadNom) + int(state)
self._last_value = state
except Exception as ex:
_LOGGER.error(ex)
Expand Down

0 comments on commit d13c4e5

Please sign in to comment.