Fix schema validation for product_id in picnic integration (#109083)

pull/109008/head
Noah Groß 2024-01-31 01:44:31 +01:00 committed by GitHub
parent 182d00be66
commit 95fca44e6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -42,9 +42,7 @@ async def async_register_services(hass: HomeAssistant) -> None:
schema=vol.Schema(
{
vol.Required(ATTR_CONFIG_ENTRY_ID): cv.string,
vol.Exclusive(
ATTR_PRODUCT_ID, ATTR_PRODUCT_IDENTIFIERS
): cv.positive_int,
vol.Exclusive(ATTR_PRODUCT_ID, 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)),
}
@ -73,7 +71,7 @@ async def handle_add_product(
raise PicnicServiceException("No product found or no product ID given!")
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)
)