diff --git a/esphome/components/bl0910/bl0910.h b/esphome/components/bl0910/bl0910.h index f183b95db6..2217c5c3a6 100644 --- a/esphome/components/bl0910/bl0910.h +++ b/esphome/components/bl0910/bl0910.h @@ -16,26 +16,26 @@ class BL0910 : public PollingComponent, public spi::SPIDevice { public: - // Sensor index is 1-based to match the BL0910 documentation + // Sensor channel is 1-based to match the BL0910 documentation // but the array is 0-based to save memory and simplify code - void set_voltage_sensor(sensor::Sensor *voltage_sensor, int index, float voltage_reference) { - this->voltage_sensor_[index - 1] = voltage_sensor; - this->voltage_reference_[index - 1] = voltage_reference; + void set_voltage_sensor(sensor::Sensor *voltage_sensor, int channel, float voltage_reference) { + this->voltage_sensor_[channel - 1] = voltage_sensor; + this->voltage_reference_[channel - 1] = voltage_reference; } - void set_current_sensor(sensor::Sensor *current_sensor, int index, float current_reference) { - this->current_sensor_[index - 1] = current_sensor; - this->current_reference_[index - 1] = current_reference; + void set_current_sensor(sensor::Sensor *current_sensor, int channel, float current_reference) { + this->current_sensor_[channel - 1] = current_sensor; + this->current_reference_[channel - 1] = current_reference; } - void set_power_sensor(sensor::Sensor *power_sensor, int index, float power_reference) { - this->power_sensor_[index - 1] = power_sensor; - this->power_reference_[index - 1] = power_reference; + void set_power_sensor(sensor::Sensor *power_sensor, int channel, float power_reference) { + this->power_sensor_[channel - 1] = power_sensor; + this->power_reference_[channel - 1] = power_reference; } - void set_energy_sensor(sensor::Sensor *energy_sensor, int index, float energy_reference) { - this->energy_sensor_[index - 1] = energy_sensor; - this->energy_reference_[index - 1] = energy_reference; + void set_energy_sensor(sensor::Sensor *energy_sensor, int channel, float energy_reference) { + this->energy_sensor_[channel - 1] = energy_sensor; + this->energy_reference_[channel - 1] = energy_reference; } - void set_power_factor_sensor(sensor::Sensor *power_factor_sensor, int index) { - this->power_factor_sensor_[index - 1] = power_factor_sensor; + void set_power_factor_sensor(sensor::Sensor *power_factor_sensor, int channel) { + this->power_factor_sensor_[channel - 1] = power_factor_sensor; } void set_frequency_sensor(sensor::Sensor *frequency_sensor) { this->frequency_sensor_ = frequency_sensor; } void set_temperature_sensor(sensor::Sensor *temperature_sensor) { this->temperature_sensor_ = temperature_sensor; }