Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding status info for WLED sync #34

Merged
merged 1 commit into from
Mar 3, 2024
Merged

Adding status info for WLED sync #34

merged 1 commit into from
Mar 3, 2024

Conversation

netmindz
Copy link
Collaborator

@netmindz netmindz commented Mar 2, 2024

Trying to display when we are getting the audio data, what version etc

Comment on lines +64 to +66
for (JsonObject childVar: mdl->varN("clTbl")) {
ui->callVarFun(childVar, UINT8_MAX, f_ValueFun);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I need this bit? Wasn't sure what it did

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed a commit where I renamed varN to varChildren

void loop1s() {
for (JsonObject childVar: mdl->varN("clTbl")) {
ui->callVarFun(childVar, UINT8_MAX, f_ValueFun);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This for loop is not needed here, is needed when you want to repopulate the model values for a table

Comment on lines +64 to +66
for (JsonObject childVar: mdl->varN("clTbl")) {
ui->callVarFun(childVar, UINT8_MAX, f_ValueFun);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope

Comment on lines +64 to +66
for (JsonObject childVar: mdl->varN("clTbl")) {
ui->callVarFun(childVar, UINT8_MAX, f_ValueFun);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed a commit where I renamed varN to varChildren

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sync is a class and cannot be used as %d parameter, caused crashes here, so a unsigned from sync should be choosen or sync should be removed

@@ -28,6 +28,15 @@ class UserModWLEDAudio:public SysModule {
//setup filesystem
void setup() {
SysModule::setup();
parentVar = ui->initUserMod(parentVar, name);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug that it was required to specify the order of a module. Is fixed and improved in latest main so merge main into this PR and it should work.
Still it is advisable to specify a module order otherwise it will be shown first in the UI. As follows:
mdl->varSetFixedOrder(parentVar, 5300);

@ewoudwijma ewoudwijma merged commit fd0db57 into main Mar 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants