Skip to content
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

fix: prevent getTotalPower() reading intermediate results #749

Merged
merged 1 commit into from
Mar 17, 2024

Conversation

schlimmchen
Copy link
Member

the SDM power meter (among others) writes the power consumption of three phases in multiple steps. this change helps to prevent getTotalPower() reading intermediate values, i.e., reading a new value for phase 1 but old values for phase 2 and 3 since phase 2 is currently read.

cache the values, and write them all at once, protected by a mutex, later.

closes #732.

the SDM power meter (among others) writes the power consumption of three
phases in multiple steps. this change helps to prevent getTotalPower()
reading intermediate values, e.g., reading a new value for phase 1 but
old values for phase 2 and 3 since phase 2 is currently read.

cache the values, and write them all at once, protected by a mutex,
later.

closes #732.
@schlimmchen schlimmchen force-pushed the issue-732-sdm-powermeter-inconsistency branch from 2ba57e2 to b101ce4 Compare March 13, 2024 20:36
@schlimmchen schlimmchen marked this pull request as ready for review March 17, 2024 15:53
@schlimmchen
Copy link
Member Author

Discussed and tested with positive result in #732.

@schlimmchen schlimmchen merged commit 9003267 into development Mar 17, 2024
10 checks passed
@schlimmchen schlimmchen deleted the issue-732-sdm-powermeter-inconsistency branch March 17, 2024 15:54
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Live-Data: Grid Power zeigt unplausible Werte (SDM630 Power Meter)
1 participant