mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-23 14:18:28 +02:00
afa436fe8f
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Co-authored-by: Otto winter <otto@otto-winter.com>
15 lines
466 B
C++
15 lines
466 B
C++
#include "esphome/core/log.h"
|
|
#include "teleinfo_sensor.h"
|
|
namespace esphome {
|
|
namespace teleinfo {
|
|
|
|
static const char *TAG = "teleinfo_sensor";
|
|
TeleInfoSensor::TeleInfoSensor(const char *tag) { this->tag = std::string(tag); }
|
|
void TeleInfoSensor::publish_val(std::string val) {
|
|
auto newval = parse_float(val);
|
|
publish_state(*newval);
|
|
}
|
|
void TeleInfoSensor::dump_config() { LOG_SENSOR(" ", tag.c_str(), this); }
|
|
} // namespace teleinfo
|
|
} // namespace esphome
|