mirror of
https://github.com/esphome/esphome.git
synced 2025-03-15 15:18:16 +00:00
Warm up check
This commit is contained in:
parent
4fba9d9400
commit
ceb7cb3d5f
@ -54,6 +54,12 @@ void MHZ19Component::update() {
|
|||||||
const int temp = int(response[4]) - 40;
|
const int temp = int(response[4]) - 40;
|
||||||
const uint8_t status = response[5];
|
const uint8_t status = response[5];
|
||||||
|
|
||||||
|
if (status <= 1) {
|
||||||
|
ESP_LOGW(TAG, "MHZ19 now warming up... Status=0x%02X", status);
|
||||||
|
this->status_set_warning();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ESP_LOGD(TAG, "MHZ19 Received CO₂=%uppm Temperature=%d°C Status=0x%02X", ppm, temp, status);
|
ESP_LOGD(TAG, "MHZ19 Received CO₂=%uppm Temperature=%d°C Status=0x%02X", ppm, temp, status);
|
||||||
if (this->co2_sensor_ != nullptr)
|
if (this->co2_sensor_ != nullptr)
|
||||||
this->co2_sensor_->publish_state(ppm);
|
this->co2_sensor_->publish_state(ppm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user