#include "esphome.h"
class UartReadLineSensor : public Component, public UARTDevice, public TextSensor {
public: UartReadLineSensor(UARTComponent *parent) : UARTDevice(parent) {}
void setup() override {
// nothing to do here
}
void loop() override {
if (available() > 0){
String line = readStringUntil('\n');
publish_state(line.c_str());
}
delay(100);
}
};