5constexpr double kPi = 3.14159265358979323846;
8 const String& config_path)
9 :
FloatTransform(config_path), offset_{offset}, min_angle_{min_angle} {
32 String
const expected[] = {
"offset",
"min_angle"};
33 for (
auto str : expected) {
34 if (!config[str].is<JsonVariant>()) {
44 return R
"###({"type":"object","properties":{"offset":{"title":"Constant offset","description":"Value to be added, in degrees","type":"number","displayMultiplier":0.017453292519943295,"displayOffset":0},"min_angle":{"title":"Minimum angle value","description":"Typically 0 or -180.","type":"number","displayMultiplier":0.017453292519943295,"displayOffset":0}}})###";
Add a value to an angle input (in radians). The output value is wrapped to a range between [0,...
AngleCorrection(float offset, float min_angle=0, const String &config_path="")
virtual void set(const float &input) override
virtual bool from_json(const JsonObject &config) override
virtual bool to_json(JsonObject &root) override
virtual bool load() override
Load and populate the object from a persistent storage.
void emit(const float &new_value)
const String ConfigSchema(const SmartSwitchController &obj)