Capability breaking change strategy

Hi,

I have a sensor style capability show in the ui of type enum that i now realize would be much better of as a string. What would be the best strategy for that change? One thing i have considered:

  • Keep and change the current enum to only one value like ‘not-in-use’, set uiComponent to null to hide it and add a new string capability. Create the new capability if it does not exist at startup and set the value of the old one to ‘not-in-use’. The trigger which uses this capability simply use the new version.

Is that possible or what would be the best way of doing this?
Thanks for any tips or tricks.

I think it’s possible to change the capability from enum to string.
An enum is also string for its ID. The enum list is only used to display the text in the GUI. So it won’t make a difference for the user.
Only difference is that a user can’t use the enum ID in flow logic and must check for the string instead.

1 Like

I thought i had tried this before but with issues but now when you wrote this i gave it another try and it seem to work without issues.

Thanks alot! :slight_smile:

1 Like