ESPHome
2024.11.0
esphome
esphome
components
homeassistant
text_sensor
homeassistant_text_sensor.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/text_sensor/text_sensor.h
"
5
6
namespace
esphome
{
7
namespace
homeassistant {
8
9
class
HomeassistantTextSensor
:
public
text_sensor::TextSensor
,
public
Component
{
10
public
:
11
void
set_entity_id
(
const
std::string &entity_id) {
entity_id_
= entity_id; }
12
void
set_attribute
(
const
std::string &attribute) {
attribute_
= attribute; }
13
void
setup
()
override
;
14
void
dump_config
()
override
;
15
float
get_setup_priority
()
const override
;
16
17
protected
:
18
std::string
entity_id_
;
19
optional<std::string>
attribute_
;
20
};
21
22
}
// namespace homeassistant
23
}
// namespace esphome
esphome::homeassistant::HomeassistantTextSensor
Definition:
homeassistant_text_sensor.h:9
esphome::homeassistant::HomeassistantTextSensor::entity_id_
std::string entity_id_
Definition:
homeassistant_text_sensor.h:18
esphome::Component
Definition:
component.h:68
esphome::homeassistant::HomeassistantTextSensor::set_attribute
void set_attribute(const std::string &attribute)
Definition:
homeassistant_text_sensor.h:12
esphome::homeassistant::HomeassistantTextSensor::get_setup_priority
float get_setup_priority() const override
Definition:
homeassistant_text_sensor.cpp:29
esphome::homeassistant::HomeassistantTextSensor::attribute_
optional< std::string > attribute_
Definition:
homeassistant_text_sensor.h:19
esphome::text_sensor::TextSensor
Definition:
text_sensor.h:34
esphome::homeassistant::HomeassistantTextSensor::setup
void setup() override
Definition:
homeassistant_text_sensor.cpp:10
esphome::optional< std::string >
esphome::homeassistant::HomeassistantTextSensor::dump_config
void dump_config() override
Definition:
homeassistant_text_sensor.cpp:22
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
component.h
esphome::homeassistant::HomeassistantTextSensor::set_entity_id
void set_entity_id(const std::string &entity_id)
Definition:
homeassistant_text_sensor.h:11
text_sensor.h
Generated by
1.8.13