Merge remote-tracking branch 'upstream/hlw8012-logv-fix' into integration

This commit is contained in:
J. Nick Koston
2026-04-03 17:45:03 -10:00
+2 -2
View File
@@ -73,13 +73,13 @@ void HLW8012Component::update() {
// Only read cf1 after one cycle. Apparently it's quite unstable after being changed.
if (this->current_mode_) {
float current = cf1_hz * this->current_multiplier_;
ESP_LOGD(TAG, "Got power=%.1fW, current=%.1fA", power, current);
ESP_LOGV(TAG, "Got power=%.1fW, current=%.1fA", power, current);
if (this->current_sensor_ != nullptr) {
this->current_sensor_->publish_state(current);
}
} else {
float voltage = cf1_hz * this->voltage_multiplier_;
ESP_LOGD(TAG, "Got power=%.1fW, voltage=%.1fV", power, voltage);
ESP_LOGV(TAG, "Got power=%.1fW, voltage=%.1fV", power, voltage);
if (this->voltage_sensor_ != nullptr) {
this->voltage_sensor_->publish_state(voltage);
}