7 static const char *
const TAG =
"qwiic_pir";
10 ESP_LOGCONFIG(TAG,
"Setting up Qwiic PIR...");
16 ESP_LOGE(TAG,
"Failed to read the chip's ID");
24 if (chip_id != QWIIC_PIR_DEVICE_ID) {
25 ESP_LOGE(TAG,
"Unknown chip ID, is this a Qwiic PIR?");
34 ESP_LOGE(TAG,
"Failed to configure debounce time.");
46 ESP_LOGE(TAG,
"Failed to read initial sensor state.");
61 ESP_LOGW(TAG,
"Failed to communicate with sensor");
101 ESP_LOGCONFIG(TAG,
"Qwiic PIR:");
104 ESP_LOGCONFIG(TAG,
" Debounce Mode: RAW");
106 ESP_LOGCONFIG(TAG,
" Debounce Mode: NATIVE");
109 ESP_LOGCONFIG(TAG,
" Debounce Mode: HYBRID");
112 switch (this->error_code_) {
116 ESP_LOGE(TAG,
" Communication with Qwiic PIR failed!");
119 ESP_LOGE(TAG,
" Qwiic PIR has wrong chip ID - please verify you are using a Qwiic PIR");
122 ESP_LOGE(TAG,
" Qwiic PIR error code %d", (
int) this->error_code_);
126 LOG_I2C_DEVICE(
this);
127 LOG_BINARY_SENSOR(
" ",
"Qwiic PIR Binary Sensor",
this);
133 ESP_LOGW(TAG,
"Failed to clear events on sensor");
bool read_byte(uint8_t a_register, uint8_t *data, bool stop=true)
enum esphome::qwiic_pir::QwiicPIRComponent::ErrorCode NONE
void dump_config() override
void publish_state(bool state)
Publish a new state to the front-end.
DebounceMode debounce_mode_
bool write_byte(uint8_t a_register, uint8_t data, bool stop=true)
virtual void mark_failed()
Mark this component as failed.
Implementation of SPI Controller mode.
union esphome::qwiic_pir::QwiicPIRComponent::@129 event_register_
bool write_byte_16(uint8_t a_register, uint16_t data)