frontend
frontend copied to clipboard
humidifier card: add on-off button
Proposed change
Add on/off toggle to the humidifier card UPDATE: Toggle replaced with the button, see comments. Images are outdated.
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (thank you!)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
Example configuration
demo:
Additional information
- This PR fixes or closes issue: fixes #
- This PR is related to issue or discussion:
- Link to documentation pull request:
Checklist
- [x] The code change is tested and works locally.
- [x] There is no commented out code in this PR.
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for www.home-assistant.io
We should just make clicking the card toggle the entity instead of adding a toggle element
Let me disagree:
- How a user is supposed to know that? Make it a giant button?
- A toggle is also a nice and clearly visible indication of whether it is currently on or off
- If the user can click anywhere in the card to turn the humidifier on or off, he might be afraid to misclick and change the humidity. Or vice-versa, being afraid to turn it off while changing the humidity. Or scrolling on a touch screen. This is not the case when we have a designated area to click.
- This doesn't seem to be common for other entities, except the button (for which it is natural), especially for the thermostat card that people would compare it to, and we would like to keep the design consistent.
We should align the functionality to the light card. Pressing in the middle will toggle
Ok, will try to do that
Take a look at the thermostat card:
There was a plan to redesign it, but I think that for now, you can mimic the design by adding functional buttons on the bottom.
Hi @Misiu
This was my original idea. But then I realized that since we only have two options (on-off) it would be visually better to replace them with a switch.
Now I am trying to do something like what @zsarnett suggested:
It's not the final design though and since I am not a web developer, I am not fast at these things.
@zsarnett Please check now
No mouse-over:
Mouse-over:
Mouse-press:
Fixes #11327
@zsarnett Any chance it could make it to 2022.10? :)
@matthiasdebaat could you take a look at this?
Can you center align the circle to the value? (Left current, right is suggestion)
Mouse-over:
The hover state on dark mode is hardly visible, it is consistent with the light card though. Can you make it a bit more visible on both?
Sure I can do that, but let me first explain my design decisions.
I wanted the circle to be centered inside the round slider, even moved the number slightly down to fit it inside, and the hover state I chose to be consistent with the light card:
Yeah, both ways doesn't really fit: circle isn't in the center of the slider or the percentage isn't centred.
In this case I would suggest to focus on the percentage, because the circle surrounds it and got the most attention value compared to the slider.
@matthiasdebaat Done all your suggestions, and also made the round slider grey when the humidifier is off. Please check.
A few screenshots for the bait:
Hover:
Pressed:
Off:
Light theme:
Once this is merged, I have a couple of other cool features for the humidifier card coming up...
@matthiasdebaat Done all your suggestions, and also made the round slider grey when the humidifier is off. Please check.
Looks good, thanks! (sorry was away the last couple of days)