Skip to content

Commit

Permalink
Doc formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Jan 24, 2025
1 parent cc0ef0a commit b8ff068
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions docs/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,20 @@ cards:
- type: markdown
content: |-
{% set search_term = states('input_text.battery_search') | upper %}
{% if search_term != "" %}
{% set devices = states | selectattr('attributes.battery_type', 'defined')
| selectattr('entity_id', 'search', '_battery_plus$') | list %}
{% set matching_devices = devices | selectattr('attributes.battery_type', 'string')
| selectattr('attributes.battery_type', 'eq', search_term)
| map(attribute='name') | unique | list %}
{% if matching_devices | length > 0 %}
{{ matching_devices | join('\n') }}
{% else %}
No devices with such battery type
{% endif %}
{% else %}
Search result
{% endif %}
{% if search_term != "" %}
{% set devices = states | selectattr('attributes.battery_type', 'defined')
| selectattr('entity_id', 'search', '_battery_plus$') | list %}
{% set matching_devices = devices | selectattr('attributes.battery_type', 'string')
| selectattr('attributes.battery_type', 'eq', search_term)
| map(attribute='name') | unique | list %}
{% if matching_devices | length > 0 %}
{{ matching_devices | join('\n') }}
{% else %}
No devices with such battery type
{% endif %}
{% else %}
Search result
{% endif %}
```
![search example](./assets/screenshot-battery-search.png)
Expand Down

0 comments on commit b8ff068

Please sign in to comment.