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

Refactor entities and migrate unique IDs #55

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

tomleglaunec
Copy link
Collaborator

@tomleglaunec tomleglaunec commented Jan 1, 2025

  • Refactor sensors and binary sensors creation, for better maintainability, translate entities name and icon with the translation_key feature, and provide fr/en translations

  • Fix Mode Historique binary sensor value

  • Fix binary sensors BinarySensorDeviceClass inconsistencies

  • Migrate config and entities unique IDs, with meter serial number as the unique ID source (existing config and sensors will be migrated without data loss)
    IMPORTANT: This bumps the ConfigFlow to version 2.0, which means migration is irreversible (downgrading component will result in a unfixable migration error for newer/migrated configs)

  • For data validity, the device serial number will be read at setup and compared to the config serial number, to prevent another meter data to overwrite long term statistics
    TODO: update the config/option flow to permit change of the serial port (e.g. in case of hardware upgrade)

  • Test migration for standard configuration (monophase, non-producer)

  • Test migration for historic configuration (monophase + threephase)

PS: je suis preneur pour tester la migration du mode historique (ou bien depuis ma branche, ou je peux le faire depuis un conteneur de test si on me fourni quelques trames hitoriques)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant