diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/CurrentTransformerIoT.cpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/CurrentTransformerIoT.cpp index 18f5571..f149df7 100644 --- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/CurrentTransformerIoT.cpp +++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/CurrentTransformerIoT.cpp @@ -61,3 +61,6 @@ bool CurrentTransformerIoT::processSetEnergyMessage(char* topic, char* payload, return true; } +void CurrentTransformerIoT::handleCTCallback(float current, double energy) { + this->publishReport(); +} \ No newline at end of file diff --git a/ESPMegaPRO-OS-SDK/src/main.cpp b/ESPMegaPRO-OS-SDK/src/main.cpp index 7e1c6b9..957ec89 100644 --- a/ESPMegaPRO-OS-SDK/src/main.cpp +++ b/ESPMegaPRO-OS-SDK/src/main.cpp @@ -38,7 +38,7 @@ float adc2current(uint16_t adcValue) } AnalogCard analogCard = AnalogCard(); float voltage = 220.0; -CurrentTransformer ct = CurrentTransformer(&analogCard, 0, &voltage, adc2current, 1000); +CurrentTransformerCard ct = CurrentTransformerCard(&analogCard, 0, &voltage, adc2current, 1000); #endif #ifdef CLIMATE_CARD_ENABLE