💾 Archived View for gem.lizsugar.me › projects › hass › slider-button-card.gmi captured on 2024-08-18 at 17:29:21. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-07-08)

-=-=-=-=-=-=-

Slider Button Card

// June 2, 2022

My modifications to the original Slider Button Card by mattieha for Home Assistant.

Github: Slider Button Card by mattieha

Github: Slider Button Card fork by Liz Sugar

I forked this from an abandoned project because it was so close to meeting my needs and just needed some tweaking to get there. I think my biggest contribution to the card was **Relative Position Sliding**. The previous version would move the slider instantly to the position of your thumb or mouse cursor, which made it really hard to do fine adjustments to the existing value (especially on mobile). Now you can grab the slider and it won't snap to your touch/click position, but rather stay there and move in relation to the movement of your thumb or mouse. This makes fine adjustments of the existing value much easier, and it is still very intuitive to make sweeping changes to the value. Part of this included adding an always available **tap action** for added functionality. Previously, enabling a tap action disabled the sliding, which limited usage of the card. With this change, you can both slide to change value and tap to perform a separate action (usually toggle or more info).

The other most obvious change is **visual changes** to make it look a lot more like the (now older style) Google Home cards (which also feature the functionality choices from above). This is entirely my personal preference, but as part of this work I also added functionality for a **user-defined secondary attribute** to be displayed (previously it was fixed by entity domain).

Otherwise, I also added **new domain support** which includes tap-only support for: scenes, sensors, binary_sensors, automation, scripts domains; and slider support for: input number domain. The primary reason to add tap-only support to _Slider_ Button Card is for visual consistency. Building a Home Assistant interface using the same card for as much as possible provides a uniform look and consistent expectations for interaction.

I met most of my own goals for the project and fell out of it a bit, but there are some bugs I would like to come back to and resolve.

linked tags

#home assistant

-=-=-=-=-=-=-=-=-=-

View this page on web