benct / lovelace-multiple-entity-row

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

Handle or silence RangeError? #324

Open Floppe opened 6 months ago

Floppe commented 6 months ago

When an entity has UOM = c/kWh, then perhaps do not try to treat it as a currency so the debug console is not filled with errors?

RangeError: Invalid currency code : c/kWh at new NumberFormat (<anonymous>) at Mt (multiple-entity-row.js?hacstag=178921037450:1:19956) at multiple-entity-row.js?hacstag=178921037450:1:33612 at multiple-entity-row.js?hacstag=178921037450:1:34897 at c.value (multiple-entity-row.js?hacstag=178921037450:1:34932) at c.value (multiple-entity-row.js?hacstag=178921037450:1:31297) at multiple-entity-row.js?hacstag=178921037450:1:29878 at Array.map (<anonymous>) at c.value (multiple-entity-row.js?hacstag=178921037450:1:29852) at c.update (multiple-entity-row.js?hacstag=178921037450:1:14837)

ildar170975 commented 6 months ago

Consider posting your MINIMAL code causing the issue. Cannot reproduce it:

image

type: entities
entities:
  - type: custom:multiple-entity-row
    entity: zone.home
    unit: c/kWh
    entities:
      - entity: zone.home
        unit: c/kWh
  - type: custom:multiple-entity-row
    entity: sensor.test_unit
    entities:
      - entity: sensor.test_unit

image