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

Regex_search and Regex_match are filters, not tests #44833

Closed
mdegat01 opened this issue Jan 5, 2021 · 2 comments
Closed

Regex_search and Regex_match are filters, not tests #44833

mdegat01 opened this issue Jan 5, 2021 · 2 comments
Labels

Comments

@mdegat01
Copy link
Contributor

mdegat01 commented Jan 5, 2021

The problem

The added filters of regex_search and regex_match are not jinja tests even though they return a boolean. This means they cannot be used in a select or selectattr expression even though it makes sense to do so. This is what you see if you try:
Screen Shot 2021-01-05 at 12 48 31 AM

These should become jinja tests so they can be used in this way. For reference, Ansible added these same options to Jinja and they added them as tests (see here).

Environment

  • Home Assistant Core release with the issue: 2020.12.7
  • Last working Home Assistant Core release (if known):
  • Operating environment (OS/Container/Supervised/Core): Home Assistant OS 5.9
  • Integration causing this issue:
  • Link to integration documentation on our website: https://www.home-assistant.io/docs/configuration/templating/

Problem-relevant configuration.yaml

{{ states.binary_sensor | selectattr('entity_id', 'regex_search', '_update_available$') | list }}

Traceback/Error logs

TemplateRuntimeError: no test named 'regex_search'

Additional information

@frenck
Copy link
Member

frenck commented Jan 5, 2021

Thank you for reaching out. We use GitHub for tracking issues, not for providing support or tracking feature requests.

If you want to suggest a feature, you should try our Community Forum: Feature Requests.

If you have additional questions, feel free to join our Discord chat server.

Thanks! 👍

@github-actions
Copy link

github-actions bot commented Apr 5, 2021

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 github-actions bot added the stale label Apr 5, 2021
@frenck frenck closed this as completed Apr 5, 2021
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants