Editor deletes comments

Why does the HA built in YAML editor delete comments? Comments in code are good. For example I had a watering script that triggered every other day, and I commented out that part so it would trigger every day for the summer. Now I want to change it back but the commented part is gone. :slightly_frowning_face:

It’s just a technical reason, the way we pass around data in the visual editor does not allow for the arbitrary text entered into the yaml editor to be preserved, it can only keep the structured object data.

We’re not just deleting them out of spite, but just understand that it would be likely very difficult to provide the same visual editor functionality we have today and also preserve an exact copy of what you enter into the yaml editor. Probably require a significant rewrite of a large amount of the frontend code.

If for a script, use the alias field where possible to keep your comments as part of the script object data itself, those will be preserved and visible in the editor.

2 Likes