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

SyntaxError: The string did not match the expected pattern #199

Closed
4 tasks done
Mariusthvdb opened this issue Apr 30, 2022 · 1 comment
Closed
4 tasks done

SyntaxError: The string did not match the expected pattern #199

Mariusthvdb opened this issue Apr 30, 2022 · 1 comment

Comments

@Mariusthvdb
Copy link

Mariusthvdb commented Apr 30, 2022

My Home Assistant version: 2022.6.0.dev20220430

My lovelace configuration method (GUI or yaml): Yaml

What I am doing:

card-mod-theming an icon in a view/tab

What I expected to happen:

icon change

What happened instead:

no icon change because of space in the view title

Minimal steps to reproduce:

# The least amount of code possible to reproduce my error
    card-mod-root-yaml: |
      paper-tab[aria-label='Weer & Klimaat'] ha-icon$: |
        ha-svg-icon {
          --card-mod-icon: {{states('sensor.weather_icon')}};
          color: {{states('sensor.temperature_color_name')}};
        }
# End of code

doesn't matter if I simply add mdi:car; its not about the icon template, its really about the view title (aria-label), because:

      paper-tab[aria-label='Alarm'] ha-icon$: |
        ha-svg-icon {
          --card-mod-icon: {{states('sensor.alarm_panel_icon')}};
          color: {{states('sensor.alarm_panel_icon_color')}};
        }

works perfectly.

Error messages from the browser console:
Schermafbeelding 2022-04-30 om 10 42 03

I have also tested it under:

      .: |
        /* Set the color of individual tabs. */
        paper-tab[aria-label='Weer & Klimaat'] {
          color: {{states('sensor.temperature_color_name')}};
        }

but in that section, only the colors change, and not the icons. But it does accept the white space in the label without problem.

Finally, I also tried the space indicator &nbsp to have it evaluate

 paper-tab[aria-label='Weer&nbsp&&nbspKlimaat']

but that took the instance down ....

only way to make it happen is to tie the words with a -

      paper-tab[aria-label='Settings-motion'] ha-icon$: |
        ha-svg-icon {
          --card-mod-icon: mdi:car;
          color: {{'red' if is_state('binary_sensor.motion_sensors_all','on')}};
        }

Please have a look if this can be fixed

By putting an X in the boxes ([]) below, I indicate that I:

  • Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

  • Have made sure I am using the latest version of the plugin.

  • Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

  • Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

@Mariusthvdb
Copy link
Author

closing as I have changed card-mod-themes and modern card-mod no longer logs these syntax errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant