srcfl / srcful-gateway

Sourceful Energy Gateway: Connect your solar inverter or Utility meters to earn tokens.
https://sourceful.energy/
MIT License
5 stars 2 forks source link

Configuration Migration Strategy for Device Settings #278

Open davmoz opened 2 weeks ago

davmoz commented 2 weeks ago

When the gateway starts up and synchronizes device settings from the cloud, it causes an issue with legacy configurations.

These older settings may lack required fields that were introduced in newer firmware versions. Currently, these incomplete configurations aren't being removed or updated, which results in the gateway creating new OpenPerpetualDeviceTasks for potentially invalid device configurations.

Configuration formats will likely continue to evolve with future firmware updates. We need a systematic approach to handle version differences between stored configurations and current firmware requirements.

h0bb3 commented 2 days ago

Json is flexible as you can always add information - and then deprecate the old field.

I suggest this is handled as close as possible to the actual definition of the setting in question.