Enable "allow_subproduct_substitution" on consume endpoint
kingo55 opened this issue · 0 comments
kingo55 commented
Expected behaviour: Consumption against parent products will use sub-products' stock when substitution is allowed.
Actual behaviour: Consumption against parent products returns HTTP 400 and we can't set "allow_subproduct_substitution" to use sub-products' stock.
This is causing the following issues downstream in the grocy / Home Assistant custom component: custom-components/grocy#182
Possible solution
Bernd points out that we should allow substitution: grocy/grocy#1767 (comment)
So, I think we need to update the POST body with "allow_subproduct_substitution", possibly defaulted to False in the code here:
pygrocy/pygrocy/grocy_api_client.py
Lines 402 to 415 in 8f5214c
What do you think?