teleinfo: use text_sensor and sensor. (#1403)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
0hax
2021-06-01 03:32:09 +02:00
committed by GitHub
parent 48b5ea9e59
commit afa436fe8f
11 changed files with 163 additions and 87 deletions
@@ -0,0 +1,16 @@
#pragma once
#include "esphome/components/teleinfo/teleinfo.h"
#include "esphome/components/sensor/sensor.h"
namespace esphome {
namespace teleinfo {
class TeleInfoSensor : public TeleInfoListener, public sensor::Sensor, public Component {
public:
TeleInfoSensor(const char *tag);
void publish_val(std::string val) override;
void dump_config() override;
};
} // namespace teleinfo
} // namespace esphome