Skip to content

Commit

Permalink
Adding status info for WLED sync
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Mar 2, 2024
1 parent b08db57 commit fd0db57
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ lib_deps =
build_flags =
-D STARMOD_USERMOD_WLEDAUDIO
lib_deps =
https://github.com/netmindz/WLED-sync#07737aff9523a615f507b9525ffe55c98c440f8f ;; fixes 'Could not parse manifest' warning
https://github.com/netmindz/WLED-sync#62ca8f7706e9951f47f2de477812b49d0865b5c6



Expand Down
16 changes: 16 additions & 0 deletions src/User/UserModWLEDAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ class UserModWLEDAudio:public SysModule {
//setup filesystem
void setup() {
SysModule::setup();
parentVar = ui->initUserMod(parentVar, name);
ui->initText(parentVar, "wledAudioStatus", nullptr, 16, true, [](JsonObject var, uint8_t rowNr, uint8_t funType) { switch (funType) { //varFun
case f_UIFun:
ui->setLabel(var, "Status");
// ui->setComment(var, "web socket calls");
return true;
default: return false;
}});

}

void onOffChanged() {
Expand All @@ -51,6 +60,13 @@ class UserModWLEDAudio:public SysModule {
}
}

void loop1s() {
for (JsonObject childVar: mdl->varN("clTbl")) {
ui->callVarFun(childVar, UINT8_MAX, f_ValueFun);
}
mdl->setUIValueV("wledAudioStatus", "%d, %d", sync, sync.lastPacketTime);
}

private:
boolean debug = false;

Expand Down

0 comments on commit fd0db57

Please sign in to comment.