mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-16 20:41:35 +01:00
8d9b0d2375
* Netlify * Fix * Faster doxygen * Update Makefile * Try without api * Debug * Fix * Update Makefile * Debug * Try 1.8.13 * Remove debug * Update Makefile * Optimize
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);
|
|
}
|
|
};
|