ESPHome
2024.11.1
esphome
esphome
components
ld2420
text_sensor
text_sensor.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "../ld2420.h"
4
#include "
esphome/components/text_sensor/text_sensor.h
"
5
6
namespace
esphome
{
7
namespace
ld2420 {
8
9
class
LD2420TextSensor
:
public
LD2420Listener
,
public
Component
,
text_sensor::TextSensor
{
10
public
:
11
void
dump_config
()
override
;
12
void
set_fw_version_text_sensor
(
text_sensor::TextSensor
*tsensor) { this->
fw_version_text_sensor_
= tsensor; };
13
void
on_fw_version
(std::string &fw)
override
{
14
if
(this->
fw_version_text_sensor_
!=
nullptr
) {
15
this->
fw_version_text_sensor_
->
publish_state
(fw);
16
}
17
}
18
19
protected
:
20
text_sensor::TextSensor
*
fw_version_text_sensor_
{
nullptr
};
21
};
22
23
}
// namespace ld2420
24
}
// namespace esphome
esphome::ld2420::LD2420TextSensor::set_fw_version_text_sensor
void set_fw_version_text_sensor(text_sensor::TextSensor *tsensor)
Definition:
text_sensor.h:12
esphome::Component
Definition:
component.h:68
esphome::text_sensor::TextSensor::publish_state
void publish_state(const std::string &state)
Definition:
text_sensor.cpp:9
esphome::ld2420::LD2420Listener
Definition:
ld2420.h:102
esphome::ld2420::LD2420TextSensor::dump_config
void dump_config() override
Definition:
text_sensor.cpp:10
esphome::text_sensor::TextSensor
Definition:
text_sensor.h:34
esphome::ld2420::LD2420TextSensor::fw_version_text_sensor_
text_sensor::TextSensor * fw_version_text_sensor_
Definition:
text_sensor.h:20
esphome::ld2420::LD2420TextSensor::on_fw_version
void on_fw_version(std::string &fw) override
Definition:
text_sensor.h:13
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
esphome::ld2420::LD2420TextSensor
Definition:
text_sensor.h:9
text_sensor.h
Generated by
1.8.13