Add mean_type and unit_class to StatisticMetaData to avoid deprecation warnings#1614
Merged
BottlecapDave merged 2 commits intoFeb 9, 2026
Merged
Conversation
2 tasks
|
Adding a comment here as I want to know when this is live |
|
bump |
Owner
|
Thanks for the update |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Home Assistant 2025.11+ requires both
mean_typeandunit_classto be specified when usingasync_add_external_statistics.The current implementation in the Octopus Energy integration creates
StatisticMetaDatawithout these fields, which results in deprecation warnings and will become a breaking error in HA 2026.11.This PR updates:
custom_components/octopus_energy/statistics/consumption.pycustom_components/octopus_energy/statistics/costs.pyto include:
mean_type=StatisticMeanType.NONEunit_class=Nonein all
StatisticMetaDatainstances.Behaviour is unchanged: statistics remain sum-only and continue to be imported correctly.
Fixes #1606