8000 Replace decimals with suggested_display_precision + remove rounding by P-R-O-C-H-Y · Pull Request #408 · zigpy/zha · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace decimals with suggested_display_precision + remove rounding #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 23, 2025

Conversation

P-R-O-C-H-Y
Copy link
Contributor

No description provided.

Copy link
codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.65%. Comparing base (94ece8f) to head (aa3e9b4).
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #408   +/-   ##
=======================================
  Coverage   96.65%   96.65%           
=======================================
  Files          61       61           
  Lines        9922     9922           
=======================================
  Hits         9590     9590           
  Misses        332      332           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@P-R-O-C-H-Y P-R-O-C-H-Y marked this pull request as ready for review April 2, 2025 12:02
@puddly
Copy link
Contributor
puddly commented Apr 23, 2025

I've updated this PR a bit to be compatible with dev. Requires a Core patch:

diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py
index a8383857e57..7980a3b53ee 100644
--- a/homeassistant/components/zha/sensor.py
+++ b/homeassistant/components/zha/sensor.py
@@ -114,6 +114,10 @@ class Sensor(ZHAEntity, SensorEntity):
         if hasattr(entity.info_object, "unit") and entity.info_object.unit is not None:
             self._attr_native_unit_of_measurement = entity.info_object.unit
 
+        self._attr_suggested_display_precision = (
+            entity.info_object.suggested_display_precision
+        )
+
         if (
             hasattr(entity, "entity_description")
             and entity.entity_description is not None

@puddly puddly merged commit 1b6b5df into zigpy:dev Apr 23, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0