mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-11-05 09:20:08 +01:00
16 lines
301 B
C++
16 lines
301 B
C++
#include "esphome.h"
|
|
|
|
using namespace esphome;
|
|
|
|
class MyCustomSensor : public PollingComponent, public Sensor {
|
|
public:
|
|
MyCustomSensor() : PollingComponent(15000) {}
|
|
|
|
void setup() override {
|
|
// This will be called by App.setup()
|
|
}
|
|
void update() override {
|
|
publish_state(42.0);
|
|
}
|
|
};
|