1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

[tmp102] Remove setup(), optimize logging (#8937)

This commit is contained in:
Keith Burzinski
2025-05-28 18:44:31 -05:00
committed by GitHub
parent 51981335d5
commit cfa8b3b272
2 changed files with 1 additions and 6 deletions

View File

@@ -15,13 +15,11 @@ static const uint8_t TMP102_REGISTER_HIGH_LIMIT = 0x03;
static const float TMP102_CONVERSION_FACTOR = 0.0625;
void TMP102Component::setup() { ESP_LOGCONFIG(TAG, "Running setup"); }
void TMP102Component::dump_config() {
ESP_LOGCONFIG(TAG, "TMP102:");
LOG_I2C_DEVICE(this);
if (this->is_failed()) {
ESP_LOGE(TAG, "Communication with TMP102 failed!");
ESP_LOGE(TAG, "Communication failed");
}
LOG_UPDATE_INTERVAL(this);
LOG_SENSOR(" ", "Temperature", this);

View File

@@ -9,10 +9,7 @@ namespace tmp102 {
class TMP102Component : public PollingComponent, public i2c::I2CDevice, public sensor::Sensor {
public:
/// Setup (reset) the sensor and check connection.
void setup() override;
void dump_config() override;
/// Update the sensor values (temperature)
void update() override;
float get_setup_priority() const override;