tinyDB to remember button state

I have an app that toggles buttons to turn things on/off . I have here a very simplified test, using tinyDB, to remember the last setting. This works but, the result when I restart the app is 1 or 2 in the label box, depending on how I left the switch, which is what I expect. How do I get it to say on/off and yes/no in the label instead of 1 or 2?

Use the same logic that you are using in your button events. Remember to set the buttonState on startup from the tinydb value.

1 Like

Store that text in TinyDB rather than 1 or 2

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.