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

Card.setEnable(true|false) #179

Open
mathieucarbou opened this issue Dec 7, 2023 · 9 comments
Open

Card.setEnable(true|false) #179

mathieucarbou opened this issue Dec 7, 2023 · 9 comments
Assignees

Comments

@mathieucarbou
Copy link
Contributor

Hi,

I have a UI where some cards and actions have to be disabled or enabled. There is no such concept at the moment wher ewe could set such flag, and the card would be greyed-out, disabled from any update or user action.

So right now, I am handing that in the code by doing some conditional. The problem is that the callback expects the UI to be refreshed (which I do) but the refresh being empty, the wait icon that is waiting for a refresh to be done is still there and never goes back.

{"command":"update:components","tabs":[],"cards":[],"charts":[],"stats": []}

image

Is there a way to implement that or have a working workaround, like updating only a specific component ?

@finchamp
Copy link

finchamp commented Mar 1, 2024

I agree, this would be useful and simple to implement. It appears to me that the documentation is also pretty scanty on using constructors/destructors on cards, as well. I've tried new/delete in my implementation on PlatformIO, and neither seem to have any effect on the dashboard, which is seriously disappointing. That would be an option, if it worked.

ETA: a method to add custom CSS / HTML to a given card would probably be more useful, and would allow you to do what you're wanting.

@mathieucarbou
Copy link
Contributor Author

you need to use add and remove to change the layout.

@finchamp
Copy link

finchamp commented Mar 1, 2024

Is there any documentation on that? The only concrete info I could find uses the "delete" operator, and that is the dynamic example: https://github.com/ayushsharma82/ESP-DASH/blob/master/examples/Dynamic/Dynamic.ino

@mathieucarbou
Copy link
Contributor Author

my documentation is the source code
image

@finchamp
Copy link

finchamp commented Mar 1, 2024

Hmm, I came across ~Card() in card.cpp, but hadn't dug deep enough yet to find that. Thanks. Still, it's a bummer that it's not reflected in the docs. Apologies for the semi-hijack.

@mathieucarbou
Copy link
Contributor Author

Like most OSS project, the doc is often the code itself, especially for small projects.

I am myself a big contributor of the open source community and write a lot of Arduino libraries, in my spare time, so I don't loose too much time on the doc. I am not paid for that. The value lies in solving the problem, and make this solution available to the community, not in documenting the problem. I also sometimes have comments like that in my projects, and my answer is that the beauty of oss projects is that everyone can contribute and send a PR 😉

(I am not the owner of this project but if you look at the contributions you will see that I contributed a lot to make it better)

@finchamp
Copy link

finchamp commented Mar 1, 2024

Indeed, I had noticed that, and appreciate your contributions. When I bought the pro license, I guess I just didn't expect to find very basic features missing from the docs. I'm not under the impression that we can make pull requests to the offsite documentation (https://docs.espdash.pro/), nor do I pretend to have an intimacy with Dash that would qualify me to do so, yet. If I am missing something, I welcome information to the contrary.

@mathieucarbou
Copy link
Contributor Author

mathieucarbou commented Mar 2, 2024

Indeed, I had noticed that, and appreciate your contributions. When I bought the pro license, I guess I just didn't expect to find very basic features missing from the docs.

I am working with several languages and usually fro C / Java you are looking at the interfaces / header files to get an accurate documentation and a good idea supporting auto-comletion would also help.

If you are using Arduino IDE, please stop, this is a toy it does not help you at all learning good programming practises and it does not help you learn about your libraries ;-) Arduino IDE is made to load and execute an existing .ino file, it is not a development tool.

I'm not under the impression that we can make pull requests to the offsite documentation (https://docs.espdash.pro/), nor do I pretend to have an intimacy with Dash that would qualify me to do so, yet. If I am missing something, I welcome information to the contrary.

Yes we can, a lot of GitHub projects are deploying their website through the GitHub repo directly. There are several mechanisms to do so, one of them being to put the website in a gh-pages brnach and ask GitHub to deploy from there.

You can review the doc and send PRs against this branch: https://github.com/ayushsharma82/ESP-DASH/tree/gh-pages

@ayushsharma82
Copy link
Owner

Just want to add here that docs website code is in ‘docs’ branch of this repo. People are open to contribute to it. Upon merger, the ‘gh-pages’ branch is automatically built & deployed by the bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants