7 static const char *
const TAG =
"tuya.sensor";
12 ESP_LOGV(TAG,
"MCU reported sensor %u is: %s", datapoint.id, ONOFF(datapoint.value_bool));
13 this->publish_state(datapoint.value_bool);
15 ESP_LOGV(TAG,
"MCU reported sensor %u is: %d", datapoint.id, datapoint.value_int);
16 this->publish_state(datapoint.value_int);
18 ESP_LOGV(TAG,
"MCU reported sensor %u is: %u", datapoint.id, datapoint.value_enum);
19 this->publish_state(datapoint.value_enum);
21 ESP_LOGV(TAG,
"MCU reported sensor %u is: %x", datapoint.id, datapoint.value_bitmask);
22 this->publish_state(datapoint.value_bitmask);
28 LOG_SENSOR(
"",
"Tuya Sensor",
this);
29 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