7static const char *
const TAG =
"smt100";
10 ESP_LOGV(TAG,
"Sending measurement request");
20 int counts = (int) strtol(token,
nullptr, 10);
21 token = strtok(
nullptr,
",");
24 float permittivity = (float) strtod(token,
nullptr);
25 token = strtok(
nullptr,
",");
28 float moisture = (float) strtod(token,
nullptr);
29 token = strtok(
nullptr,
",");
33 token = strtok(
nullptr,
",");
36 float voltage = (float) strtod(token,
nullptr);
62 ESP_LOGCONFIG(TAG,
"SMT100:");
68 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)
Providing packet encoding functions for exchanging data with a remote host.