From b5841189ddecb050a227c8ec12e5a80d5a81ed59 Mon Sep 17 00:00:00 2001 From: paulfantom Date: Sun, 15 Oct 2023 21:44:11 +0200 Subject: [PATCH] apps/homeassistant: test new meals sensors --- apps/homeassistant/config/configuration.yaml | 38 +++++++++++++++++++ .../manifests/homeassistant/configs.yaml | 38 +++++++++++++++++++ .../manifests/homeassistant/statefulSet.yaml | 2 +- 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/apps/homeassistant/config/configuration.yaml b/apps/homeassistant/config/configuration.yaml index ff3de6e5e..a71e63c1d 100644 --- a/apps/homeassistant/config/configuration.yaml +++ b/apps/homeassistant/config/configuration.yaml @@ -200,6 +200,44 @@ sensor: {% endfor %} {% endif %} + - platform: rest + name: meals_today + scan_interval: 3600 + headers: + content-type: application/json + authorization: !secret recipes_token + resource: https://recipes.krupa.net.pl/api/meal-plan + params: + from_date: > + {{ now().strftime("%Y-%m-%d") }} + to_date: > + {{ now().strftime("%Y-%m-%d") }} + json_attributes_path: "$.[0]" + json_attributes: + - date + - meal_type_name + - title + - recipe_name + + - platform: rest + name: meals_tomorrow + scan_interval: 3600 + headers: + content-type: application/json + authorization: !secret recipes_token + resource: https://recipes.krupa.net.pl/api/meal-plan + params: + from_date: > + {{ (now().date() + timedelta(days=1)).strftime("%Y-%m-%d") }} + to_date: > + {{ (now().date() + timedelta(days=1)).strftime("%Y-%m-%d") }} + json_attributes_path: "$.[0]" + json_attributes: + - date + - meal_type_name + - title + - recipe_name + #- name: we_wash_w1 # platform: imap_email_content # server: imap.gmail.com diff --git a/apps/homeassistant/manifests/homeassistant/configs.yaml b/apps/homeassistant/manifests/homeassistant/configs.yaml index ed1b3d158..1a34ee10a 100644 --- a/apps/homeassistant/manifests/homeassistant/configs.yaml +++ b/apps/homeassistant/manifests/homeassistant/configs.yaml @@ -203,6 +203,44 @@ data: {% endfor %} {% endif %} + - platform: rest + name: meals_today + scan_interval: 3600 + headers: + content-type: application/json + authorization: !secret recipes_token + resource: https://recipes.krupa.net.pl/api/meal-plan + params: + from_date: > + {{ now().strftime("%Y-%m-%d") }} + to_date: > + {{ now().strftime("%Y-%m-%d") }} + json_attributes_path: "$.[0]" + json_attributes: + - date + - meal_type_name + - title + - recipe_name + + - platform: rest + name: meals_tomorrow + scan_interval: 3600 + headers: + content-type: application/json + authorization: !secret recipes_token + resource: https://recipes.krupa.net.pl/api/meal-plan + params: + from_date: > + {{ (now().date() + timedelta(days=1)).strftime("%Y-%m-%d") }} + to_date: > + {{ (now().date() + timedelta(days=1)).strftime("%Y-%m-%d") }} + json_attributes_path: "$.[0]" + json_attributes: + - date + - meal_type_name + - title + - recipe_name + #- name: we_wash_w1 # platform: imap_email_content # server: imap.gmail.com diff --git a/apps/homeassistant/manifests/homeassistant/statefulSet.yaml b/apps/homeassistant/manifests/homeassistant/statefulSet.yaml index 417ea5667..8fa18f1b5 100644 --- a/apps/homeassistant/manifests/homeassistant/statefulSet.yaml +++ b/apps/homeassistant/manifests/homeassistant/statefulSet.yaml @@ -19,7 +19,7 @@ spec: template: metadata: annotations: - checksum.config/md5: 186af01be41ae4a1ee8806dfa07fe137 + checksum.config/md5: e66574d59851089e3da719e8a05628f6 labels: app.kubernetes.io/component: server app.kubernetes.io/name: homeassistant