Skip to content

Conversation

@karwosts
Copy link
Member

@karwosts karwosts commented Jan 6, 2026

Proposed change

We've got a couple different spots where we're trying to infer the energy period, and they sometimes have subtly different equations, so I'm not sure if it might be a bug if they come up with different result. Anyway we have a lot of magic number like "> 35" floating around and it's better to consolidate all that into a single standard function for calculating the period.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@karwosts
Copy link
Member Author

karwosts commented Jan 7, 2026

Didn't even realize it at first but I guess this probably fixes #28648

@MindFreeze MindFreeze merged commit 49bed5e into home-assistant:dev Jan 7, 2026
16 checks passed
@karwosts karwosts deleted the standard-energy-period branch January 7, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Energy Dashboard charts render incorrectly for date ranges spanning multiple months

2 participants