This commit is contained in:
2024-12-07 18:11:36 +01:00
parent b59ee51d27
commit ad6b2ff830
2 changed files with 22 additions and 21 deletions

View File

@@ -24,7 +24,7 @@ namespace esphome
void KQM6600TAComponent::update()
{
uint8_t response[KQM6600TA_RESPONSE_LENGTH];
this->read_array(&response, KQM6600TA_RESPONSE_LENGTH);
this->read_array(response, KQM6600TA_RESPONSE_LENGTH);
if (response[0] != 0x5F)
{
ESP_LOGW(TAG, "Invalid preamble from KQM6600TA!");
@@ -44,7 +44,6 @@ namespace esphome
const float voc = ((uint16_t(response[1]) << 8) | response[2]) * 0.1f;
const uint32_t formaldehyde = ((uint16_t(response[3]) << 8) | response[4]) * 10;
const uint16_t co2 = ((uint16_t(response[5]) << 8) | response[6]) * 10;
ESP_LOGD(TAG, "KQM6600TA Received VOC=%f Formaldehyde=%dmg/m³ CO₂=%dppm", voc, formaldehyde, co2);
if (this->voc_sensor_ != nullptr)