13 if (!result.has_value()) {
14 ESP_LOGW(TAG,
"Failed to parse value '%s' for tag '%s'",
val, this->
get_tag());
17 float value = result.value();
25 LOG_SENSOR(
" ",
"Mk2PVRouter Sensor",
this);
26 ESP_LOGCONFIG(TAG,
" Tag: %s", this->
get_tag());
const char * get_tag() const
Mk2PVRouterSensor(const char *tag, bool scale_centi)
void publish_val(const char *val) override
void dump_config() override
void publish_state(float state)
Publish a new state to the front-end.
ESPHOME_LOG_TAG(TAG, "mk2pvrouter_binary_sensor")
optional< T > parse_number(const char *str)
Parse an unsigned decimal number from a null-terminated string.