ESPHome
2026.5.1
Loading...
Searching...
No Matches
esphome
components
homeassistant
binary_sensor
homeassistant_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
6
namespace
esphome::homeassistant
{
7
8
class
HomeassistantBinarySensor
:
public
binary_sensor::BinarySensor
,
public
Component
{
9
public
:
10
void
set_entity_id
(
const
char
*entity_id) { this->
entity_id_
= entity_id; }
11
void
set_attribute
(
const
char
*attribute) { this->
attribute_
= attribute; }
12
void
setup
()
override
;
13
void
dump_config
()
override
;
14
float
get_setup_priority
()
const override
;
15
16
protected
:
17
const
char
*
entity_id_
{
nullptr
};
18
const
char
*
attribute_
{
nullptr
};
19
bool
initial_
{
true
};
20
};
21
22
}
// namespace esphome::homeassistant
binary_sensor.h
esphome::Component
Definition
component.h:145
esphome::binary_sensor::BinarySensor
Base class for all binary_sensor-type classes.
Definition
binary_sensor.h:33
esphome::homeassistant::HomeassistantBinarySensor
Definition
homeassistant_binary_sensor.h:8
esphome::homeassistant::HomeassistantBinarySensor::initial_
bool initial_
Definition
homeassistant_binary_sensor.h:19
esphome::homeassistant::HomeassistantBinarySensor::attribute_
const char * attribute_
Definition
homeassistant_binary_sensor.h:18
esphome::homeassistant::HomeassistantBinarySensor::set_attribute
void set_attribute(const char *attribute)
Definition
homeassistant_binary_sensor.h:11
esphome::homeassistant::HomeassistantBinarySensor::dump_config
void dump_config() override
Definition
homeassistant_binary_sensor.cpp:36
esphome::homeassistant::HomeassistantBinarySensor::setup
void setup() override
Definition
homeassistant_binary_sensor.cpp:10
esphome::homeassistant::HomeassistantBinarySensor::entity_id_
const char * entity_id_
Definition
homeassistant_binary_sensor.h:17
esphome::homeassistant::HomeassistantBinarySensor::get_setup_priority
float get_setup_priority() const override
Definition
homeassistant_binary_sensor.cpp:43
esphome::homeassistant::HomeassistantBinarySensor::set_entity_id
void set_entity_id(const char *entity_id)
Definition
homeassistant_binary_sensor.h:10
component.h
esphome::homeassistant
Definition
homeassistant_binary_sensor.cpp:6
Generated by
1.12.0