Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted conditions increment trigger/condition number #44

Open
holycacao opened this issue Aug 15, 2016 · 3 comments
Open

Deleted conditions increment trigger/condition number #44

holycacao opened this issue Aug 15, 2016 · 3 comments

Comments

@holycacao
Copy link

if you add an 'If...' condition, then remove it by unselecting the capability, the trigger number still increments, so future 'If...' conditions for the same piston skip numbers. im not sure if this also implies a data leak ie the condition is not being removed from the st database?

phone: iphone 6+
ios: 9.3.4
hub type: hub v2.0, rev e, us
hub firmware: 000.015.00003
core: v0.2.13c.20160814

@ady624
Copy link
Owner

ady624 commented Aug 17, 2016

This behavior is intentional. I would not call it a "leak", but yeah, settings will remain for the deleted condition (I cannot modify the settings variable). The reason for this is pretty simple. If you create an IF with individual actions but then later delete it, and create a new one that would have the same id, you'd inherit everything you deleted on the previous condition which may be contradictory with what you're trying to do. i.e. actions would be pre-populated for a new condition that you wanted empty... Once an id is used, it is not recycled.

@holycacao
Copy link
Author

why can you not modify the settings variable (sorry, don't know enough about st development yet)? also, seeing Trigger #1 followed by Trigger #5 can be confusing to the user. why not use separate ids for backend and ui display, so users will always see their triggers in consecutive order?

@ady624
Copy link
Owner

ady624 commented Aug 17, 2016

the Settings part of things is read only to the SmartApp. I could implement a second list of IDs but they would change as you modify things. They would get renumbered all the time.

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

No branches or pull requests

2 participants