Skip to content

Commit

Permalink
Merge pull request #134 from AndersHoglund/fix_type_inconsistancy
Browse files Browse the repository at this point in the history
Added float type cast to fix OpenAPI returned string type.
  • Loading branch information
tijsverkoyen authored Jan 15, 2024
2 parents cc5e8ce + 625f80d commit aa453d5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def native_value(self) -> float:
return

realtime_power = self.coordinator.data[self._data_name][ATTR_REALTIME_POWER]
if math.isclose(realtime_power, 0, abs_tol = 0.001):
if math.isclose(float(realtime_power), 0, abs_tol = 0.001):
_LOGGER.info(f'{self.entity_id}: not producing any power, so no energy update to prevent glitches.')
return float(current_value)

Expand Down

0 comments on commit aa453d5

Please sign in to comment.