1#ifndef SENSESP_SIGNALK_SIGNALK_OUTPUT_H_
2#define SENSESP_SIGNALK_SIGNALK_OUTPUT_H_
37 SKOutput(String sk_path, String config_path, std::shared_ptr<SKMetadata> meta)
44 virtual void set(
const T& new_value)
override {
53 virtual bool to_json(JsonObject& root)
override {
58 virtual bool from_json(
const JsonObject& config)
override {
59 if (!config[
"sk_path"].is<String>()) {
73 this->
meta_ = std::make_shared<SKMetadata>(*meta);
79 std::shared_ptr<SKMetadata>
meta_;
84 return R
"({"type":"object","properties":{"sk_path":{"title":"Signal K Path","type":"string"}} })";
99 :
SKOutput<String>(sk_path, config_path, meta) {}
virtual bool load() override
Load and populate the object from a persistent storage.
A class that produces Signal K output to be forwarded to the Signal K server (if the system is connec...
void set_sk_path(const String &path)
A specialized transform whose primary purpose is to output Signal K data on the Signal K network.
virtual void set_metadata(SKMetadata *meta)
virtual bool from_json(const JsonObject &config) override
virtual SKMetadata * get_metadata() override
std::shared_ptr< SKMetadata > meta_
virtual void as_signalk_json(JsonDocument &doc) override
SKOutput(String sk_path, String config_path, std::shared_ptr< SKMetadata > meta)
virtual bool to_json(JsonObject &root) override
SKOutput(String sk_path, String config_path="", SKMetadata *meta=nullptr)
virtual void set(const T &new_value) override
SKOutput(String sk_path, SKMetadata *meta)
A special class for sending numeric values to the Signal K server on a specific Signal K path.
SKOutputNumeric(String sk_path, String config_path, String units)
SKOutputNumeric(String sk_path, SKMetadata *meta)
SKOutputNumeric(String sk_path, String config_path="", SKMetadata *meta=nullptr)
Class for sending raw Json strings on a specific Signal K path.
virtual void as_signalk_json(JsonDocument &doc) override
SKOutputRawJson(String sk_path, String config_path="", SKMetadata *meta=NULL)
A base class for any sensor or piece of code that outputs a value for consumption elsewhere.
void emit(const T &new_value)
const String ConfigSchema(const SmartSwitchController &obj)
SKOutput< String > SKOutputString
SKOutputNumeric< int > SKOutputInt
SKOutputNumeric< float > SKOutputFloat
bool ConfigRequiresRestart(const HTTPServer &obj)
SKOutput< bool > SKOutputBool