home-assistant / ui-schema

A schema to define a user interface for Home Assistant.
Apache License 2.0
41 stars 6 forks source link

Lovelace card configuration gets scrambled/reordered #248

Closed ghost closed 5 years ago

ghost commented 5 years ago

move[bot] commented on Jan 28, 2019, 12:54 AM UTC:

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.

This issue was moved by iantrich from home-assistant/home-assistant-polymer#2601.

ghost commented 5 years ago

move[bot] commented on Jan 28, 2019, 12:54 AM UTC:

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

ghost commented 5 years ago

@balloob commented on Jan 28, 2019, 1:08 AM UTC:

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)

ghost commented 5 years ago

@iantrich commented on Mar 9, 2019, 9:08 PM UTC:

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

corbosman commented 5 years ago

I really hope something can be done about this. Once you start adding multiple stacks, it becomes absolutely horrendous to edit because of this problem.

ghost commented 5 years ago

This issue was moved by iantrich to home-assistant/home-assistant-polymer#3913.