MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / getDisplayState

Function getDisplayState

src/Topics/Topics.cpp:289–306  ·  view source on GitHub ↗

* Get display state. * * @param[in] topic Topic * @param[out] value Value * * @return If successful, it will return true otherwise false. */

Source from the content-addressed store, hash-verified

287 * @return If successful, it will return true otherwise false.
288 */
289static bool getDisplayState(const String& topic, JsonObject& value)
290{
291 DisplayMgr& displayMgr = DisplayMgr::getInstance();
292 bool isDisplayOn = displayMgr.isDisplayOn();
293
294 UTIL_NOT_USED(topic);
295
296 if (false == isDisplayOn)
297 {
298 value["state"] = "off";
299 }
300 else
301 {
302 value["state"] = "on";
303 }
304
305 return true;
306}
307
308/**
309 * Has the display state changed?

Callers

nothing calls this directly

Calls 1

isDisplayOnMethod · 0.80

Tested by

no test coverage detected