Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format: inconsistancy with "last-chaged" & "last-updated" #305

Open
ildar170975 opened this issue May 30, 2023 · 1 comment
Open

Format: inconsistancy with "last-chaged" & "last-updated" #305

ildar170975 opened this issue May 30, 2023 · 1 comment

Comments

@ildar170975
Copy link

Assume we need to show a last-changed (or last-updated) inside a secondary_info with some formatter like datetime.

Consider this card:

      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: sun.sun
        show_state: false
        secondary_info:
          attribute: last-changed
          format: datetime

      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: sun.sun
        show_state: false
        secondary_info:
          attribute: last-updated
          format: datetime

      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: sun.sun
        show_state: false
        secondary_info:
          attribute: last_changed
          format: datetime

      - type: custom:multiple-entity-row
        entity: sun.sun
        entities:
          - entity: sun.sun
        show_state: false
        secondary_info:
          attribute: last_updated
          format: datetime

image

What we can see here:

  1. If attribute is specified like last-changed - then format is ignored.
  2. If attribute is specified like last_changed - then format is applied.

According to Docs, the last-changed name must be used.

@ildar170975 ildar170975 changed the title secondary-info: inconsistancy with "last-chaged" & "last-updated" Format: inconsistancy with "last-chaged" & "last-updated" May 31, 2023
@ildar170975
Copy link
Author

Same for formatting these attributes inside "entities":

      - type: custom:multiple-entity-row
        entity: sun.sun
        secondary_info: format default
        entities:
          - attribute: last-changed
            name: last-changed
          - attribute: last-updated
            name: last-updated
        show_state: false
      - type: custom:multiple-entity-row
        entity: sun.sun
        secondary_info: format datetime
        entities:
          - attribute: last-changed
            name: last-changed
            format: datetime
          - attribute: last-updated
            name: last-updated
            format: datetime
        show_state: false
      - type: custom:multiple-entity-row
        entity: sun.sun
        secondary_info: format total
        entities:
          - attribute: last-changed
            name: last-changed
            format: total
          - attribute: last-updated
            name: last-updated
            format: total
        show_state: false
      - type: custom:multiple-entity-row
        entity: sun.sun
        secondary_info: format datetime
        entities:
          - attribute: last_changed
            name: last_changed
            format: datetime
          - attribute: last_updated
            name: last_updated
            format: datetime
        show_state: false
      - type: custom:multiple-entity-row
        entity: sun.sun
        secondary_info: format total
        entities:
          - attribute: last_changed
            name: last_changed
            format: total
          - attribute: last_updated
            name: last_updated
            format: total
        show_state: false

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant