Adopt has_entity_name, fix frozen monthly statistics and stale completion readings#47
Open
codezorz wants to merge 5 commits into
Open
Adopt has_entity_name, fix frozen monthly statistics and stale completion readings#47codezorz wants to merge 5 commits into
codezorz wants to merge 5 commits into
Conversation
added 5 commits
April 10, 2026 21:41
Made-with: Cursor
Enable modern HA entity naming (has_entity_name=True) so entity friendly names are composed as "<device> <entity>" by Home Assistant instead of carrying a hardcoded prefix. The device name is now user-configurable (default "MijnTed") via the config and options flows, which also prevents entity-id collisions when multiple config entries exist. Key changes: - Add CONF_NAME / DEFAULT_NAME constants and wire them through the config flow, options flow, and translations. - Set has_entity_name=True on all sensor and button entities; strip the "MijnTed" prefix from entity names so they become short descriptors. - Pass the configured name into device_info and all entity constructors. Made-with: Cursor
…letion readings Allow statistics re-injection for the current calendar month so the dashboard chart updates throughout the month. Always fetch the authoritative date anchor at COMPLETE_READINGS transition instead of relying on potentially stale cached device readings, and correct the previous month's cache entry when anchor readings differ. Fixes #46 Made-with: Cursor
…tion Cover the current-month bypass in _has_already_injected_period and the anchor correction behavior in _lock_current_month_starts_when_previous_complete (always fetches anchor, corrects cache when readings differ, cascades corrected starts, no-ops when anchor matches, falls back on API failure). Made-with: Cursor
Made-with: Cursor
6aa742a to
c8cbf1d
Compare
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
has_entity_namepattern and add configurable device name via options flow, aligning with Home Assistant best practices for entity/device namingFixes #46
Test plan
totalEnergyUsagevalue