benct / lovelace-multiple-entity-row

Show multiple entity states and attributes on entity rows in Home Assistant's Lovelace UI
MIT License
813 stars 63 forks source link

"invert", "kilo" & "posiition" formatters: precision is lost #304

Open ildar170975 opened 1 year ago

ildar170975 commented 1 year ago

There is an input_number entity: image

Consider this card:

  - type: entities
    entities:
      - entity: input_number.test_negative_1
        name: test value

      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: input_number.test_negative_1
            name: unformatted
        show_state: false

      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: input_number.test_negative_1
            name: invert
            format: invert
        show_state: false

image

The entity has ".xxxx" precision, the inverted value has ".xx" precision.


Example with a template sensor: image

type: entities
entities:
  - entity: sensor.test_value
    name: test value
  - type: custom:multiple-entity-row
    entity: sun.sun
    entities:
      - entity: sensor.test_value
        name: unformatted
    show_state: false
  - type: custom:multiple-entity-row
    entity: sun.sun
    entities:
      - entity: sensor.test_value
        name: invert
        format: invert
    show_state: false

image

Same - precision changed to ".xx".

ildar170975 commented 1 year ago

Same about kilo & position formatters:

    type: entities
    entities:
      - entity: sensor.test_value
        name: test value
      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: sensor.test_value
            name: unformatted
        show_state: false
      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: sensor.test_value
            name: kilo
            format: kilo
        show_state: false
      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: sensor.test_value
            name: position
            format: position
        show_state: false

image