mirror of
https://github.com/esphome/esphome.git
synced 2025-04-09 04:10:35 +01:00
minor debug log
This commit is contained in:
parent
8f9c42be9f
commit
969bf6be78
@ -135,6 +135,7 @@ void BH1745Component::loop() {
|
|||||||
|
|
||||||
case State::DATA_COLLECTED:
|
case State::DATA_COLLECTED:
|
||||||
this->publish_data_();
|
this->publish_data_();
|
||||||
|
this->state_ = State::IDLE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -226,6 +227,7 @@ float BH1745Component::calculate_cct_(Readings &data) {
|
|||||||
}
|
}
|
||||||
if (ct > 10000)
|
if (ct > 10000)
|
||||||
ct = 10000;
|
ct = 10000;
|
||||||
|
ESP_LOGD(TAG, "CCT calculation:%.0f", ct);
|
||||||
return roundf(ct);
|
return roundf(ct);
|
||||||
/*
|
/*
|
||||||
float cct;
|
float cct;
|
||||||
@ -260,6 +262,12 @@ void BH1745Component::publish_data_() {
|
|||||||
if (this->clear_counts_sensor_ != nullptr) {
|
if (this->clear_counts_sensor_ != nullptr) {
|
||||||
this->clear_counts_sensor_->publish_state(this->readings_.clear);
|
this->clear_counts_sensor_->publish_state(this->readings_.clear);
|
||||||
}
|
}
|
||||||
|
if (this->illuminance_sensor_ != nullptr) {
|
||||||
|
this->illuminance_sensor_->publish_state(this->calculate_lux_(this->readings_));
|
||||||
|
}
|
||||||
|
if (this->color_temperature_sensor_ != nullptr) {
|
||||||
|
this->color_temperature_sensor_->publish_state(this->calculate_cct_(this->readings_));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace bh1745
|
} // namespace bh1745
|
||||||
|
Loading…
x
Reference in New Issue
Block a user