4 channel dimmer.

margeb
Posts: 3
Joined: Wed Feb 02, 2022 4:36 pm

Thanks for clarification. Trcking the examples on forum I realize how quickly Supla libraries evolve, and it's actually very good!

I have stuck now on the following definitions from your code:

Code: Select all

void click(Button3& btn) {
   miDimA->trigger(0, Supla::TOGGLE_W);
   Serial.println("Click TOGGLE_W 1");
}
void doubleClick(Button3& btn) {
   miDimB->trigger(1, Supla::TOGGLE_W);
   Serial.println("doubleClick TOGGLE_W 2");
}
void tripleClick(Button3& btn) {
   miDimC->trigger(2, Supla::TOGGLE_W);
   Serial.println("tripleClick TOGGLE_W 3");
}
void quatleClick(Button3& btn) {
   miDimD->trigger(3, Supla::TOGGLE_W);
   Serial.println("quadClick TOGGLE_W 4")
};
Supla::Control::RGBWBase does not have such member as trigger(), and it's not implemented in class Dimm as well. I could not find the prototype in othes root classes like Channel Elemnet or ActionHandler. Is this trigger() legacy from old version of library, or some extension authored by you?

I suspect it could be replaced with runAction() of Channel class, but the prototypes don't match and I am confused :roll:
elmaya
Posts: 1482
Joined: Wed Jun 27, 2018 5:48 pm
Location: El Saucejo - Sevilla

I repeat that the code is from 2 years ago and many things have changed in Supla device.

you should consider using https://gui-generic-builder.supla.io/ to create your firmware.

I think it's "runAction" now.

Code: Select all

void click(Button3& btn) {
   miDimA->runAction(0, Supla::TOGGLE_W);
   Serial.println("Click TOGGLE_W 1");
}
void doubleClick(Button3& btn) {
   miDimB->runAction(1, Supla::TOGGLE_W);
   Serial.println("doubleClick TOGGLE_W 2");
}
void tripleClick(Button3& btn) {
   miDimC->runAction(2, Supla::TOGGLE_W);
   Serial.println("tripleClick TOGGLE_W 3");
}
void quatleClick(Button3& btn) {
   miDimD->runAction(3, Supla::TOGGLE_W);
   Serial.println("quadClick TOGGLE_W 4")
};
Post Reply

Return to “Ideas and concepts”