Skip to content

Order the output of the automation editor#14019

Merged
balloob merged 2 commits intodevfrom
automation-editor
Apr 23, 2018
Merged

Order the output of the automation editor#14019
balloob merged 2 commits intodevfrom
automation-editor

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Apr 20, 2018

Description:

The automation editor lost the ordering of the keys, making it crazy confusing for people trying to edit the YAML by hand.

Example entry for automation.yaml (if applicable):

- id: '1524244793854'
  alias: Test automation 2
  trigger:
  - entity_id: light.hue_white_lamp_1
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - event: hello
    event_data: {}

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

if key in new_value:
updated_value[key] = new_value[key]

# We cover all fields above, but just in case we start supporting more fields
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (85 > 79 characters)

'action': [],
}
assert written[0] == orig_data

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line at end of file

"""Test Automation config panel."""
import asyncio
import json
from unittest.mock import patch, MagicMock
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'unittest.mock.MagicMock' imported but unused

@@ -0,0 +1,85 @@
"""Test Automation config panel."""
import asyncio
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'asyncio' imported but unused

@balloob balloob added this to the 0.68 milestone Apr 23, 2018
@balloob balloob merged commit 5ed73fe into dev Apr 23, 2018
@balloob balloob deleted the automation-editor branch April 23, 2018 17:47
balloob added a commit that referenced this pull request Apr 25, 2018
* Order the output of the automation editor

* Lint
@balloob balloob mentioned this pull request Apr 27, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants