6namespace homeassistant {
8static 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_, this->
attribute_, ONOFF(new_state));
25 ESP_LOGD(TAG,
"'%s': Got state %s", this->
entity_id_, ONOFF(new_state));
38 LOG_BINARY_SENSOR(
"",
"Homeassistant Binary Sensor",
this);
39 ESP_LOGCONFIG(TAG,
" Entity ID: '%s'", this->
entity_id_);
41 ESP_LOGCONFIG(TAG,
" Attribute: '%s'", this->
attribute_);
void subscribe_home_assistant_state(const char *entity_id, const char *attribute, std::function< void(std::string)> f)
void publish_state(bool new_state)
Publish a new state to the front-end.
void publish_initial_state(bool new_state)
Publish the initial state, this will not make the callback manager send callbacks and is meant only f...
void dump_config() override
float get_setup_priority() const override
APIServer * global_api_server
const float AFTER_WIFI
For components that should be initialized after WiFi is connected.
Providing packet encoding functions for exchanging data with a remote host.
ParseOnOffState parse_on_off(const char *str, const char *on, const char *off)
Parse a string that contains either on, off or toggle.