fix something

This commit is contained in:
2024-12-07 17:59:56 +01:00
parent c6d5845ca8
commit b59ee51d27
2 changed files with 6 additions and 6 deletions

View File

@@ -14,7 +14,7 @@ namespace esphome
uint8_t kqm6600ta_checksum(const uint8_t *command)
{
uint8_t sum = 0;
for (uint8_t i = 0; i < KQM6600TA_REQUEST_LENGTH; i++)
for (uint8_t i = 0; i < KQM6600TA_RESPONSE_LENGTH; i++)
{
sum += command[i];
}
@@ -23,8 +23,8 @@ namespace esphome
void KQM6600TAComponent::update()
{
uint32_t now_ms = millis();
uint8_t response[KQM6600TA_RESPONSE_LENGTH];
this->read_array(&response, KQM6600TA_RESPONSE_LENGTH);
if (response[0] != 0x5F)
{
ESP_LOGW(TAG, "Invalid preamble from KQM6600TA!");
@@ -35,7 +35,7 @@ namespace esphome
uint8_t checksum = kqm6600ta_checksum(response);
if (response[7] != checksum)
{
ESP_LOGW(TAG, "KQM6600TA Checksum doesn't match: 0x%02X!=0x%02X", response[8], checksum);
ESP_LOGW(TAG, "KQM6600TA Checksum doesn't match: 0x%02X!=0x%02X", response[7], checksum);
this->status_set_warning();
return;
}
@@ -57,7 +57,7 @@ namespace esphome
float KQM6600TAComponent::get_setup_priority() const { return setup_priority::DATA; }
void MHZ19Component::dump_config()
void KQM6600TAComponent::dump_config()
{
ESP_LOGCONFIG(TAG, "KQM6600TA:");
LOG_SENSOR(" ", "CO2", this->co2_sensor_);

View File

@@ -17,7 +17,7 @@ class KQM6600TAComponent : public PollingComponent, public uart::UARTDevice {
void dump_config() override;
void set_formaldehyde_sensor(sensor::Sensor *formaldehyde_sensor) { formaldehyde_sensor_ = formaldehyde_sensor; }
void set_voc_sensor(sensor::Sensor *voc_sensor) { voc_sensor_ = formaldehyde_sensor; }
void set_voc_sensor(sensor::Sensor *voc_sensor) { voc_sensor_ = voc_sensor; }
void set_co2_sensor(sensor::Sensor *co2_sensor) { co2_sensor_ = co2_sensor; }
protected: