ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
mt6701_sensor.cpp
Go to the documentation of this file.
1#include "mt6701_sensor.h"
2#include "esphome/core/log.h"
3
4namespace esphome::mt6701 {
5
6ESPHOME_LOG_TAG(TAG, "mt6701.sensor");
7
9 if (!this->parent_->read_encoder())
10 return;
11
12 this->publish_state(this->parent_->get_angle_degrees());
13 if (this->raw_count_sensor_ != nullptr)
14 this->raw_count_sensor_->publish_state(this->parent_->get_count());
15}
16
17void MT6701Sensor::dump_config() {
18 LOG_SENSOR("", "MT6701 Sensor", this);
19 LOG_UPDATE_INTERVAL(this);
20 LOG_SENSOR(" ", "Raw Count", this->raw_count_sensor_);
21}
22
23} // namespace esphome::mt6701
virtual void update()=0
void publish_state(float state)
Publish a new state to the front-end.
Definition sensor.cpp:65
ESPHOME_LOG_TAG(TAG, "mt6701.sensor")