home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.28k forks source link

Allow the rounding to be optional in integral #116884

Closed elupus closed 1 week ago

elupus commented 1 week ago

Proposed change

Allow the rounding option be optional since we now support display precision to control the number of displayed digits of a value.

Type of change

Additional information

Checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

To help with the load of incoming pull requests:

home-assistant[bot] commented 1 week ago

Hey there @dgomes, mind taking a look at this pull request as it has been labeled with an integration (integration) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `integration` can trigger bot actions by commenting: - `@home-assistant close` Closes the pull request. - `@home-assistant rename Awesome new title` Renames the pull request. - `@home-assistant reopen` Reopen the pull request. - `@home-assistant unassign integration` Removes the current integration label and assignees on the pull request, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.
elupus commented 1 week ago

We might even want to remove the option of configuring rounding fully from config flow, and just have it control display precision for yaml config?

dgomes commented 1 week ago

It's not just about display, it's a calculation that eventually gets exported to outside home assistant (e.g. influxDB)

elupus commented 1 week ago

Yes i know that.. and rounding is wrong for that too (in my opinion). Loosing precision. But it would be a semi breaking change there. So opted for making it optional instead.

dgomes commented 1 week ago

Again it depends a lot on the use cases :)