diff --git a/homeassistant/components/mealie/manifest.json b/homeassistant/components/mealie/manifest.json index 21fe1b11197..0c53a302ebe 100644 --- a/homeassistant/components/mealie/manifest.json +++ b/homeassistant/components/mealie/manifest.json @@ -7,5 +7,5 @@ "integration_type": "service", "iot_class": "local_polling", "quality_scale": "platinum", - "requirements": ["aiomealie==1.2.0"] + "requirements": ["aiomealie==1.2.1"] } diff --git a/requirements_all.txt b/requirements_all.txt index e7f8e58439e..90ca027d976 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -324,7 +324,7 @@ aiolookin==1.0.0 aiolyric==2.0.2 # homeassistant.components.mealie -aiomealie==1.2.0 +aiomealie==1.2.1 # homeassistant.components.modern_forms aiomodernforms==0.1.8 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 1af1cfa1314..475a9b99d98 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -309,7 +309,7 @@ aiolookin==1.0.0 aiolyric==2.0.2 # homeassistant.components.mealie -aiomealie==1.2.0 +aiomealie==1.2.1 # homeassistant.components.modern_forms aiomodernforms==0.1.8 diff --git a/tests/components/mealie/fixtures/get_recipe.json b/tests/components/mealie/fixtures/get_recipe.json index 7e42986ebdc..38dab8facaf 100644 --- a/tests/components/mealie/fixtures/get_recipe.json +++ b/tests/components/mealie/fixtures/get_recipe.json @@ -185,6 +185,42 @@ "title": null, "originalText": null, "referenceId": "ef023f23-7816-4871-87f6-4d29f9a283f7" + }, + { + "quantity": 250.0, + "unit": { + "id": "34a3e8e3-c405-49fc-9fec-92dd5241a5c4", + "name": "millilitre", + "pluralName": null, + "description": "", + "extras": {}, + "fraction": true, + "abbreviation": "ml", + "pluralAbbreviation": "", + "useAbbreviation": false, + "aliases": [], + "createdAt": "2024-08-25T13:29:25.641593Z", + "updatedAt": "2024-08-25T13:29:25.641610Z" + }, + "food": { + "id": "8bc852fd-362a-48d2-9e77-2388ad9f3c0c", + "name": "Water", + "pluralName": null, + "description": "", + "extras": {}, + "labelId": null, + "aliases": [], + "householdsWithIngredientFood": ["family"], + "label": null, + "createdAt": "2026-01-05T11:06:53.830472Z", + "updatedAt": "2026-01-05T11:06:53.830491Z" + }, + "referencedRecipe": null, + "note": "", + "display": "250 millilitre Water", + "title": "", + "originalText": null, + "referenceId": "82f534de-ecef-4470-9d7a-6e24ded4a53a" } ], "recipeInstructions": [ diff --git a/tests/components/mealie/fixtures/get_shopping_items.json b/tests/components/mealie/fixtures/get_shopping_items.json index 81db48f2e1a..783bacf0321 100644 --- a/tests/components/mealie/fixtures/get_shopping_items.json +++ b/tests/components/mealie/fixtures/get_shopping_items.json @@ -99,6 +99,67 @@ "recipeReferences": [], "createdAt": "2024-06-25T11:56:59.656699", "updateAt": "2024-06-25T11:56:59.656701" + }, + { + "quantity": 1.0, + "unit": { + "id": "89765d44-8412-4ab5-a6de-594aa8eac44c", + "name": "US cup", + "pluralName": null, + "description": "", + "extras": {}, + "fraction": true, + "abbreviation": "US cup", + "pluralAbbreviation": "", + "useAbbreviation": false, + "aliases": [], + "createdAt": "2024-08-25T13:29:25.477518Z", + "updatedAt": "2024-08-25T13:29:25.477535Z" + }, + "food": { + "id": "8d2ef4d7-bfc2-4420-9cba-152016c1ee7c", + "name": "flour", + "pluralName": null, + "description": "", + "extras": {}, + "labelId": null, + "aliases": [], + "householdsWithIngredientFood": [], + "label": null, + "createdAt": "2024-08-25T13:29:29.040354Z", + "updatedAt": "2024-08-25T13:29:29.040371Z" + }, + "referencedRecipe": null, + "note": "", + "display": "1 US cup flour", + "shoppingListId": "a33af640-4704-453c-ab03-a95a393bf1c4", + "checked": false, + "position": 0, + "foodId": "8d2ef4d7-bfc2-4420-9cba-152016c1ee7c", + "labelId": null, + "unitId": "89765d44-8412-4ab5-a6de-594aa8eac44c", + "extras": {}, + "id": "22b389bb-e079-481c-915d-394e5edb20a5", + "groupId": "0e7a9673-adff-4adb-a239-4e353c991b31", + "householdId": "ba148cfb-bff8-4ec6-8bb4-aefd5f5c029d", + "label": { + "name": "Household", + "color": "#E0E0E0", + "groupId": "0e7a9673-adff-4adb-a239-4e353c991b31", + "id": "0e55cae5-6037-4cbb-8d4f-1042cbb83fd0" + }, + "recipeReferences": [ + { + "recipeId": "597a2c51-2b44-41e0-a17a-57c1fb367146", + "recipeQuantity": 1.0, + "recipeScale": 1.0, + "recipeNote": "1 Cup Flour", + "id": "ef9f17db-089e-4fcb-9b5b-b08a860f515f", + "shoppingListItemId": "22b389bb-e079-481c-915d-394e5edb20a5" + } + ], + "createdAt": "2026-01-05T11:47:30.434994Z", + "updatedAt": "2026-02-13T12:39:41.738679Z" } ], "next": null, diff --git a/tests/components/mealie/snapshots/test_diagnostics.ambr b/tests/components/mealie/snapshots/test_diagnostics.ambr index b06de79edc0..8ffda42f73f 100644 --- a/tests/components/mealie/snapshots/test_diagnostics.ambr +++ b/tests/components/mealie/snapshots/test_diagnostics.ambr @@ -447,44 +447,146 @@ 'checked': False, 'disable_amount': None, 'display': '2 Apples', + 'food': None, 'food_id': None, 'is_food': None, 'item_id': 'f45430f7-3edf-45a9-a50f-73bb375090be', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': 'Apples', 'position': 0, 'quantity': 2.0, + 'unit': None, 'unit_id': None, }), dict({ 'checked': False, 'disable_amount': False, 'display': '1 can acorn squash', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:04.454134', + 'description': '', + 'extras': dict({ + }), + 'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5', + 'households_with_ingredient_food': None, + 'label': None, + 'label_id': None, + 'name': 'acorn squash', + 'plural_name': None, + 'updated_at': '2024-05-14T14:45:04.454141', + }), 'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5', 'is_food': True, 'item_id': '84d8fd74-8eb0-402e-84b6-71f251bfb7cc', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': '', 'position': 1, 'quantity': 1.0, + 'unit': dict({ + 'abbreviation': '', + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:02.464122', + 'description': '', + 'extras': dict({ + }), + 'fraction': True, + 'name': 'can', + 'plural_abbreviation': '', + 'plural_name': None, + 'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a', + 'updated_at': '2024-05-14T14:45:02.464124', + 'use_abbreviation': False, + }), 'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a', }), dict({ 'checked': False, 'disable_amount': False, 'display': 'aubergine', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:03.868792', + 'description': '', + 'extras': dict({ + }), + 'food_id': '96801494-4e26-4148-849a-8155deb76327', + 'households_with_ingredient_food': None, + 'label': None, + 'label_id': None, + 'name': 'aubergine', + 'plural_name': None, + 'updated_at': '2024-05-14T14:45:03.868794', + }), 'food_id': '96801494-4e26-4148-849a-8155deb76327', 'is_food': True, 'item_id': '69913b9a-7c75-4935-abec-297cf7483f88', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': '', 'position': 2, 'quantity': 0.0, + 'unit': None, 'unit_id': None, }), + dict({ + 'checked': False, + 'disable_amount': None, + 'display': '1 US cup flour', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-08-25T13:29:29.040354+00:00', + 'description': '', + 'extras': dict({ + }), + 'food_id': '8d2ef4d7-bfc2-4420-9cba-152016c1ee7c', + 'households_with_ingredient_food': list([ + ]), + 'label': None, + 'label_id': None, + 'name': 'flour', + 'plural_name': None, + 'updated_at': '2024-08-25T13:29:29.040371+00:00', + }), + 'food_id': '8d2ef4d7-bfc2-4420-9cba-152016c1ee7c', + 'is_food': None, + 'item_id': '22b389bb-e079-481c-915d-394e5edb20a5', + 'label': dict({ + 'label_id': '0e55cae5-6037-4cbb-8d4f-1042cbb83fd0', + 'name': 'Household', + }), + 'label_id': None, + 'list_id': 'a33af640-4704-453c-ab03-a95a393bf1c4', + 'note': '', + 'position': 0, + 'quantity': 1.0, + 'unit': dict({ + 'abbreviation': 'US cup', + 'aliases': list([ + ]), + 'created_at': '2024-08-25T13:29:25.477518+00:00', + 'description': '', + 'extras': dict({ + }), + 'fraction': True, + 'name': 'US cup', + 'plural_abbreviation': '', + 'plural_name': None, + 'unit_id': '89765d44-8412-4ab5-a6de-594aa8eac44c', + 'updated_at': '2024-08-25T13:29:25.477535+00:00', + 'use_abbreviation': False, + }), + 'unit_id': '89765d44-8412-4ab5-a6de-594aa8eac44c', + }), ]), 'shopping_list': dict({ 'list_id': '27edbaab-2ec6-441f-8490-0283ea77585f', @@ -497,44 +599,146 @@ 'checked': False, 'disable_amount': None, 'display': '2 Apples', + 'food': None, 'food_id': None, 'is_food': None, 'item_id': 'f45430f7-3edf-45a9-a50f-73bb375090be', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': 'Apples', 'position': 0, 'quantity': 2.0, + 'unit': None, 'unit_id': None, }), dict({ 'checked': False, 'disable_amount': False, 'display': '1 can acorn squash', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:04.454134', + 'description': '', + 'extras': dict({ + }), + 'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5', + 'households_with_ingredient_food': None, + 'label': None, + 'label_id': None, + 'name': 'acorn squash', + 'plural_name': None, + 'updated_at': '2024-05-14T14:45:04.454141', + }), 'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5', 'is_food': True, 'item_id': '84d8fd74-8eb0-402e-84b6-71f251bfb7cc', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': '', 'position': 1, 'quantity': 1.0, + 'unit': dict({ + 'abbreviation': '', + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:02.464122', + 'description': '', + 'extras': dict({ + }), + 'fraction': True, + 'name': 'can', + 'plural_abbreviation': '', + 'plural_name': None, + 'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a', + 'updated_at': '2024-05-14T14:45:02.464124', + 'use_abbreviation': False, + }), 'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a', }), dict({ 'checked': False, 'disable_amount': False, 'display': 'aubergine', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:03.868792', + 'description': '', + 'extras': dict({ + }), + 'food_id': '96801494-4e26-4148-849a-8155deb76327', + 'households_with_ingredient_food': None, + 'label': None, + 'label_id': None, + 'name': 'aubergine', + 'plural_name': None, + 'updated_at': '2024-05-14T14:45:03.868794', + }), 'food_id': '96801494-4e26-4148-849a-8155deb76327', 'is_food': True, 'item_id': '69913b9a-7c75-4935-abec-297cf7483f88', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': '', 'position': 2, 'quantity': 0.0, + 'unit': None, 'unit_id': None, }), + dict({ + 'checked': False, + 'disable_amount': None, + 'display': '1 US cup flour', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-08-25T13:29:29.040354+00:00', + 'description': '', + 'extras': dict({ + }), + 'food_id': '8d2ef4d7-bfc2-4420-9cba-152016c1ee7c', + 'households_with_ingredient_food': list([ + ]), + 'label': None, + 'label_id': None, + 'name': 'flour', + 'plural_name': None, + 'updated_at': '2024-08-25T13:29:29.040371+00:00', + }), + 'food_id': '8d2ef4d7-bfc2-4420-9cba-152016c1ee7c', + 'is_food': None, + 'item_id': '22b389bb-e079-481c-915d-394e5edb20a5', + 'label': dict({ + 'label_id': '0e55cae5-6037-4cbb-8d4f-1042cbb83fd0', + 'name': 'Household', + }), + 'label_id': None, + 'list_id': 'a33af640-4704-453c-ab03-a95a393bf1c4', + 'note': '', + 'position': 0, + 'quantity': 1.0, + 'unit': dict({ + 'abbreviation': 'US cup', + 'aliases': list([ + ]), + 'created_at': '2024-08-25T13:29:25.477518+00:00', + 'description': '', + 'extras': dict({ + }), + 'fraction': True, + 'name': 'US cup', + 'plural_abbreviation': '', + 'plural_name': None, + 'unit_id': '89765d44-8412-4ab5-a6de-594aa8eac44c', + 'updated_at': '2024-08-25T13:29:25.477535+00:00', + 'use_abbreviation': False, + }), + 'unit_id': '89765d44-8412-4ab5-a6de-594aa8eac44c', + }), ]), 'shopping_list': dict({ 'list_id': 'e9d78ff2-4b23-4b77-a3a8-464827100b46', @@ -547,44 +751,146 @@ 'checked': False, 'disable_amount': None, 'display': '2 Apples', + 'food': None, 'food_id': None, 'is_food': None, 'item_id': 'f45430f7-3edf-45a9-a50f-73bb375090be', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': 'Apples', 'position': 0, 'quantity': 2.0, + 'unit': None, 'unit_id': None, }), dict({ 'checked': False, 'disable_amount': False, 'display': '1 can acorn squash', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:04.454134', + 'description': '', + 'extras': dict({ + }), + 'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5', + 'households_with_ingredient_food': None, + 'label': None, + 'label_id': None, + 'name': 'acorn squash', + 'plural_name': None, + 'updated_at': '2024-05-14T14:45:04.454141', + }), 'food_id': '09322430-d24c-4b1a-abb6-22b6ed3a88f5', 'is_food': True, 'item_id': '84d8fd74-8eb0-402e-84b6-71f251bfb7cc', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': '', 'position': 1, 'quantity': 1.0, + 'unit': dict({ + 'abbreviation': '', + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:02.464122', + 'description': '', + 'extras': dict({ + }), + 'fraction': True, + 'name': 'can', + 'plural_abbreviation': '', + 'plural_name': None, + 'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a', + 'updated_at': '2024-05-14T14:45:02.464124', + 'use_abbreviation': False, + }), 'unit_id': '7bf539d4-fc78-48bc-b48e-c35ccccec34a', }), dict({ 'checked': False, 'disable_amount': False, 'display': 'aubergine', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-05-14T14:45:03.868792', + 'description': '', + 'extras': dict({ + }), + 'food_id': '96801494-4e26-4148-849a-8155deb76327', + 'households_with_ingredient_food': None, + 'label': None, + 'label_id': None, + 'name': 'aubergine', + 'plural_name': None, + 'updated_at': '2024-05-14T14:45:03.868794', + }), 'food_id': '96801494-4e26-4148-849a-8155deb76327', 'is_food': True, 'item_id': '69913b9a-7c75-4935-abec-297cf7483f88', + 'label': None, 'label_id': None, 'list_id': '9ce096fe-ded2-4077-877d-78ba450ab13e', 'note': '', 'position': 2, 'quantity': 0.0, + 'unit': None, 'unit_id': None, }), + dict({ + 'checked': False, + 'disable_amount': None, + 'display': '1 US cup flour', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': '2024-08-25T13:29:29.040354+00:00', + 'description': '', + 'extras': dict({ + }), + 'food_id': '8d2ef4d7-bfc2-4420-9cba-152016c1ee7c', + 'households_with_ingredient_food': list([ + ]), + 'label': None, + 'label_id': None, + 'name': 'flour', + 'plural_name': None, + 'updated_at': '2024-08-25T13:29:29.040371+00:00', + }), + 'food_id': '8d2ef4d7-bfc2-4420-9cba-152016c1ee7c', + 'is_food': None, + 'item_id': '22b389bb-e079-481c-915d-394e5edb20a5', + 'label': dict({ + 'label_id': '0e55cae5-6037-4cbb-8d4f-1042cbb83fd0', + 'name': 'Household', + }), + 'label_id': None, + 'list_id': 'a33af640-4704-453c-ab03-a95a393bf1c4', + 'note': '', + 'position': 0, + 'quantity': 1.0, + 'unit': dict({ + 'abbreviation': 'US cup', + 'aliases': list([ + ]), + 'created_at': '2024-08-25T13:29:25.477518+00:00', + 'description': '', + 'extras': dict({ + }), + 'fraction': True, + 'name': 'US cup', + 'plural_abbreviation': '', + 'plural_name': None, + 'unit_id': '89765d44-8412-4ab5-a6de-594aa8eac44c', + 'updated_at': '2024-08-25T13:29:25.477535+00:00', + 'use_abbreviation': False, + }), + 'unit_id': '89765d44-8412-4ab5-a6de-594aa8eac44c', + }), ]), 'shopping_list': dict({ 'list_id': 'f8438635-8211-4be8-80d0-0aa42e37a5f2', diff --git a/tests/components/mealie/snapshots/test_services.ambr b/tests/components/mealie/snapshots/test_services.ambr index 2591741c8d2..6cc2e60882b 100644 --- a/tests/components/mealie/snapshots/test_services.ambr +++ b/tests/components/mealie/snapshots/test_services.ambr @@ -1778,6 +1778,34 @@ 'title': None, 'unit': None, }), + dict({ + 'display': '250 millilitre Water', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': datetime.datetime(2026, 1, 5, 11, 6, 53, 830472, tzinfo=datetime.timezone.utc), + 'description': '', + 'extras': dict({ + }), + 'food_id': '8bc852fd-362a-48d2-9e77-2388ad9f3c0c', + 'households_with_ingredient_food': list([ + 'family', + ]), + 'label': None, + 'label_id': None, + 'name': 'Water', + 'plural_name': None, + 'updated_at': datetime.datetime(2026, 1, 5, 11, 6, 53, 830491, tzinfo=datetime.timezone.utc), + }), + 'is_food': None, + 'note': '', + 'original_text': None, + 'quantity': 250.0, + 'reference_id': '82f534de-ecef-4470-9d7a-6e24ded4a53a', + 'referenced_recipe': None, + 'title': '', + 'unit': "{'id': '34a3e8e3-c405-49fc-9fec-92dd5241a5c4', 'name': 'millilitre', 'pluralName': None, 'description': '', 'extras': {}, 'fraction': True, 'abbreviation': 'ml', 'pluralAbbreviation': '', 'useAbbreviation': False, 'aliases': [], 'createdAt': '2024-08-25T13:29:25.641593Z', 'updatedAt': '2024-08-25T13:29:25.641610Z'}", + }), ]), 'instructions': list([ dict({ @@ -2409,6 +2437,34 @@ 'title': None, 'unit': None, }), + dict({ + 'display': '250 millilitre Water', + 'food': dict({ + 'aliases': list([ + ]), + 'created_at': datetime.datetime(2026, 1, 5, 11, 6, 53, 830472, tzinfo=datetime.timezone.utc), + 'description': '', + 'extras': dict({ + }), + 'food_id': '8bc852fd-362a-48d2-9e77-2388ad9f3c0c', + 'households_with_ingredient_food': list([ + 'family', + ]), + 'label': None, + 'label_id': None, + 'name': 'Water', + 'plural_name': None, + 'updated_at': datetime.datetime(2026, 1, 5, 11, 6, 53, 830491, tzinfo=datetime.timezone.utc), + }), + 'is_food': None, + 'note': '', + 'original_text': None, + 'quantity': 250.0, + 'reference_id': '82f534de-ecef-4470-9d7a-6e24ded4a53a', + 'referenced_recipe': None, + 'title': '', + 'unit': "{'id': '34a3e8e3-c405-49fc-9fec-92dd5241a5c4', 'name': 'millilitre', 'pluralName': None, 'description': '', 'extras': {}, 'fraction': True, 'abbreviation': 'ml', 'pluralAbbreviation': '', 'useAbbreviation': False, 'aliases': [], 'createdAt': '2024-08-25T13:29:25.641593Z', 'updatedAt': '2024-08-25T13:29:25.641610Z'}", + }), ]), 'instructions': list([ dict({ diff --git a/tests/components/mealie/snapshots/test_todo.ambr b/tests/components/mealie/snapshots/test_todo.ambr index 74b0e22cb7f..fee1fd852c2 100644 --- a/tests/components/mealie/snapshots/test_todo.ambr +++ b/tests/components/mealie/snapshots/test_todo.ambr @@ -46,7 +46,7 @@ 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '3', + 'state': '4', }) # --- # name: test_entities[todo.mealie_special_groceries-entry] @@ -96,7 +96,7 @@ 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '3', + 'state': '4', }) # --- # name: test_entities[todo.mealie_supermarket-entry] @@ -146,6 +146,6 @@ 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '3', + 'state': '4', }) # --- diff --git a/tests/components/mealie/test_todo.py b/tests/components/mealie/test_todo.py index 0f001cacacd..3ef6be13a25 100644 --- a/tests/components/mealie/test_todo.py +++ b/tests/components/mealie/test_todo.py @@ -191,7 +191,7 @@ async def test_moving_todo_item( assert resp.get("success") assert resp.get("result") is None - assert mock_mealie_client.update_shopping_item.call_count == 3 + assert mock_mealie_client.update_shopping_item.call_count == 4 calls = mock_mealie_client.update_shopping_item.mock_calls assert calls[0] == call(