mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-05 19:08:49 +01:00
16 lines
315 B
C++
16 lines
315 B
C++
#include "esphomelib.h"
|
|
|
|
using namespace esphomelib;
|
|
|
|
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);
|
|
}
|
|
};
|