When I started my latest project I just stuffed a bunch data into structs and then nest structs but this has turned into a DRY fail and if-then soup that isn’t very adaptable so I reworking a lot of that and am hoping to get some pointers on the best approach. In my mobile app I have (4) “cards” where each represents a schedule/mode for the device. The user can pick a RGB color value, Start Time and enable or disable that particular mode (this is where I struggle). When they press save in the app it will trigger a Particle.function and pass in the relevant data. Where I could use a little guidance is the firmware side of things. Since a mode/schedule could be on or off depending on the settings what is the best way to store this data then use it for scheduling?
I was thinking a class object to store all of the user settings as well as some computed values on the device then std:vector or list so I can iterate through them and break out/skip it if enabled=false.