ESPHome
2024.3.1
esphome
esphome
components
analog_threshold
analog_threshold_binary_sensor.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/binary_sensor/binary_sensor.h
"
5
#include "
esphome/components/sensor/sensor.h
"
6
7
namespace
esphome
{
8
namespace
analog_threshold {
9
10
class
AnalogThresholdBinarySensor
:
public
Component
,
public
binary_sensor::BinarySensor
{
11
public
:
12
void
dump_config
()
override
;
13
void
setup
()
override
;
14
15
float
get_setup_priority
()
const override
{
return
setup_priority::DATA
; }
16
17
void
set_sensor
(
sensor::Sensor
*analog_sensor);
18
void
set_upper_threshold
(
float
threshold) { this->
upper_threshold_
= threshold; }
19
void
set_lower_threshold
(
float
threshold) { this->
lower_threshold_
= threshold; }
20
21
protected
:
22
sensor::Sensor
*
sensor_
{
nullptr
};
23
24
float
upper_threshold_
;
25
float
lower_threshold_
;
26
};
27
28
}
// namespace analog_threshold
29
}
// namespace esphome
esphome::setup_priority::DATA
const float DATA
For components that import data from directly connected sensors like DHT.
Definition:
component.cpp:19
esphome::analog_threshold::AnalogThresholdBinarySensor::get_setup_priority
float get_setup_priority() const override
Definition:
analog_threshold_binary_sensor.h:15
esphome::analog_threshold::AnalogThresholdBinarySensor::set_lower_threshold
void set_lower_threshold(float threshold)
Definition:
analog_threshold_binary_sensor.h:19
esphome::Component
Definition:
component.h:68
esphome::analog_threshold::AnalogThresholdBinarySensor::dump_config
void dump_config() override
Definition:
analog_threshold_binary_sensor.cpp:32
esphome::analog_threshold::AnalogThresholdBinarySensor::set_sensor
void set_sensor(sensor::Sensor *analog_sensor)
Definition:
analog_threshold_binary_sensor.cpp:21
esphome::analog_threshold::AnalogThresholdBinarySensor::set_upper_threshold
void set_upper_threshold(float threshold)
Definition:
analog_threshold_binary_sensor.h:18
esphome::analog_threshold::AnalogThresholdBinarySensor::setup
void setup() override
Definition:
analog_threshold_binary_sensor.cpp:9
sensor.h
esphome::analog_threshold::AnalogThresholdBinarySensor::sensor_
sensor::Sensor * sensor_
Definition:
analog_threshold_binary_sensor.h:22
binary_sensor.h
esphome::analog_threshold::AnalogThresholdBinarySensor::lower_threshold_
float lower_threshold_
Definition:
analog_threshold_binary_sensor.h:25
esphome::analog_threshold::AnalogThresholdBinarySensor
Definition:
analog_threshold_binary_sensor.h:10
esphome::analog_threshold::AnalogThresholdBinarySensor::upper_threshold_
float upper_threshold_
Definition:
analog_threshold_binary_sensor.h:24
esphome
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition:
a01nyub.cpp:7
component.h
esphome::binary_sensor::BinarySensor
Base class for all binary_sensor-type classes.
Definition:
binary_sensor.h:37
esphome::sensor::Sensor
Base-class for all sensors.
Definition:
sensor.h:57
Generated by
1.8.13