esphome-docs/components/sensor/misc/custom-empty.h
2019-02-16 23:25:23 +01:00

16 lines
309 B
C++

#include "esphome.h"
using namespace esphome;
class MyCustomSensor : public PollingComponent, public sensor::Sensor {
public:
MyCustomSensor() : PollingComponent(15000) {}
void setup() override {
// This will be called by App.setup()
}
void update() override {
publish_state(42.0);
}
};