Update default precision for instantaneous demand + current#624
Update default precision for instantaneous demand + current#624TheJulianJES merged 3 commits intozigpy:devfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #624 +/- ##
=======================================
Coverage 97.49% 97.49%
=======================================
Files 62 62
Lines 10917 10919 +2
=======================================
+ Hits 10643 10645 +2
Misses 274 274 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
TL;DR: IMO we should merge this now but go through all EM related sensors and see if the HA defaults are better at a later date. I think both changes make sense. We set For current, it would already use 2 decimals, but due to the EM base class, it's set to 1. So we just fix it to 2 decimals, just for current now. For instantaneous demand, HA uses 0 decimals currently. That seems too little, as a lot of smart plugs offer higher resolution than that. I guess that's why we also set it to 1 for all EM entities. So to match that, it's set to 1 in this PR. |
d1d7ca8 to
f4e05de
Compare
|
Merging this per the above comment. It's better aligned with HA standards and existing power sensors. |
This updates the suggested display precision for the instantaneous demand entity and the RMS current entity.
The instantaneous demand entity then aligns with the EM active power entities (suggested precision 1).
The RMS current entity uses suggested precision 2 to not cut off low-power draw devices, often attached to smart plugs. HA would already use 2 by default, but we currently override this to 1 in the Base EM sensor class, which is not ideal.