6 const String& config_path)
11 this->
emit(input * (((
float)R1_ + (
float)R2_) / (
float)R2_));
14bool VoltageMultiplier::to_json(JsonObject& root) {
20bool VoltageMultiplier::from_json(
const JsonObject& config) {
21 String
const expected[] = {
"R1",
"R2"};
22 for (
auto str : expected) {
23 if (!config[str].is<JsonVariant>()) {
33 return R
"({"type":"object","properties":{"R1":{"title":"R1","type":"number","description":"The measured value of resistor R1"},"R2":{"title":"R2","type":"number","description":"The measured value of resistor R2"}}})";
void emit(const float &new_value)
OBSOLETE: Since you can now apply an "output_scale" to the AnalogInput sensor, you don't need this tr...
virtual void set(const float &input)
VoltageMultiplier(uint16_t R1, uint16_t R2, const String &config_path="")
const String ConfigSchema(const SmartSwitchController &obj)