[ST Edge] Custom presentation versioning issues

I was able to create a custom capability and custom presentation which worked (mostly) as expected.

When I went to revise the presentation, the CLI complained about version 1 already existing. I really didn’t want to play that game during development. I deleted the capability, recreated the capability, and then associated the updated presentation. No errors. Everything was displayed properly when the CLI regurgitates the files. I then repackaged, reassociated with channel, and reinstalled the driver.

No matter what I’ve tried, the old presentation is used-- even though it shouldn’t exist? Yes, I’ve tried rebooting, etc. The CLI confirms the old presentation when I query by VID, so it’s not an app thing.

I’ve made the following observations along the way:

  1. You can delete a custom capability without breaking a driver which references that capability.
  2. The package process does check that the custom capability exists.

This makes me think the capability and presentation are baked into the driver?

Maybe I’m just tired and forgetting something. I’m pretty sure I successfully updated the presentation at least once before. Does everyone else just bump the version number? If so, it seems like there’s probably a lot of dead wood on the hub and/or in the ST cloud.

Use create to create new, and update to update existing. I’m not sure whether versioning actually works - all of mine are just version 1.

There’s a long-running problem with capability presentation updates not appearing on the device. Generally you need to force the system to see your device config as a brand new combination of capabilities, which involves adding/removing capabilities (just from a single section of the device config so it generates a new vid hash if you’re going to that step). The defunct capabilities like actuator and sensor are useful for that.

Or… if you re-create the capability under a new name then the new presentation will show with no problems. My method for creating new capabilities is to start with a throwaway name, then iterate with new throwaway names until the capability is perfect. Then use that last version to create the keeper with the name you want.

1 Like