6static const char *
const TAG =
"qwiic_pir";
12 ESP_LOGE(TAG,
"Failed to read chip ID");
18 if (chip_id != QWIIC_PIR_DEVICE_ID) {
19 ESP_LOGE(TAG,
"Unknown chip ID");
26 ESP_LOGE(TAG,
"Failed to configure debounce time");
36 ESP_LOGE(TAG,
"Failed to read initial state");
49 ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL);
88 static const char *
const RAW =
"RAW";
89 static const char *
const NATIVE =
"NATIVE";
90 static const char *
const HYBRID =
"HYBRID";
92 const char *debounce_mode_str = RAW;
94 debounce_mode_str = NATIVE;
96 debounce_mode_str = HYBRID;
101 " Debounce Mode: %s",
107 switch (this->error_code_) {
111 ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
114 ESP_LOGE(TAG,
"Unknown chip ID");
117 ESP_LOGE(TAG,
"Error %d", (
int) this->error_code_);
121 LOG_I2C_DEVICE(
this);
122 LOG_BINARY_SENSOR(
" ",
"Binary Sensor",
this);
128 ESP_LOGW(TAG,
"Failed to clear events");
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) const
bool read_byte(uint8_t a_register, uint8_t *data)
bool write_byte_16(uint8_t a_register, uint16_t data) const
DebounceMode debounce_mode_
@ ERROR_COMMUNICATION_FAILED
enum esphome::qwiic_pir::QwiicPIRComponent::ErrorCode NONE
union esphome::qwiic_pir::QwiicPIRComponent::@148 event_register_
void dump_config() override
@ QWIIC_PIR_DEBOUNCE_TIME