beta-ready CT code

This commit is contained in:
Siwat Sirichai 2024-02-12 16:25:47 +07:00
parent 69b2198342
commit becdf35a27
2 changed files with 4 additions and 1 deletions

View File

@ -61,3 +61,6 @@ bool CurrentTransformerIoT::processSetEnergyMessage(char* topic, char* payload,
return true;
}
void CurrentTransformerIoT::handleCTCallback(float current, double energy) {
this->publishReport();
}

View File

@ -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