Skip to content

Commit

Permalink
Allow float values in number entities
Browse files Browse the repository at this point in the history
To allow setting percentage values (for example ACTIVE_POWER_PERCENTAGE_DERATING) with 1 decimal.
  • Loading branch information
peetersch authored Oct 3, 2024
1 parent 19f012a commit ee6e129
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions number.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ def _handle_coordinator_update(self) -> None:

async def async_set_native_value(self, value: float) -> None:
"""Set a new value."""
if await self.bridge.set(self.entity_description.key, int(value)):
self._attr_native_value = int(value)
if await self.bridge.set(self.entity_description.key, float(value)):
self._attr_native_value = float(value)

await self.coordinator.async_request_refresh()

Expand Down

0 comments on commit ee6e129

Please sign in to comment.