6 namespace homeassistant {
8 static const char *
const TAG =
"homeassistant.binary_sensor";
17 ESP_LOGW(TAG,
"Can't convert '%s' to binary state!", state.c_str());
23 ESP_LOGD(TAG,
"'%s::%s': Got attribute state %s", this->
entity_id_.c_str(),
26 ESP_LOGD(TAG,
"'%s': Got state %s", this->
entity_id_.c_str(), ONOFF(new_state));
39 LOG_BINARY_SENSOR(
"",
"Homeassistant Binary Sensor",
this);
40 ESP_LOGCONFIG(TAG,
" Entity ID: '%s'", this->
entity_id_.c_str());
42 ESP_LOGCONFIG(TAG,
" Attribute: '%s'", this->
attribute_.
value().c_str());
value_type const & value() const
void publish_initial_state(bool state)
Publish the initial state, this will not make the callback manager send callbacks and is meant only f...
const float AFTER_WIFI
For components that should be initialized after WiFi is connected.
ParseOnOffState parse_on_off(const char *str, const char *on, const char *off)
Parse a string that contains either on, off or toggle.
optional< std::string > attribute_
bool state
The current reported state of the binary sensor.
float get_setup_priority() const override
void publish_state(bool state)
Publish a new state to the front-end.
Implementation of SPI Controller mode.
void dump_config() override
void subscribe_home_assistant_state(std::string entity_id, optional< std::string > attribute, std::function< void(std::string)> f)
APIServer * global_api_server