linkytic icon indicating copy to clipboard operation
linkytic copied to clipboard

Refactor entities and migrate unique IDs

Open tomleglaunec opened this issue 10 months ago • 0 comments

  • 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)

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

  • [X] 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)

tomleglaunec avatar Jan 01 '25 18:01 tomleglaunec