diff --git a/homeassistant/components/mealie/services.py b/homeassistant/components/mealie/services.py index ac8d5519310..7671c65b41f 100644 --- a/homeassistant/components/mealie/services.py +++ b/homeassistant/components/mealie/services.py @@ -19,6 +19,7 @@ from homeassistant.core import ( SupportsResponse, ) from homeassistant.exceptions import HomeAssistantError, ServiceValidationError +from homeassistant.helpers import config_validation as cv from .const import ( ATTR_CONFIG_ENTRY_ID, @@ -35,8 +36,8 @@ SERVICE_GET_MEALPLAN = "get_mealplan" SERVICE_GET_MEALPLAN_SCHEMA = vol.Schema( { vol.Required(ATTR_CONFIG_ENTRY_ID): str, - vol.Optional(ATTR_START_DATE): date, - vol.Optional(ATTR_END_DATE): date, + vol.Optional(ATTR_START_DATE): cv.date, + vol.Optional(ATTR_END_DATE): cv.date, } ) diff --git a/tests/components/mealie/test_services.py b/tests/components/mealie/test_services.py index b6928f88f2c..c655d899416 100644 --- a/tests/components/mealie/test_services.py +++ b/tests/components/mealie/test_services.py @@ -65,8 +65,8 @@ async def test_service_mealplan( SERVICE_GET_MEALPLAN, { ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id, - ATTR_START_DATE: date(2023, 10, 22), - ATTR_END_DATE: date(2023, 10, 25), + ATTR_START_DATE: "2023-10-22", + ATTR_END_DATE: "2023-10-25", }, blocking=True, return_response=True, @@ -82,7 +82,7 @@ async def test_service_mealplan( SERVICE_GET_MEALPLAN, { ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id, - ATTR_START_DATE: date(2023, 10, 19), + ATTR_START_DATE: "2023-10-19", }, blocking=True, return_response=True, @@ -98,7 +98,7 @@ async def test_service_mealplan( SERVICE_GET_MEALPLAN, { ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id, - ATTR_END_DATE: date(2023, 10, 22), + ATTR_END_DATE: "2023-10-22", }, blocking=True, return_response=True, @@ -115,8 +115,8 @@ async def test_service_mealplan( SERVICE_GET_MEALPLAN, { ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id, - ATTR_START_DATE: date(2023, 10, 22), - ATTR_END_DATE: date(2023, 10, 19), + ATTR_START_DATE: "2023-10-22", + ATTR_END_DATE: "2023-10-19", }, blocking=True, return_response=True,