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

Generalize the number card #49

Closed
mlesniew opened this issue Nov 13, 2019 · 3 comments
Closed

Generalize the number card #49

mlesniew opened this issue Nov 13, 2019 · 3 comments

Comments

@mlesniew
Copy link
Contributor

Hi,

l was wondering if it would be possible to add more card types similar to the temperature and humidity cards, e.g. a card for atmospheric pressure, voltage or power. After checking the code I've come to the conclusion that all of them are basically the same, the only difference is the measuring unit.

I think I would be able to modify the code of the number card so that it would be additionally configured with a unit (a string, like V or kW for example). This way the number card could be used to display any kind of measurement. Additionally, the existing temperature and humidity card types could be also built using the extended number card. Of course, the functions related to the temperature and humidity cards should probably still stay in the class for backward compatibility, but their internal implementation could be simplified.

What do you think about this approach? Would it be worth implementing? If you think it's a good idea, I could try to do it and prepare a pull request.

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.75. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@ayushsharma82
Copy link
Owner

ayushsharma82 commented Dec 16, 2019

@mlesniew It will need some UI Adjustments too. I will suggest you add this type of feature in V3 dash-next branch of ESP-DASH.

I will modify the UI accordingly in dash-next. You can create a pull request for the server-side block of code.

We have shifted our focus to the new dash-next branch. So it's better we just work on V3 directly, instead of adding features in the current state of library.

@ayushsharma82
Copy link
Owner

Added a Generic Card with V3 Release and now almost all cards support symbol attribute.
You can take a look at examples and upgrade your code.

Thanks for your input!

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

2 participants