Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
led.h
Go to the documentation of this file.
1#pragma once
2
3#include "widget.h"
4
5namespace gridui {
6
9class Led : public Widget {
10 template <typename Self, typename Finished>
12
13 using Widget::Widget;
14
15public:
16 void setColor(const std::string& color) {
17 m_state->set("color", new rbjson::String(color));
18 }
19
20 std::string color() const {
21 return data().getString("color");
22 }
23
24 void setOn(bool on) {
25 m_state->set("on", new rbjson::Bool(on));
26 }
27
28 bool on() const {
29 return data().getBool("on");
30 }
31};
32
33};
void setOn(bool on)
Definition led.h:24
bool on() const
Definition led.h:28
void setColor(const std::string &color)
Definition led.h:16
std::string color() const
Definition led.h:20
bool set(const std::string &key, rbjson::Value *value)
Definition widget.cpp:27
WidgetState * m_state
Definition widget.h:265
const rbjson::Object & data() const
Definition widget.h:263
Definition arm.h:8