Skip to content

Commit

Permalink
Merge pull request #375 from canton7/bugfix/number-round
Browse files Browse the repository at this point in the history
Round rather than truncating number values
  • Loading branch information
canton7 authored Jul 23, 2023
2 parents f71f76c + 8f56707 commit f8719c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/foxess_modbus/entities/modbus_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def async_set_native_value(self, value: float) -> None:
if entity_description.scale is not None:
value = value / entity_description.scale

int_value = int(value)
int_value = int(round(value))

await self._controller.write_register(self._address, int_value)

Expand Down

0 comments on commit f8719c4

Please sign in to comment.