ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
homeassistant
homeassistant.cpp
Go to the documentation of this file.
1
#include "
homeassistant.h
"
2
3
#include "
esphome/core/progmem.h
"
4
5
namespace
esphome::homeassistant
{
6
7
PROGMEM_STRING_TABLE
(UnsetValues,
"None"
,
"unavailable"
,
"unknown"
);
8
9
bool
is_unset
(
StringRef
value
) {
return
progmem_string_table_find<UnsetValues>
(
value
.c_str(),
value
.size()) >= 0; }
10
11
}
// namespace esphome::homeassistant
esphome::StringRef
StringRef is a reference to a string owned by something else.
Definition
string_ref.h:31
homeassistant.h
esphome::homeassistant
Definition
homeassistant_binary_sensor.cpp:6
esphome::homeassistant::is_unset
bool is_unset(StringRef value)
True for what Home Assistant reports when there is no value: "None" for an attribute that is not set,...
Definition
homeassistant.cpp:9
esphome::homeassistant::PROGMEM_STRING_TABLE
PROGMEM_STRING_TABLE(UnsetValues, "None", "unavailable", "unknown")
esphome::value
uint32_t value
Definition
hal.cpp:41
esphome::progmem_string_table_find
int16_t progmem_string_table_find(const char *value, size_t len)
The index of the string value (len bytes, in RAM) in a PROGMEM_STRING_TABLE, or -1 when it is not one...
Definition
progmem.h:160
progmem.h
Generated by
1.12.0