Skip to content

Commit

Permalink
Fix invalid float number conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
elad-bar authored Jul 26, 2024
1 parent 365539f commit d4fa817
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/solaredgeoptimizers/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,8 @@ def _handle_coordinator_update(self) -> None:
):
self._attr_native_value = 0

value = self._attr_native_value
if isinstance(value, str) and "," in value:
self._attr_native_value = float(value.replace(",", ""))

self.async_write_ha_state()

0 comments on commit d4fa817

Please sign in to comment.