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

Config editor for Automation and Scripts messes up with templates #33441

Closed
mikalauskas opened this issue Mar 30, 2020 · 2 comments
Closed

Config editor for Automation and Scripts messes up with templates #33441

mikalauskas opened this issue Mar 30, 2020 · 2 comments

Comments

@mikalauskas
Copy link

mikalauskas commented Mar 30, 2020

The problem

Config editor for Automation and Scripts messes up with templates
It changes " (double mark) to ' (one single mark)
and
' (one single mark) to '' (two single marks)
which causes value_template or any other template invalid (no errors but doesn't work)

Also if value_template or any other template is very long, it adds \n and whitespaces with messed up quote marks

Environment

  • Home Assistant release with the issue: 0.107.6
  • Last working Home Assistant release (if known): none
  • Operating environment (Hass.io/Docker/Windows/etc.): Linux, Python3.8.0 virtualenv
  • Integration causing this issue: components.config
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/config

Problem-relevant configuration.yaml

### Before using Config Editor
...
    - condition: template
      value_template: "{{ states('media_player.media_livingroom') != 'playing' and states('media_player.media_livingroom') != 'paused' }}"
...
###

### After using Config Editor
...
    - condition: template
      value_template: '{{ states(''media_player.media_livingroom'') != ''playing'' and states(''media_player.media_livingroom'') != ''paused'' }}'
...
###

Traceback/Error logs

Additional information

Also with this too:

### Before using Config Editor
...
    - condition: state
      entity_id: sensor.sun
      state: "sunset"
...
###

### After using Config Editor
...
    - condition: state
      entity_id: sensor.sun
      state: ''sunset''
...
###
@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this issue as its been labeled with a integration (config) you are listed as a codeowner for? Thanks!

@frenck
Copy link
Member

frenck commented Mar 30, 2020

Duplicate of home-assistant/frontend#5038

@frenck frenck marked this as a duplicate of home-assistant/frontend#5038 Mar 30, 2020
@frenck frenck closed this as completed Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants