1#ifndef SENSESP_SRC_SENSESP_TRANSFORMS_ENABLE_H_
2#define SENSESP_SRC_SENSESP_TRANSFORMS_ENABLE_H_
21 Enable(
bool enabled =
true, String config_path =
"")
23 this->enabled_ = enabled;
26 virtual void set(
const T& input)
override {
31 virtual bool to_json(JsonObject& doc)
override {
32 doc[
"enabled"] = enabled_;
35 virtual bool from_json(
const JsonObject& config)
override {
36 if (config[
"enabled"].is<bool>()) {
37 enabled_ = config[
"enabled"];
50 return R
"({"type":"object","properties":{"enabled":{"type":"boolean","title":"Enable","description":"Enable or disable the transform output"}}})";
On/off switch for signals: input is emitted as-is if the enable flag is set in the web UI.
Enable(bool enabled=true, String config_path="")
virtual bool from_json(const JsonObject &config) override
virtual bool to_json(JsonObject &doc) override
virtual void set(const T &input) override
virtual bool load() override
Load and populate the object from a persistent storage.
void emit(const T &new_value)
const String ConfigSchema(const SmartSwitchController &obj)