Light or dark mode

A question here. Is there some place I can query to find if the app is in dark or light mode so I can set the button backgrounds accordingly via an if statement.

Using cloud server…

Hi Dave,
There is a way, but it’s a bit messy…

If you open a browser and type blynk-cloud.com/authcode/project in the address bar it returns the JSON for the project definition.
The easiest way to view that data is to pop it into an online JSON viewer such as this:

http://jsonviewer.stack.hu/

which gives you a result like this:

As you can see, it contains an item called “theme” with a value that represents the light or dark themes.

If you’re using Node-Red then it’s going to be pretty easy to make that API call and parse the results, but in code it’s a bit harder, but do-able (don’t ask me how, I’ve never done it, but the ArduinoJSON library is probably the place to start. If you do use this library and search for example code then be aware that the syntax for the library changed dramatically in the latest major release, so most examples will be based on the old release and will throw compiler errors unless you downgrade to the earlier version.

Have fun, and report back with your working code :grinning:

Pete.