6static const char *
const TAG =
"smt100";
9 ESP_LOGV(TAG,
"Sending measurement request");
19 int counts = (int) strtol(token,
nullptr, 10);
20 token = strtok(
nullptr,
",");
23 float permittivity = (float) strtod(token,
nullptr);
24 token = strtok(
nullptr,
",");
27 float moisture = (float) strtod(token,
nullptr);
28 token = strtok(
nullptr,
",");
32 token = strtok(
nullptr,
",");
35 float voltage = (float) strtod(token,
nullptr);
61 ESP_LOGCONFIG(TAG,
"SMT100:");
67 LOG_UPDATE_INTERVAL(
this);
void publish_state(float state)
Publish a new state to the front-end.
sensor::Sensor * temperature_sensor_
sensor::Sensor * counts_sensor_
int readline_(int readch, char *buffer, int len)
char readline_buffer_[MAX_LINE_LENGTH]
sensor::Sensor * voltage_sensor_
void dump_config() override
sensor::Sensor * moisture_sensor_
sensor::Sensor * permittivity_sensor_
void check_uart_settings(uint32_t baud_rate, uint8_t stop_bits=1, UARTParityOptions parity=UART_CONFIG_PARITY_NONE, uint8_t data_bits=8)
Check that the configuration of the UART bus matches the provided values and otherwise print a warnin...
void write_str(const char *str)