UI-Lovelace-Minimalist / UI

UI-Lovelace-Minimalist is a "theme" for HomeAssistant
https://ui-lovelace-minimalist.github.io/UI/
Other
1.58k stars 423 forks source link

Display Precision not Updating in Chip Cards #1313

Open IMakeTP opened 1 year ago

IMakeTP commented 1 year ago

Describe the bug Similar to the issue with Mushroom, Minimalist chip cards are not updating with precision adjustments made within HA UI. https://github.com/home-assistant/frontend/issues/15582

To Reproduce

yaml code: type: 'custom:button-card' template: chip_icon_label label: > [[[ return states['sensor.meater_probe_ambient'].state + "°F / " + states['sensor.meater_probe_internal'].state + "°F" ]]] icon: mdi:grill color: "var(--google-red)"

image

Expected behavior Temperature display should be with zero significant digits

Screenshots image

Additional context Add any other context about the problem here.

basbruss commented 1 year ago

@IMakeTP This is more of a bug added by HA to custom:button-card.

The next release will handle display precision for cards that work with the translation engine. #1314 Note: This does not include all chips and custom templates like you built in the example.

andyblac commented 1 year ago

how would use it for example above

label: '[[[ return states["sensor.front_garden_motion_sensor_temperature"].state + "°C" ]]]'
basbruss commented 1 year ago

how would use it for example above

label: '[[[ return states["sensor.front_garden_motion_sensor_temperature"].state + "°C" ]]]'

It would not work without globally setting the entity. So the minimal things you need to have in your card/chip is:

template:
  - ulm_translation_engine
entity: sensor.front_garden_motion_sensor_temperature
label: "[[[ return variables.ulm_translation_state_unit ]]]"

display precision for cards that work with the translation engine

You will need to have the label rendered by the translation engine, which requires the globally set entity