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

Lovelace card configuration gets scrambled/reordered #2601

Closed
ghost opened this issue Jan 28, 2019 · 4 comments
Closed

Lovelace card configuration gets scrambled/reordered #2601

ghost opened this issue Jan 28, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 28, 2019

@rs443 commented on Jan 26, 2019, 8:03 AM UTC:

Home Assistant release with the issue:
0.86

Last working Home Assistant release (if known):
N/A

Operating environment (Hass.io/Docker/Windows/etc.):
Home Assistant on Windows 10, Python 3.6.8

Component/platform:
Lovelace UI

Description of problem:
I started using lovelace in the gui in the 0.86 release. I noticed a cosmetic "issue". When editing a card the lines in the configuration is scrambled. . The configuration is still valid but the lines has switched places. Possibly reordered alphabetically.

This makes is hard to edit a card in the editor, sometimes impossible.

This is an easy example of a card that was created and is readable and easy to understand:

type: horizontal-stack
cards:
  - type: sensor
    entity: sensor.inside_temperature
    detail: 1
    graph: line
    hours_to_show: 24
  - type: sensor
    entity: sensor.outside_temperature
    detail: 1
    graph: line
    hours_to_show: 24

When editing the same card this is the result:

cards:
  - detail: 1
    entity: sensor.inside_temperature
    graph: line
    hours_to_show: 24
    type: sensor
  - detail: 1
    entity: sensor.outside_temperature
    graph: line
    hours_to_show: 24
    type: sensor
type: horizontal-stack

Here is a more complex card that was once readable:

type: horizontal-stack
cards:
  - type: entity-filter
    entities:
      - device_tracker.iphone1
      - device_tracker.iphone2
    show_empty: false
    state_filter:
      - home
    card:
      type: glance
      show_name: false
      show_state: true
      title: Family
  - type: entity-filter
    entities:
      - device_tracker.iphone2
    show_empty: false
    state_filter:
      - not_home
    card:
      type: map
      entities:
        - entity: device_tracker.iphone2
      default_zoom: 12
  - type: entity-filter
    entities:
      - device_tracker.iphone2
    show_empty: false
    state_filter:
      - not_home
    card:
      type: map
      entities:
        - entity: device_tracker.iphone2
      default_zoom: 12

Now its a nightmare to edit:

cards:
  - card:
      show_name: false
      show_state: true
      title: Family
      type: glance
    entities:
      - device_tracker.iphone1
      - device_tracker.iphone2
    show_empty: false
    state_filter:
      - home
    type: entity-filter
  - card:
      default_zoom: 12
      entities:
        - entity: device_tracker.iphone1
      type: map
    entities:
      - device_tracker.iphone1
    show_empty: false
    state_filter:
      - not_home
    type: entity-filter
  - card:
      default_zoom: 12
      entities:
        - entity: device_tracker.iphone2
      type: map
    entities:
      - device_tracker.iphone2
    show_empty: false
    state_filter:
      - not_home
    type: entity-filter
type: horizontal-stack

It is possible to save the configuration without reordering the values?

This issue was moved by cgarwood from home-assistant/home-assistant#20450.

@ghost
Copy link
Author

ghost commented Jan 28, 2019

@cgarwood commented on Jan 28, 2019, 12:54 AM UTC:

Moving this to the frontend repo so it can get more visibility

/move to home-assistant-polymer

@balloob
Copy link
Member

balloob commented Jan 28, 2019

The cause is simple, we don't store the config in yaml format but in json.

The solution is not simple (I know of none)

@iantrich
Copy link
Member

iantrich commented Mar 9, 2019

Going to move this to ui-schema as this is not really a bug, but a preference

@ghost
Copy link
Author

ghost commented Mar 9, 2019

This issue was moved by iantrich to home-assistant/ui-schema#248.

@ghost ghost closed this as completed Mar 9, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants