mirror of
https://github.com/esphome/esphome.git
synced 2026-06-01 09:25:09 +08:00
[hlw8012] Change periodic sensor reading logs to LOGV (#15431)
This commit is contained in:
@@ -73,13 +73,13 @@ void HLW8012Component::update() {
|
|||||||
// Only read cf1 after one cycle. Apparently it's quite unstable after being changed.
|
// Only read cf1 after one cycle. Apparently it's quite unstable after being changed.
|
||||||
if (this->current_mode_) {
|
if (this->current_mode_) {
|
||||||
float current = cf1_hz * this->current_multiplier_;
|
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) {
|
if (this->current_sensor_ != nullptr) {
|
||||||
this->current_sensor_->publish_state(current);
|
this->current_sensor_->publish_state(current);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
float voltage = cf1_hz * this->voltage_multiplier_;
|
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) {
|
if (this->voltage_sensor_ != nullptr) {
|
||||||
this->voltage_sensor_->publish_state(voltage);
|
this->voltage_sensor_->publish_state(voltage);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user