Widget

network
network/Widget.h
network

Variables membres


            String id;
String label;
String value;
String color;
bool isLed;
bool isButton;
bool ledState;
bool blink;
long lastBlink;

                    

Code source


        // Server.h
#pragma once

#include <Arduino.h>
#include "../StatusDevice.h"

namespace crepp::network{

    struct Widget {
    String id;
    String label;
    String value;
    String color;
    bool isLed;
    bool isButton;
    bool ledState;
    bool blink;
    unsigned long lastBlink;
    
    Widget();
    Widget(const String& id, const String& label, const String& color = "#ffffff");
    
    static Widget createText(const String& id, const String& label, 
                            const String& value, const String& color = "#ffffff");
    static Widget createButton(const String& id, const String& label,
                              const String& buttonText, const String& color = "blue");
    
    String toJson() const;
};
};