ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
emc2101_sensor.cpp
Go to the documentation of this file.
1#include "emc2101_sensor.h"
3#include "esphome/core/log.h"
4
5namespace esphome::emc2101 {
6
7ESPHOME_LOG_TAG(TAG, "EMC2101.sensor");
8
10 ESP_LOGCONFIG(TAG, "Emc2101 sensor:");
11 LOG_SENSOR(" ", "Internal temperature", this->internal_temperature_sensor_);
12 LOG_SENSOR(" ", "External temperature", this->external_temperature_sensor_);
13 LOG_SENSOR(" ", "Speed", this->speed_sensor_);
14 LOG_SENSOR(" ", "Duty cycle", this->duty_cycle_sensor_);
15}
16
18 PUBLISH_STATE(this->internal_temperature_sensor_, this->parent_->get_internal_temperature());
19 PUBLISH_STATE(this->external_temperature_sensor_, this->parent_->get_external_temperature());
20 PUBLISH_STATE(this->speed_sensor_, this->parent_->get_speed());
21 PUBLISH_STATE(this->duty_cycle_sensor_, this->parent_->get_duty_cycle() * 100.0f);
22}
23
24} // namespace esphome::emc2101
void update() override
Used by ESPHome framework.
void dump_config() override
Used by ESPHome framework.
ESPHOME_LOG_TAG(TAG, "EMC2101")