grocy: Errors on not using products
Describe the bug I removed stock from my grocy addon configuration, as I don’t use them. Now the integration throws a lot of errors relating to products.
To Reproduce Steps to reproduce the behavior:
- change to
stock: falsein addon config - Restart home assistant
- Check logs
Are you using HASSIO to run grocy? Yes
configuration.yaml entry
Your grocy component config entry
Additional context
2020-03-18 19:54:16 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/grocy/__init__.py", line 220, in async_update_expiring_products
self.client.expiring_products, [True]))
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.7/site-packages/pygrocy/grocy.py", line 161, in expiring_products
raw_expiring_product = self.volatile_stock().expiring_products
File "/usr/local/lib/python3.7/site-packages/pygrocy/grocy.py", line 158, in volatile_stock
return self._api_client.get_volatile_stock()
File "/usr/local/lib/python3.7/site-packages/pygrocy/grocy_api_client.py", line 314, in get_volatile_stock
return CurrentVolatilStockResponse(parsed_json)
File "/usr/local/lib/python3.7/site-packages/pygrocy/grocy_api_client.py", line 199, in __init__
self._expiring_products = [CurrentStockResponse(product) for product in parsed_json.get('expiring_products')]
TypeError: 'NoneType' object is not iterable
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26 (13 by maintainers)
Thx ! If you didn’t disable shopping list, I can’t check more. Disable stock does not disable shopping list (Grocy behavior). Maybe you should disable shopping list too. Can you check log to see if you have some warning about it ?
Thanks again for your feedback and time. I will do a PR after your report.
Regards
TY for checking so quickly 😃
I released 0.14.0 of pygrocy like an hour ago, so that version should include the latest changes.