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

2. Add ability to force refresh a particular card #180

Closed
wants to merge 1 commit into from

Conversation

mathieucarbou
Copy link
Contributor

This PR adds the ability to only refresh a specific card.

This could be used in the case where the user click on a switch, but some application logic is preventing the switch to turn on. In this case, since there is no update of the component, the yellow waiting icon stays and blinks, as reported in issue #179.

So it is possible to force update only this specific component in the callback to avoid that.

A typical use case is:

buttonCard.attachCallback([&](int value) {
    if(application logic autorise the switch) {
      // do something
      dashboard.sendUpdates();
    }  else {
      // switch is prevented, but the component still needs to be refreshed to clear the waiting yellow icon
      dashboard.refreshCard(&buttonCard); 
    }
});

@mathieucarbou mathieucarbou changed the title Add ability to force refresh a particular card 2. Add ability to force refresh a particular card Dec 12, 2023
@mathieucarbou mathieucarbou deleted the refresh branch December 16, 2023 15:06
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.

1 participant