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 state class in Enphase Envoy #87397
Conversation
Hey there @gtdiehl, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all of them causing an issue?
I would think maybe only Last Seven Days
sensors need adjustment.
True. |
If daily is "since midnight" the total_increasing is correct I would only correct the ones causing an issue. |
Good point. Let's make the other sensors something to address later if neccessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm 👍
* Change total_increasing to total * As suggested in PR: only Last Seven Days TOTAL
* Change total_increasing to total * As suggested in PR: only Last Seven Days TOTAL
Proposed change
The Enphase Envoy integration uses TOTAL_INCREASING for several entities. I think these should be TOTAL.
Documentation says: "It's recommended to use state class total without last_reset whenever possible".
Also this log error appears for two of these entities, as issued in #85172:
Entity sensor.envoy_122131003872_last_seven_days_energy_consumption from integration enphase_envoy has state class total_increasing, but its state is not strictly increasing
Tested this locally and seems to work without a problem.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: