7static const char *
const TAG =
"qwiic_pir";
13 ESP_LOGE(TAG,
"Failed to read chip ID");
19 if (chip_id != QWIIC_PIR_DEVICE_ID) {
20 ESP_LOGE(TAG,
"Unknown chip ID");
27 ESP_LOGE(TAG,
"Failed to configure debounce time");
37 ESP_LOGE(TAG,
"Failed to read initial state");
50 ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL);
89 static const char *
const RAW =
"RAW";
90 static const char *
const NATIVE =
"NATIVE";
91 static const char *
const HYBRID =
"HYBRID";
93 const char *debounce_mode_str = RAW;
95 debounce_mode_str = NATIVE;
97 debounce_mode_str = HYBRID;
102 " Debounce Mode: %s",
108 switch (this->error_code_) {
112 ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
115 ESP_LOGE(TAG,
"Unknown chip ID");
118 ESP_LOGE(TAG,
"Error %d", (
int) this->error_code_);
122 LOG_I2C_DEVICE(
this);
123 LOG_BINARY_SENSOR(
" ",
"Binary Sensor",
this);
129 ESP_LOGW(TAG,
"Failed to clear events");
virtual void mark_failed()
Mark this component as failed.
void publish_state(bool new_state)
Publish a new state to the front-end.
bool write_byte(uint8_t a_register, uint8_t data, bool stop=true)
bool read_byte(uint8_t a_register, uint8_t *data, bool stop=true)
bool write_byte_16(uint8_t a_register, uint16_t data)
DebounceMode debounce_mode_
@ ERROR_COMMUNICATION_FAILED
enum esphome::qwiic_pir::QwiicPIRComponent::ErrorCode NONE
union esphome::qwiic_pir::QwiicPIRComponent::@145 event_register_
void dump_config() override
@ QWIIC_PIR_DEBOUNCE_TIME
Providing packet encoding functions for exchanging data with a remote host.