esphome-docs/components/sensor/misc/custom-empty.h

16 lines
301 B
C
Raw Normal View History

2019-02-16 23:25:23 +01:00
#include "esphome.h"
2018-11-26 16:50:50 +01:00
2019-02-16 23:25:23 +01:00
using namespace esphome;
2018-11-26 16:50:50 +01:00
2019-05-12 22:44:59 +02:00
class MyCustomSensor : public PollingComponent, public Sensor {
2018-11-26 16:50:50 +01:00
public:
MyCustomSensor() : PollingComponent(15000) {}
void setup() override {
// This will be called by App.setup()
}
void update() override {
publish_state(42.0);
}
};