ESP + Reorganizacja

This commit is contained in:
Kamil Siejka
2024-10-03 10:05:46 +02:00
parent 61df70df2c
commit d5e3929a12
124 changed files with 18835 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
struct DEV_RELAY : Service::Switch { // deriving from the HomeSpan Switch service
int relayPin;
SpanCharacteristic *power;
DEV_RELAY(int relayPin) : Service::Switch() {
power = new Characteristic::On();
this->relayPin = relayPin;
pinMode(relayPin, OUTPUT);
}
boolean update() {
digitalWrite(relayPin, power->getNewVal());
return(true);
}
};