Uproszczenie dodanie info o podlaczaniu

This commit is contained in:
sieja
2025-07-22 16:18:09 +02:00
parent f650e12e80
commit 3fb41c25d4
2 changed files with 3 additions and 36 deletions

View File

@@ -1,32 +1,3 @@
////////////////////////////////////
// DEVICE-SPECIFIC LED SERVICES //
////////////////////////////////////
struct DEV_LED : Service::LightBulb { // ON/OFF LED
int ledPin; // pin number defined for this LED
SpanCharacteristic *power; // reference to the On Characteristic
DEV_LED(int ledPin) : Service::LightBulb(){ // constructor() method
power=new Characteristic::On();
this->ledPin=ledPin;
pinMode(ledPin,OUTPUT);
} // end constructor
boolean update(){ // update() method
digitalWrite(ledPin,power->getNewVal());
return(true); // return true
} // update
};
//////////////////////////////////
// Here's the new code defining DEV_DimmableLED - changes from above are noted in the comments
struct DEV_DimmableLED : Service::LightBulb { // Dimmable LED