Release v1.2.1
Piotras Smart Button — Release Notes v1.2.1
🐛 Bug Fixes
Battery icon without entity_battery_state
Fixed a bug where the battery icon (which dynamically changes based on charge level) was not displayed when the sensor had device_class: battery but no separate entity_battery_state was provided. The card now automatically detects the battery sensor and updates the icon without any additional configuration.
# entity alone is now sufficient — icon works automatically
entity: sensor.lenovo_battery_levelPower bar — correct gradient at partial fill
Fixed a bug where the power bar gradient (green→yellow→red) always appeared fully filled at 100% regardless of the actual value. Restored dynamic background-size calculation both on initial render and on every state update.
⚡ Performance Optimizations
Changes aimed at improving scroll smoothness with a larger number of cards on the dashboard (tested with 25 cards).
Removed clip-path from .card
Replaced with will-change: transform. The combination of clip-path and an external box-shadow caused the browser to create a separate compositor layer for each card, significantly increasing GPU load during scrolling.
Removed backdrop-filter: blur from inner elements
Removed background blur from .icon-wrap, .slider-zone and .service-bar-zone. The backdrop-filter effect is computationally expensive and caused noticeable slowdowns when many cards were visible simultaneously.
Shortened transition: filter on .card-bg
Background filter transition duration reduced from 0.4s to 0.25s and will-change: filter added for better browser-side optimization.
🎨 Visual Changes
Removing backdrop-filter from the icon circle and the bottom bar results in a minimal visual difference — these elements are now "solid" instead of frosted glass. The change is barely noticeable during normal use and is a justified trade-off in favor of performance.