8 static const char *
const TAG =
"tuya.sensor";
13 ESP_LOGV(TAG,
"MCU reported sensor %u is: %s", datapoint.id, ONOFF(datapoint.value_bool));
14 this->publish_state(datapoint.value_bool);
16 ESP_LOGV(TAG,
"MCU reported sensor %u is: %d", datapoint.id, datapoint.value_int);
17 this->publish_state(datapoint.value_int);
19 ESP_LOGV(TAG,
"MCU reported sensor %u is: %u", datapoint.id, datapoint.value_enum);
20 this->publish_state(datapoint.value_enum);
22 ESP_LOGV(TAG,
"MCU reported sensor %u is: %" PRIx32, datapoint.id, datapoint.value_bitmask);
23 this->publish_state(datapoint.value_bitmask);
29 LOG_SENSOR(
"",
"Tuya Sensor",
this);
30 ESP_LOGCONFIG(TAG,
" Sensor has datapoint ID %u", this->
sensor_id_);
void register_listener(uint8_t datapoint_id, const std::function< void(TuyaDatapoint)> &func)
void dump_config() override
Implementation of SPI Controller mode.