Add diagnostics to Mealie (#121700)
This commit is contained in:
parent
5dbf907323
commit
1e0c03257c
3 changed files with 546 additions and 0 deletions
31
homeassistant/components/mealie/diagnostics.py
Normal file
31
homeassistant/components/mealie/diagnostics.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
"""Diagnostics support for the Mealie integration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import asdict
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import MealieConfigEntry
|
||||
|
||||
|
||||
async def async_get_config_entry_diagnostics(
|
||||
hass: HomeAssistant, config_entry: MealieConfigEntry
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a config entry."""
|
||||
data = config_entry.runtime_data
|
||||
|
||||
about = await data.client.get_about()
|
||||
|
||||
return {
|
||||
"about": asdict(about),
|
||||
"mealplans": {
|
||||
entry_type: [asdict(mealplan) for mealplan in mealplans]
|
||||
for entry_type, mealplans in data.mealplan_coordinator.data.items()
|
||||
},
|
||||
"shoppinglist": {
|
||||
list_id: [asdict(item) for item in shopping_list]
|
||||
for list_id, shopping_list in data.shoppinglist_coordinator.data.items()
|
||||
},
|
||||
}
|
487
tests/components/mealie/snapshots/test_diagnostics.ambr
Normal file
487
tests/components/mealie/snapshots/test_diagnostics.ambr
Normal file
|
@ -0,0 +1,487 @@
|
|||
# serializer version: 1
|
||||
# name: test_entry_diagnostics
|
||||
dict({
|
||||
'about': dict({
|
||||
'version': 'v1.10.2',
|
||||
}),
|
||||
'mealplans': dict({
|
||||
'breakfast': list([
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'breakfast',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 229,
|
||||
'recipe': dict({
|
||||
'description': 'The BEST Roast Chicken recipe is simple, budget friendly, and gives you a tender, mouth-watering chicken full of flavor! Served with roasted vegetables, this recipe is simple enough for any cook!',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'JeQ2',
|
||||
'name': 'Roast Chicken',
|
||||
'original_url': 'https://tastesbetterfromscratch.com/roast-chicken/',
|
||||
'recipe_id': '5b055066-d57d-4fd0-8dfd-a2c2f07b36f1',
|
||||
'recipe_yield': '6 servings',
|
||||
'slug': 'roast-chicken',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
]),
|
||||
'dinner': list([
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-22',
|
||||
}),
|
||||
'mealplan_id': 230,
|
||||
'recipe': dict({
|
||||
'description': "Een traybake is eigenlijk altijd een goed idee. Deze zoete aardappel curry traybake dus ook. Waarom? Omdat je alleen maar wat groenten - en in dit geval kip - op een bakplaat (traybake dus) legt, hier wat kruiden aan toevoegt en deze in de oven schuift. Ideaal dus als je geen zin hebt om lang in de keuken te staan. Maar gewoon lekker op de bank wil ploffen om te wachten tot de oven klaar is. Joe! That\\'s what we like. Deze zoete aardappel curry traybake bevat behalve zoete aardappel en curry ook kikkererwten, kippendijfilet en bloemkoolroosjes. Je gebruikt yoghurt en limoen als een soort dressing. En je serveert deze heerlijke traybake met naanbrood. Je kunt natuurljk ook voor deze traybake met chipolataworstjes gaan. Wil je graag meer ovengerechten? Dan moet je eigenlijk even kijken naar onze Ovenbijbel. Onmisbaar in je keuken! We willen je deze zoete aardappelstamppot met prei ook niet onthouden. Megalekker bordje comfortfood als je \\'t ons vraagt.",
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'AiIo',
|
||||
'name': 'Zoete aardappel curry traybake',
|
||||
'original_url': 'https://chickslovefood.com/recept/zoete-aardappel-curry-traybake/',
|
||||
'recipe_id': 'c5f00a93-71a2-4e48-900f-d9ad0bb9de93',
|
||||
'recipe_yield': '2 servings',
|
||||
'slug': 'zoete-aardappel-curry-traybake',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 222,
|
||||
'recipe': dict({
|
||||
'description': 'Εύκολη μακαρονάδα με κεφτεδάκια στον φούρνο από τον Άκη Πετρετζίκη. Φτιάξτε την πιο εύκολη μακαρονάδα με κεφτεδάκια σε μόνο ένα σκεύος.',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'En9o',
|
||||
'name': 'Εύκολη μακαρονάδα με κεφτεδάκια στον φούρνο (1)',
|
||||
'original_url': 'https://akispetretzikis.com/recipe/7959/efkolh-makaronada-me-keftedakia-ston-fourno',
|
||||
'recipe_id': 'f79f7e9d-4b58-4930-a586-2b127f16ee34',
|
||||
'recipe_yield': '6 servings',
|
||||
'slug': 'eukole-makaronada-me-kephtedakia-ston-phourno-1',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 221,
|
||||
'recipe': dict({
|
||||
'description': 'Delicious Greek turkey meatballs with lemon orzo, tender veggies, and a creamy feta yogurt sauce. These healthy baked Greek turkey meatballs are filled with tons of wonderful herbs and make the perfect protein-packed weeknight meal!',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'Kn62',
|
||||
'name': 'Greek Turkey Meatballs with Lemon Orzo & Creamy Feta Yogurt Sauce',
|
||||
'original_url': 'https://www.ambitiouskitchen.com/greek-turkey-meatballs/',
|
||||
'recipe_id': '47595e4c-52bc-441d-b273-3edf4258806d',
|
||||
'recipe_yield': '4 servings',
|
||||
'slug': 'greek-turkey-meatballs-with-lemon-orzo-creamy-feta-yogurt-sauce',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 219,
|
||||
'recipe': dict({
|
||||
'description': 'This is a modified Pampered Chef recipe. You can use a trifle bowl or large glass punch/salad bowl to show it off. It is really easy to make and I never have any leftovers. Cook time includes chill time.',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'ibL6',
|
||||
'name': 'Pampered Chef Double Chocolate Mocha Trifle',
|
||||
'original_url': 'https://www.food.com/recipe/pampered-chef-double-chocolate-mocha-trifle-74963',
|
||||
'recipe_id': '92635fd0-f2dc-4e78-a6e4-ecd556ad361f',
|
||||
'recipe_yield': '12 servings',
|
||||
'slug': 'pampered-chef-double-chocolate-mocha-trifle',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-22',
|
||||
}),
|
||||
'mealplan_id': 217,
|
||||
'recipe': dict({
|
||||
'description': 'Cheeseburger Sliders are juicy, cheesy and beefy - everything we love about classic burgers! These sliders are quick and easy plus they are make-ahead and reheat really well.',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'beGq',
|
||||
'name': 'Cheeseburger Sliders (Easy, 30-min Recipe)',
|
||||
'original_url': 'https://natashaskitchen.com/cheeseburger-sliders/',
|
||||
'recipe_id': '8bdd3656-5e7e-45d3-a3c4-557390846a22',
|
||||
'recipe_yield': '24 servings',
|
||||
'slug': 'cheeseburger-sliders-easy-30-min-recipe',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 212,
|
||||
'recipe': dict({
|
||||
'description': 'This All-American beef stew recipe includes tender beef coated in a rich, intense sauce and vegetables that bring complementary texture and flavor.',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': '356X',
|
||||
'name': 'All-American Beef Stew Recipe',
|
||||
'original_url': 'https://www.seriouseats.com/all-american-beef-stew-recipe',
|
||||
'recipe_id': '48f39d27-4b8e-4c14-bf36-4e1e6497e75e',
|
||||
'recipe_yield': '6 servings',
|
||||
'slug': 'all-american-beef-stew-recipe',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-22',
|
||||
}),
|
||||
'mealplan_id': 211,
|
||||
'recipe': dict({
|
||||
'description': 'Einfacher Nudelauflauf mit Brokkoli, Sahnesauce und extra Käse. Dieses vegetarische 5 Zutaten Rezept ist super schnell gemacht und SO gut!',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'nOPT',
|
||||
'name': 'Einfacher Nudelauflauf mit Brokkoli',
|
||||
'original_url': 'https://kochkarussell.com/einfacher-nudelauflauf-brokkoli/',
|
||||
'recipe_id': '9d553779-607e-471b-acf3-84e6be27b159',
|
||||
'recipe_yield': '4 servings',
|
||||
'slug': 'einfacher-nudelauflauf-mit-brokkoli',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 196,
|
||||
'recipe': dict({
|
||||
'description': 'Simple to prepare and ready in 25 minutes, this vegetarian miso noodle recipe can be eaten on its own or served as a side.',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': '5G1v',
|
||||
'name': 'Miso Udon Noodles with Spinach and Tofu',
|
||||
'original_url': 'https://www.allrecipes.com/recipe/284039/miso-udon-noodles-with-spinach-and-tofu/',
|
||||
'recipe_id': '25b814f2-d9bf-4df0-b40d-d2f2457b4317',
|
||||
'recipe_yield': '2 servings',
|
||||
'slug': 'miso-udon-noodles-with-spinach-and-tofu',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-22',
|
||||
}),
|
||||
'mealplan_id': 195,
|
||||
'recipe': dict({
|
||||
'description': 'Avis aux nostalgiques des années 1980, la mousse de saumon est de retour dans une présentation adaptée au goût du jour. On utilise une technique sans faille : un saumon frais cuit au micro-ondes et mélangé au robot avec du fromage à la crème et de la crème sure. On obtient ainsi une texture onctueuse à tartiner, qui n’a rien à envier aux préparations gélatineuses d’antan !',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'rrNL',
|
||||
'name': 'Mousse de saumon',
|
||||
'original_url': 'https://www.ricardocuisine.com/recettes/8919-mousse-de-saumon',
|
||||
'recipe_id': '55c88810-4cf1-4d86-ae50-63b15fd173fb',
|
||||
'recipe_yield': '12 servings',
|
||||
'slug': 'mousse-de-saumon',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': 'Dineren met de boys',
|
||||
'entry_type': 'dinner',
|
||||
'group_id': '3931df86-0679-4579-8c63-4bedc9ca9a85',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-21',
|
||||
}),
|
||||
'mealplan_id': 1,
|
||||
'recipe': None,
|
||||
'title': 'Aquavite',
|
||||
'user_id': '6caa6e4d-521f-4ef4-9ed7-388bdd63f47d',
|
||||
}),
|
||||
]),
|
||||
'lunch': list([
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'lunch',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 226,
|
||||
'recipe': dict({
|
||||
'description': 'Te explicamos paso a paso, de manera sencilla, la elaboración de la receta de pollo al curry con leche de coco en 10 minutos. Ingredientes, tiempo de...',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'INQz',
|
||||
'name': 'Receta de pollo al curry en 10 minutos (con vídeo incluido)',
|
||||
'original_url': 'https://www.directoalpaladar.com/recetas-de-carnes-y-aves/receta-de-pollo-al-curry-en-10-minutos',
|
||||
'recipe_id': 'e360a0cc-18b0-4a84-a91b-8aa59e2451c9',
|
||||
'recipe_yield': '2 servings',
|
||||
'slug': 'receta-de-pollo-al-curry-en-10-minutos-con-video-incluido',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'lunch',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 224,
|
||||
'recipe': dict({
|
||||
'description': 'bourguignon, oignon, carotte, bouquet garni, vin rouge, beurre, sel, poivre',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'nj5M',
|
||||
'name': 'Boeuf bourguignon : la vraie recette (2)',
|
||||
'original_url': 'https://www.marmiton.org/recettes/recette_boeuf-bourguignon_18889.aspx',
|
||||
'recipe_id': '9c7b8aee-c93c-4b1b-ab48-2625d444743a',
|
||||
'recipe_yield': '4 servings',
|
||||
'slug': 'boeuf-bourguignon-la-vraie-recette-2',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'lunch',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-22',
|
||||
}),
|
||||
'mealplan_id': 216,
|
||||
'recipe': dict({
|
||||
'description': 'This All-American beef stew recipe includes tender beef coated in a rich, intense sauce and vegetables that bring complementary texture and flavor.',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': '356X',
|
||||
'name': 'All-American Beef Stew Recipe',
|
||||
'original_url': 'https://www.seriouseats.com/all-american-beef-stew-recipe',
|
||||
'recipe_id': '48f39d27-4b8e-4c14-bf36-4e1e6497e75e',
|
||||
'recipe_yield': '6 servings',
|
||||
'slug': 'all-american-beef-stew-recipe',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
]),
|
||||
'side': list([
|
||||
dict({
|
||||
'description': None,
|
||||
'entry_type': 'side',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'mealplan_date': dict({
|
||||
'__type': "<class 'datetime.date'>",
|
||||
'isoformat': '2024-01-23',
|
||||
}),
|
||||
'mealplan_id': 220,
|
||||
'recipe': dict({
|
||||
'description': 'Einfacher Nudelauflauf mit Brokkoli, Sahnesauce und extra Käse. Dieses vegetarische 5 Zutaten Rezept ist super schnell gemacht und SO gut!',
|
||||
'group_id': '0bf60b2e-ca89-42a9-94d4-8f67ca72b157',
|
||||
'image': 'nOPT',
|
||||
'name': 'Einfacher Nudelauflauf mit Brokkoli',
|
||||
'original_url': 'https://kochkarussell.com/einfacher-nudelauflauf-brokkoli/',
|
||||
'recipe_id': '9d553779-607e-471b-acf3-84e6be27b159',
|
||||
'recipe_yield': '4 servings',
|
||||
'slug': 'einfacher-nudelauflauf-mit-brokkoli',
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
'title': None,
|
||||
'user_id': '1ce8b5fe-04e8-4b80-aab1-d92c94685c6d',
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
'shoppinglist': dict({
|
||||
'27edbaab-2ec6-441f-8490-0283ea77585f': list([
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': True,
|
||||
'display': '2 Apples',
|
||||
'food_id': None,
|
||||
'is_food': False,
|
||||
'item_id': 'f45430f7-3edf-45a9-a50f-73bb375090be',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': 'Apples',
|
||||
'position': 0,
|
||||
'quantity': 2.0,
|
||||
'unit_id': None,
|
||||
}),
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': False,
|
||||
'display': '1 can acorn squash',
|
||||
'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5',
|
||||
'is_food': True,
|
||||
'item_id': '84d8fd74-8eb0-402e-84b6-71f251bfb7cc',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': '',
|
||||
'position': 1,
|
||||
'quantity': 1.0,
|
||||
'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a',
|
||||
}),
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': False,
|
||||
'display': 'aubergine',
|
||||
'food_id': '96801494-4e26-4148-849a-8155deb76327',
|
||||
'is_food': True,
|
||||
'item_id': '69913b9a-7c75-4935-abec-297cf7483f88',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': '',
|
||||
'position': 2,
|
||||
'quantity': 0.0,
|
||||
'unit_id': None,
|
||||
}),
|
||||
]),
|
||||
'e9d78ff2-4b23-4b77-a3a8-464827100b46': list([
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': True,
|
||||
'display': '2 Apples',
|
||||
'food_id': None,
|
||||
'is_food': False,
|
||||
'item_id': 'f45430f7-3edf-45a9-a50f-73bb375090be',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': 'Apples',
|
||||
'position': 0,
|
||||
'quantity': 2.0,
|
||||
'unit_id': None,
|
||||
}),
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': False,
|
||||
'display': '1 can acorn squash',
|
||||
'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5',
|
||||
'is_food': True,
|
||||
'item_id': '84d8fd74-8eb0-402e-84b6-71f251bfb7cc',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': '',
|
||||
'position': 1,
|
||||
'quantity': 1.0,
|
||||
'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a',
|
||||
}),
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': False,
|
||||
'display': 'aubergine',
|
||||
'food_id': '96801494-4e26-4148-849a-8155deb76327',
|
||||
'is_food': True,
|
||||
'item_id': '69913b9a-7c75-4935-abec-297cf7483f88',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': '',
|
||||
'position': 2,
|
||||
'quantity': 0.0,
|
||||
'unit_id': None,
|
||||
}),
|
||||
]),
|
||||
'f8438635-8211-4be8-80d0-0aa42e37a5f2': list([
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': True,
|
||||
'display': '2 Apples',
|
||||
'food_id': None,
|
||||
'is_food': False,
|
||||
'item_id': 'f45430f7-3edf-45a9-a50f-73bb375090be',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': 'Apples',
|
||||
'position': 0,
|
||||
'quantity': 2.0,
|
||||
'unit_id': None,
|
||||
}),
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': False,
|
||||
'display': '1 can acorn squash',
|
||||
'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5',
|
||||
'is_food': True,
|
||||
'item_id': '84d8fd74-8eb0-402e-84b6-71f251bfb7cc',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': '',
|
||||
'position': 1,
|
||||
'quantity': 1.0,
|
||||
'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a',
|
||||
}),
|
||||
dict({
|
||||
'checked': False,
|
||||
'disable_amount': False,
|
||||
'display': 'aubergine',
|
||||
'food_id': '96801494-4e26-4148-849a-8155deb76327',
|
||||
'is_food': True,
|
||||
'item_id': '69913b9a-7c75-4935-abec-297cf7483f88',
|
||||
'label_id': None,
|
||||
'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e',
|
||||
'note': '',
|
||||
'position': 2,
|
||||
'quantity': 0.0,
|
||||
'unit_id': None,
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
})
|
||||
# ---
|
28
tests/components/mealie/test_diagnostics.py
Normal file
28
tests/components/mealie/test_diagnostics.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
"""Test Mealie diagnostics."""
|
||||
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
from syrupy import SnapshotAssertion
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import setup_integration
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||
from tests.typing import ClientSessionGenerator
|
||||
|
||||
|
||||
async def test_entry_diagnostics(
|
||||
hass: HomeAssistant,
|
||||
hass_client: ClientSessionGenerator,
|
||||
mock_mealie_client: AsyncMock,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
"""Test config entry diagnostics."""
|
||||
await setup_integration(hass, mock_config_entry)
|
||||
assert (
|
||||
await get_diagnostics_for_config_entry(hass, hass_client, mock_config_entry)
|
||||
== snapshot
|
||||
)
|
Loading…
Add table
Reference in a new issue