Fix schema validation for product_id in picnic integration (#109083)
parent
182d00be66
commit
95fca44e6d
|
@ -42,9 +42,7 @@ async def async_register_services(hass: HomeAssistant) -> None:
|
||||||
schema=vol.Schema(
|
schema=vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(ATTR_CONFIG_ENTRY_ID): cv.string,
|
vol.Required(ATTR_CONFIG_ENTRY_ID): cv.string,
|
||||||
vol.Exclusive(
|
vol.Exclusive(ATTR_PRODUCT_ID, ATTR_PRODUCT_IDENTIFIERS): cv.string,
|
||||||
ATTR_PRODUCT_ID, ATTR_PRODUCT_IDENTIFIERS
|
|
||||||
): cv.positive_int,
|
|
||||||
vol.Exclusive(ATTR_PRODUCT_NAME, ATTR_PRODUCT_IDENTIFIERS): cv.string,
|
vol.Exclusive(ATTR_PRODUCT_NAME, ATTR_PRODUCT_IDENTIFIERS): cv.string,
|
||||||
vol.Optional(ATTR_AMOUNT): vol.All(vol.Coerce(int), vol.Range(min=1)),
|
vol.Optional(ATTR_AMOUNT): vol.All(vol.Coerce(int), vol.Range(min=1)),
|
||||||
}
|
}
|
||||||
|
@ -73,7 +71,7 @@ async def handle_add_product(
|
||||||
raise PicnicServiceException("No product found or no product ID given!")
|
raise PicnicServiceException("No product found or no product ID given!")
|
||||||
|
|
||||||
await hass.async_add_executor_job(
|
await hass.async_add_executor_job(
|
||||||
api_client.add_product, str(product_id), call.data.get("amount", 1)
|
api_client.add_product, product_id, call.data.get("amount", 1)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue