11 this->
emit(input * (((
float)R1_ + (
float)R2_) / (
float)R2_));
19static const char SCHEMA[]
PROGMEM = R
"###({
22 "R1": { "title": "R1", "type": "number", "description": "The measured value of resistor R1" },
23 "R2": { "title": "R2", "type": "number", "description": "The measured value of resistor R2" }
27String VoltageMultiplier::get_config_schema() { return FPSTR(SCHEMA); }
29bool VoltageMultiplier::set_configuration(
const JsonObject& config) {
30 String expected[] = {
"R1",
"R2"};
31 for (
auto str : expected) {
32 if (!config.containsKey(str)) {
virtual void set_input(float input, uint8_t inputChannel=0)
VoltageMultiplier(uint16_t R1, uint16_t R2, String config_path="")
const uint8_t PAGE_css_bootstrap[] PROGMEM