mirror of
https://github.com/esphome/esphome.git
synced 2026-09-18 02:28:42 +00:00
[tsl2591] Move the single store setters into the header (#19288)
This commit is contained in:
@@ -200,8 +200,6 @@ void TSL2591Component::set_infrared_sensor(sensor::Sensor *infrared_sensor) {
|
||||
this->infrared_sensor_ = infrared_sensor;
|
||||
}
|
||||
|
||||
void TSL2591Component::set_visible_sensor(sensor::Sensor *visible_sensor) { this->visible_sensor_ = visible_sensor; }
|
||||
|
||||
void TSL2591Component::set_full_spectrum_sensor(sensor::Sensor *full_spectrum_sensor) {
|
||||
this->full_spectrum_sensor_ = full_spectrum_sensor;
|
||||
}
|
||||
@@ -242,10 +240,6 @@ void TSL2591Component::set_integration_time_and_gain(TSL2591IntegrationTime inte
|
||||
}
|
||||
}
|
||||
|
||||
void TSL2591Component::set_power_save_mode(bool enable) { this->power_save_mode_enabled_ = enable; }
|
||||
|
||||
void TSL2591Component::set_name(const char *name) { this->name_ = name; }
|
||||
|
||||
bool TSL2591Component::is_adc_valid() {
|
||||
uint8_t status;
|
||||
if (!this->read_byte(TSL2591_COMMAND_BIT | TSL2591_REGISTER_STATUS, &status)) {
|
||||
|
||||
@@ -111,13 +111,13 @@ class TSL2591Component final : public PollingComponent, public i2c::I2CDevice {
|
||||
*
|
||||
* @param enable Enable or disable power save mode.
|
||||
*/
|
||||
void set_power_save_mode(bool enable);
|
||||
void set_power_save_mode(bool enable) { this->power_save_mode_enabled_ = enable; }
|
||||
|
||||
/** Sets the name for this instance of the device.
|
||||
*
|
||||
* @param name The user-friendly name.
|
||||
*/
|
||||
void set_name(const char *name);
|
||||
void set_name(const char *name) { this->name_ = name; }
|
||||
|
||||
/** Sets the device and glass attenuation factors.
|
||||
*
|
||||
@@ -235,7 +235,7 @@ class TSL2591Component final : public PollingComponent, public i2c::I2CDevice {
|
||||
/** Used by ESPHome framework. */
|
||||
void set_infrared_sensor(sensor::Sensor *infrared_sensor);
|
||||
/** Used by ESPHome framework. */
|
||||
void set_visible_sensor(sensor::Sensor *visible_sensor);
|
||||
void set_visible_sensor(sensor::Sensor *visible_sensor) { this->visible_sensor_ = visible_sensor; }
|
||||
/** Used by ESPHome framework. */
|
||||
void set_calculated_lux_sensor(sensor::Sensor *calculated_lux_sensor);
|
||||
/** Used by ESPHome framework. Does NOT actually set the value on the device. */
|
||||
|
||||
Reference in New Issue
Block a user