Skip to content

Conversation

@kageurufu
Copy link
Member

Enable automatic migrations of deprecated config fields

When a field is deprecated, you can call config.deprecated('off_below', replace_with={'min_power': 0.0})

This tells klippy that the configuration is pending a save, but instead of using the autosave section, the deprecated field is removed and the replacement fields are inserted after

Pending changes in Fluidd: image

One change after saving: image

I haven't been able to test every field, however it seems to work well. This does make having both the deprecated option and it's replacement an error, so a slight breaking change there. I could alternately just remove the replacement from the fields to be saved and ignore the migration's new value, allowing for the original field removal to still process?

Checklist

  • pr title makes sense
  • squashed to 1 commit
  • added a test case if possible
  • if new feature, added to the readme
  • ci is happy and green

@kageurufu kageurufu force-pushed the deprecation_migration branch from 98e35a7 to fb36e36 Compare December 11, 2024 19:07
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