dolezsa / thermal_comfort

Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception)
Other
609 stars 117 forks source link

Feature: Make decimal accuracy configurable #196

Closed mhaas closed 1 year ago

mhaas commented 2 years ago

My temperature and humidity sensors report one digit while the thermal comfort integration provides two digits.

It would be great if I can align the two. I know I can set up a template sensor, but it is quite cumbersome.

Untitled

rautesamtr commented 1 year ago

Core is adding support for rounding. Now the question is how we implement this.

  1. Just stick to the 2 decimals for all sensors and let the user override the precision from the frontend.
  2. Set a sensible value for `native_precision` for each sensor. This only makes sense if there is a sensor where the user needs more then 2 decimals.
  3. Make this configurable for all sensors in YAML and frontend.
  4. Make this configurable for each sensors in YAML (making it configurable for each sensor would make configuration rather difficult in the frontend).

I'd personally start with A and switch to B if need arises. I'm not totally against C but that would conflict with B so it's one or the other.