flixlix / power-flow-card-plus

A power distribution card inspired by the official Energy Distribution card for Home Assistant
501 stars 59 forks source link

[BUG] v0.2.2: Individual 1 doesn't show unit of measurement when 0 #597

Open cpohli opened 2 months ago

cpohli commented 2 months ago

Describe the bug Now that (thanks to #567) the display zero is shown, it is missing the unit of measurement when the value actually IS zero.

Expected behavior Even when the secondary sensor value is zero, the 0 AND unit of measurement should be shown.

Screenshots

image

My code is looking like this:

          individual:
            - entity: sensor.smaev_3013072337_charging_station_power
              unit_white_space: true
              name: Wallbox
              display_zero: true
              secondary_info:
                display_zero: true
                unit_white_space: true
                unit_of_measurement: 'kWh'
                decimals: 1
                accept_negative: false
                entity: sensor.wallbox_daily_kwh
              icon: mdi:car-arrow-left
              color_icon: false
              color:
                - 221
                - 14
                - 24

Please make sure all of this applies and check the checkboxes, by writing "X" inside of them.

ma9mwah commented 2 months ago

Just about to post the same, when 0 the unit is ignored.

image image

dr3amr commented 2 months ago

@flixlix Same issue here, unit_of_measurement not displayed when value is 0 (display_zero: true).

image

philippk80 commented 2 months ago

I can confirm this too. image