Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Remove qu_factor_purchase_to_stock to maintain compatibility with API v4 #265

Merged
merged 4 commits into from
Aug 10, 2023

Conversation

fedefreue
Copy link
Contributor

Description

According to the changelog, v4.0.0 introduced a breaking change by removing qu_factor_purchase_to_stock from the /products/{productId} endpoint. I'm proposing to remove the field and the associated validator to allow updated installations to be compatible.

This does not add the new fields under the /products/{productId} but fixes requests for Product data in updated installations.

Checklist

  • The code change is tested and works locally.
  • tests pass. Your PR won't be merged unless tests pass
  • There is no commented out code in this PR

@fedefreue
Copy link
Contributor Author

We also confirmed this is working via the Home Assistant add-on that uses pygrocy here.

SebRut
SebRut previously approved these changes Aug 6, 2023
@fedefreue
Copy link
Contributor Author

Fixed the formatting issue in 'task.py' that Black called out. Should pass now.

SebRut
SebRut previously approved these changes Aug 7, 2023
@SebRut
Copy link
Owner

SebRut commented Aug 7, 2023

Seems like Travis CI is broken for this project again, running pytest locally reports one failing test which should be an easy fix.

FAILED test/test_product.py::TestProduct::test_product_get_details_valid - AttributeError: 'Product' object has no attribute 'qu_factor_purchase_to_stock'

@fedefreue
Copy link
Contributor Author

Sorry about that - fixed and successfully ran pytests (all tests) locally

@SebRut SebRut merged commit 37c0fa7 into SebRut:develop Aug 10, 2023
3 checks passed
SebRut added a commit that referenced this pull request Aug 17, 2023
major release because qu_factor_purchase_to_stock was removed in #265 for compability with grocy v4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants