SebRut / pygrocy

MIT License
65 stars 43 forks source link

Support for Grocy 4.0 API #266

Closed kehralexander closed 10 months ago

kehralexander commented 1 year ago

Yet again the grocy api changed somewhat. One thing that does not work anymore would apparently be grocy.all_products():

Traceback (most recent call last):
  File "/builds/alexwaresystems/mink/grocy-backup/export.py", line 23, in <module>
    grocy.all_products())
    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pygrocy/grocy.py", line 110, in all_products
    product_datas = [ProductData(**product) for product in raw_products]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pygrocy/grocy.py", line 110, in <listcomp>
    product_datas = [ProductData(**product) for product in raw_products]
                     ^^^^^^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for ProductData
fedefreue commented 1 year ago

We just merged a fix that'll address this issue. @SebRut can we push an incremental release so the latest version supports 4.0 installations? Guiltlessly, if we do that then we can update the Home Assistant integration to leverage the new fix as well.

SebRut commented 1 year ago

I kicked of new release, but it seems like the Travis CI setup is broken again on their side :/ Hopefully the support is able to resolve this quickly. Should probably migrate to GitHub actions or something else completely with Travis breaking occasionally.

SebRut commented 1 year ago

Version 2.0.0 should now be available on PyPI.