linkytic
linkytic copied to clipboard
Refactor entities and migrate unique IDs
-
Refactor sensors and binary sensors creation, for better maintainability, translate entities name and icon with the
translation_keyfeature, and provide fr/en translations -
Fix
Mode Historiquebinary sensor value -
Fix binary sensors
BinarySensorDeviceClassinconsistencies -
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
ConfigFlowto 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)