mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 06:06:33 +00:00
[tmp102] Remove setup()
, optimize logging (#8937)
This commit is contained in:
parent
51981335d5
commit
cfa8b3b272
@ -15,13 +15,11 @@ static const uint8_t TMP102_REGISTER_HIGH_LIMIT = 0x03;
|
|||||||
|
|
||||||
static const float TMP102_CONVERSION_FACTOR = 0.0625;
|
static const float TMP102_CONVERSION_FACTOR = 0.0625;
|
||||||
|
|
||||||
void TMP102Component::setup() { ESP_LOGCONFIG(TAG, "Running setup"); }
|
|
||||||
|
|
||||||
void TMP102Component::dump_config() {
|
void TMP102Component::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, "TMP102:");
|
ESP_LOGCONFIG(TAG, "TMP102:");
|
||||||
LOG_I2C_DEVICE(this);
|
LOG_I2C_DEVICE(this);
|
||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
ESP_LOGE(TAG, "Communication with TMP102 failed!");
|
ESP_LOGE(TAG, "Communication failed");
|
||||||
}
|
}
|
||||||
LOG_UPDATE_INTERVAL(this);
|
LOG_UPDATE_INTERVAL(this);
|
||||||
LOG_SENSOR(" ", "Temperature", this);
|
LOG_SENSOR(" ", "Temperature", this);
|
||||||
|
@ -9,10 +9,7 @@ namespace tmp102 {
|
|||||||
|
|
||||||
class TMP102Component : public PollingComponent, public i2c::I2CDevice, public sensor::Sensor {
|
class TMP102Component : public PollingComponent, public i2c::I2CDevice, public sensor::Sensor {
|
||||||
public:
|
public:
|
||||||
/// Setup (reset) the sensor and check connection.
|
|
||||||
void setup() override;
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
/// Update the sensor values (temperature)
|
|
||||||
void update() override;
|
void update() override;
|
||||||
|
|
||||||
float get_setup_priority() const override;
|
float get_setup_priority() const override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user