Files
esphome-dev/esphome/components/light/light_json_schema.h
T
2021-07-29 19:11:56 +02:00

26 lines
547 B
C++

#pragma once
#include "light_call.h"
#include "light_state.h"
#ifdef USE_JSON
namespace esphome {
namespace light {
class LightJSONSchema {
public:
/// Dump the state of a light as JSON.
static void dump_json(LightState &state, JsonObject &root);
/// Parse the JSON state of a light to a LightCall.
static void parse_json(LightState &state, LightCall &call, JsonObject &root);
protected:
static void parse_color_json(LightState &state, LightCall &call, JsonObject &root);
};
} // namespace light
} // namespace esphome
#endif