I am new to developing for Tidbyt. I have an app that has a number of toggles. I want to count the number of toggled items and display that info on my Tidbyt. I am sure this is simple, but I am struggling. Any ideas? Thanks!
So you have some toggles that display in the configuration interface in the phone app and you want to take that number and display it on the tidbyt ? Post the your current get_schema code which should contain all of your toggles.
Not quite. I have a bunch of toggles and I want to count those that are toggled (true) and not those that are untoggled. I have a list that then populates the schema code via a FOR loop. Like this:
def get_schema(): return schema.Schema( version = "1", fields = [ schema.Toggle(id = school, name = city, desc = SCHOOL_NAMES[city], icon = "landmarkFlag") for school in SCHOOL_NAMES ], )
So you’ll be setting toggles in the schema which then generates more scheme ? Sounds like the generated schema a little bit. I think you might get more help in the discord as this is kind of a complicated idea.
Okay! I will go there. Thanks!