Repository navigation
Name the heat and cooling meter status bit 7 FLOW_SENSOR - #1065
Open
zigpy-review-bot wants to merge 1 commit into
Open
zigpy-review-bot wants to merge 1 commit into
zigpy-review-bot wants to merge 1 commit into
Conversation
Smart Energy 1.4a names bit 7 of the Metering Status attribute "Flow Sensor" for heat and cooling meters (an error on a flow sensor); it is "Reverse Flow" only for gas and water meters. ZHA reported it as REVERSE_FLOW for heat and cooling meters too.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1065 +/- ##
=======================================
Coverage 97.48% 97.48%
=======================================
Files 61 61
Lines 10870 10870
=======================================
Hits 10597 10597
Misses 273 273 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Severity: low (the audit's estimate)
For heat and cooling meters, Smart Energy 1.4a (Table D-19) defines bit 7 of the Metering Status attribute as a flow sensor error, but ZHA reports it as
REVERSE_FLOW, the bit's meaning for gas and water meters only. A heat meter with a faulty flow sensor then showsREVERSE_FLOWin thestatusattribute of its metering sensors.Changes
DeviceStatusHeatingCooling.REVERSE_FLOWis renamed toFLOW_SENSOR. Gas and water meters keepREVERSE_FLOW.async_test_meteringchecks that status 128 on a heat meter (metering_device_type5) readsFLOW_SENSOR.The value is an extra state attribute, so an automation matching
REVERSE_FLOWon a heat or cooling meter would need the new name.Testing
'REVERSE_FLOW' == 'FLOW_SENSOR') and passes with the fix.tests/test_sensor.py: 108 passed. pre-commit (codespell, ruff, ruff format, mypy) passes.Opened by the scheduled code audit; not requested by a maintainer.
Fixes #1064