Convert node_id
to distinct integer
(might be breaking for some users)
#51
+295
−211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR converts the
nodeId
variable used in scene apps from astring
to atype NodeId* = distinct int
. Comparing and passing integers around should be simpler and faster than strings. We also reduce the app's memory footprint (more efficiency), making it more possible to run on ESP-style devices.Sadly this requires changing every app, including those created in the interface.
Happily, I have added a migration that does most changes automatically. Yet there may be some custom apps created by users that use this
nodeId
in different ways than I had in mind. For this latter group, I apologise for the disruption this brings. I'm going to try really hard not to have breaking changes in FrameOS, but a change like this seems necessary and will be worse later though, so... 🙃.If you upgrade via docker, everything should be fine. If you're running FrameOS manually, run
flask db upgrade
after merging in the new changes.Scene source before:
Scene source after: