frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Scripting: Comments put in YAML get removed once editing in visual editor

Open ant-ds opened this issue 3 years ago • 1 comments

Checklist

  • [X] I have updated to the latest available Home Assistant version.
  • [X] I have cleared the cache of my browser.
  • [X] I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

When making a script and switching to YAML, you can add comments by using # in the beginning of a line. When going back to visual editor, and later switching to YAML again, the comments are gone.

Describe the behavior you expected

When going back to YAML after visual editor, comments should still be there.

Steps to reproduce the issue

  1. Create new script (for example: to turn on light)
  2. Open in YAML
  3. Add comment using #
  4. Go back to visual editor
  5. Save script
  6. Open script again
  7. Open in YAML => No comments anymore

What version of Home Assistant Core has the issue?

2022.7.4

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Microsoft Edge 103.0.1264.62

Which operating system are you using to run this browser?

Windows 11

State of relevant entities

Script

Problem-relevant frontend configuration

alias: Example
sequence:
  ## This comment will disappear once we reopen in YAML later
  - type: turn_off
    device_id: 123
    entity_id: light.light1
    domain: light
mode: single

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

ant-ds avatar Jul 18 '22 08:07 ant-ds

this is true and also valid for automation's, this is a problem from the earlier versions of ha that nobody bother to report or fix, I overcome this by making different files for script/automation one for the ones I'll edit via the UI (empty anyway but the possibility exists) and one for the yaml ones (via directory)

hellcry37 avatar Aug 02 '22 10:08 hellcry37

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 31 '22 11:10 github-actions[bot]