7static const char *
const TAG =
"qwiic_pir";
10 ESP_LOGCONFIG(TAG,
"Running setup");
15 ESP_LOGE(TAG,
"Failed to read chip ID");
21 if (chip_id != QWIIC_PIR_DEVICE_ID) {
22 ESP_LOGE(TAG,
"Unknown chip ID");
29 ESP_LOGE(TAG,
"Failed to configure debounce time");
39 ESP_LOGE(TAG,
"Failed to read initial state");
52 ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL);
91 static const char *
const RAW =
"RAW";
92 static const char *
const NATIVE =
"NATIVE";
93 static const char *
const HYBRID =
"HYBRID";
95 const char *debounce_mode_str = RAW;
97 debounce_mode_str = NATIVE;
99 debounce_mode_str = HYBRID;
104 " Debounce Mode: %s",
110 switch (this->error_code_) {
114 ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
117 ESP_LOGE(TAG,
"Unknown chip ID");
120 ESP_LOGE(TAG,
"Error %d", (
int) this->error_code_);
124 LOG_I2C_DEVICE(
this);
125 LOG_BINARY_SENSOR(
" ",
"Binary Sensor",
this);
131 ESP_LOGW(TAG,
"Failed to clear events");
virtual void mark_failed()
Mark this component as failed.
void publish_state(bool 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
union esphome::qwiic_pir::QwiicPIRComponent::@142 event_register_
enum esphome::qwiic_pir::QwiicPIRComponent::ErrorCode NONE
void dump_config() override
@ QWIIC_PIR_DEBOUNCE_TIME
Providing packet encoding functions for exchanging data with a remote host.