mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Fix Mealie mealplan service date parsing (#121844)
This commit is contained in:
parent
3ef1e5816e
commit
12384104f4
@ -19,6 +19,7 @@ from homeassistant.core import (
|
|||||||
SupportsResponse,
|
SupportsResponse,
|
||||||
)
|
)
|
||||||
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
||||||
|
from homeassistant.helpers import config_validation as cv
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_CONFIG_ENTRY_ID,
|
ATTR_CONFIG_ENTRY_ID,
|
||||||
@ -35,8 +36,8 @@ SERVICE_GET_MEALPLAN = "get_mealplan"
|
|||||||
SERVICE_GET_MEALPLAN_SCHEMA = vol.Schema(
|
SERVICE_GET_MEALPLAN_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(ATTR_CONFIG_ENTRY_ID): str,
|
vol.Required(ATTR_CONFIG_ENTRY_ID): str,
|
||||||
vol.Optional(ATTR_START_DATE): date,
|
vol.Optional(ATTR_START_DATE): cv.date,
|
||||||
vol.Optional(ATTR_END_DATE): date,
|
vol.Optional(ATTR_END_DATE): cv.date,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -65,8 +65,8 @@ async def test_service_mealplan(
|
|||||||
SERVICE_GET_MEALPLAN,
|
SERVICE_GET_MEALPLAN,
|
||||||
{
|
{
|
||||||
ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id,
|
ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id,
|
||||||
ATTR_START_DATE: date(2023, 10, 22),
|
ATTR_START_DATE: "2023-10-22",
|
||||||
ATTR_END_DATE: date(2023, 10, 25),
|
ATTR_END_DATE: "2023-10-25",
|
||||||
},
|
},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
return_response=True,
|
return_response=True,
|
||||||
@ -82,7 +82,7 @@ async def test_service_mealplan(
|
|||||||
SERVICE_GET_MEALPLAN,
|
SERVICE_GET_MEALPLAN,
|
||||||
{
|
{
|
||||||
ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id,
|
ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id,
|
||||||
ATTR_START_DATE: date(2023, 10, 19),
|
ATTR_START_DATE: "2023-10-19",
|
||||||
},
|
},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
return_response=True,
|
return_response=True,
|
||||||
@ -98,7 +98,7 @@ async def test_service_mealplan(
|
|||||||
SERVICE_GET_MEALPLAN,
|
SERVICE_GET_MEALPLAN,
|
||||||
{
|
{
|
||||||
ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id,
|
ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id,
|
||||||
ATTR_END_DATE: date(2023, 10, 22),
|
ATTR_END_DATE: "2023-10-22",
|
||||||
},
|
},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
return_response=True,
|
return_response=True,
|
||||||
@ -115,8 +115,8 @@ async def test_service_mealplan(
|
|||||||
SERVICE_GET_MEALPLAN,
|
SERVICE_GET_MEALPLAN,
|
||||||
{
|
{
|
||||||
ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id,
|
ATTR_CONFIG_ENTRY_ID: mock_config_entry.entry_id,
|
||||||
ATTR_START_DATE: date(2023, 10, 22),
|
ATTR_START_DATE: "2023-10-22",
|
||||||
ATTR_END_DATE: date(2023, 10, 19),
|
ATTR_END_DATE: "2023-10-19",
|
||||||
},
|
},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
return_response=True,
|
return_response=True,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user