ESPHome 2025.5.0
Loading...
Searching...
No Matches
adc128s102_sensor.cpp
Go to the documentation of this file.
1#include "adc128s102_sensor.h"
2
3#include "esphome/core/log.h"
4
5namespace esphome {
6namespace adc128s102 {
7
8static const char *const TAG = "adc128s102.sensor";
9
10ADC128S102Sensor::ADC128S102Sensor(uint8_t channel) : channel_(channel) {}
11
13
15 LOG_SENSOR("", "ADC128S102 Sensor", this);
16 ESP_LOGCONFIG(TAG, " Pin: %u", this->channel_);
17 LOG_UPDATE_INTERVAL(this);
18}
19
20float ADC128S102Sensor::sample() { return this->parent_->read_data(this->channel_); }
22
23} // namespace adc128s102
24} // namespace esphome
void publish_state(float state)
Publish a new state to the front-end.
Definition sensor.cpp:39
const float DATA
For components that import data from directly connected sensors like DHT.
Definition component.cpp:19
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7