Mealie - Add example template sensor and tip (#33704)

* Add example and tip

* Update source/_integrations/mealie.markdown

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Correct capitlization

* Refine example template sensor

* Typos

* Remove quotes

They don't render in a details section

* Fix line wrap

* Update services to actions

* Tiny tweak

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Andrew Jackson 2024-07-19 09:49:04 +01:00 committed by GitHub
parent 0eae99acab
commit c0611608da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,4 +81,40 @@ Import the recipe into Mealie from a URL.
|------------------------|----------|-----------------------------------------------------------------|
| `config_entry_id` | No | The ID of the Mealie config entry to get data from. |
| `url` | No | The URL of the recipe. |
| `include_tags` | Yes | Include tags from the website to the recipe. (false by default) |
| `include_tags` | Yes | Include tags from the website to the recipe. (false by default) |
{% tip %}
You can get your `config_entry_id` by using actions within [Developer Tools](/docs/tools/dev-tools/), using one of the above actions and viewing the YAML.
{% endtip %}
## Examples
{% details "Example template sensor using get_mealplan" %}
Example template sensor that contains today's dinner meal plan entries:
{% raw %}
```yaml
template:
- trigger:
- platform: time_pattern
hours: /1
action:
- service: mealie.get_mealplan
data:
config_entry_id: YOUR_MEALIE_CONFIG_ENTITY_ID
response_variable: result
sensor:
- name: "Dinner today"
unique_id: mealie_dinner_today
state: >
{% for meal in result.mealplan if meal.entry_type == "dinner" -%}
{{ meal.recipe['name'] if meal.recipe is not none else meal.title }}
{{ ", " if not loop.last }}
{%- endfor %}
```
{% endraw %}
{% enddetails %}