Giter Club home page Giter Club logo

Comments (11)

Anrolosia avatar Anrolosia commented on June 23, 2024

It is an excellent ticket! It will be an enhancement because today there is not distinction between lists. I will work on it and publish an update

from shopping-list-with-grocy.

anha7196 avatar anha7196 commented on June 23, 2024

Great! Looking forward to it!

from shopping-list-with-grocy.

Anrolosia avatar Anrolosia commented on June 23, 2024

Hey @anha7196 , I just pushed a new version (0.7.0), with that you should be able to display different shopping lists, and add/remove products to them!
Be carefull, this release includes some breaking changes! You'll have to play with your dashboard a bit :)
Let me know if it's working for you :)

from shopping-list-with-grocy.

anha7196 avatar anha7196 commented on June 23, 2024

Hi Anrolosia! That was really quick!
I tried the new version and i saw you documented the changes to the services, looks great!
I could not figure out however if there is any attributes to identify which shopping list an item belongs to. Maybe that is not how you implemented it or do i need do reload data from grocy somehow?

Oh, i just noticed there is an error on the integration page: Retrying setup: can only concatenate str (not "int") to str.
Full error message in logs:

This error originated from a custom integration.

Logger: custom_components.shopping_list_with_grocy
Source: custom_components/shopping_list_with_grocy/apis/shopping_list_with_grocy.py:233
Integration: Shopping List with Grocy (documentation, issues)
First occurred: 14 June 2023 at 21:39:29 (1006 occurrences)
Last logged: 21:04:38

Unexpected error fetching None data: can only concatenate str (not "int") to str
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/shopping_list_with_grocy/init.py", line 189, in async_update_data
return await self.api.retrieve_data()
File "/config/custom_components/shopping_list_with_grocy/apis/shopping_list_with_grocy.py", line 553, in retrieve_data
await self.parse_products(self.final_data)
File "/config/custom_components/shopping_list_with_grocy/apis/shopping_list_with_grocy.py", line 233, in parse_products
shopping_lists["list
" + shopping_list_id] = {
TypeError: can only concatenate str (not "int") to str

from shopping-list-with-grocy.

Anrolosia avatar Anrolosia commented on June 23, 2024

You have to play with the list_x_qty attribute:
image

If a product is in a list, no matter which one, it will have dynamicaly 3 new attributes, list_x_qty, list_x_note and list_x_shop_list_id

You can do you own shopping list dashboard, and have an intermediary window/popup when you want to add a product to specify on which list, then you call the service with the list_id filled :)

from shopping-list-with-grocy.

anha7196 avatar anha7196 commented on June 23, 2024

It seems the list_x_qty attribute is not present for me, i guess because of the "str not int" error at startup i wrote about in the last post.

This is the attributes from a sensor.shopping_list_with_grocy_ item in my installation (removed the image stuff":

product_id: 110 id_in_shopping_list: 2336 qty_in_shopping_list: 150 qty_in_stock: 0 product_image: topic: homeassistant/sensor/shopping_list_with_grocy_product_110/state note: location: Kylskåp group: Charkuterier icon: mdi:cart friendly_name: Leverpastej

from shopping-list-with-grocy.

Anrolosia avatar Anrolosia commented on June 23, 2024

@anha7196 I'm curious, what is the entity_id of that product?? Because you shouldn't have id_in_shopping_list anymore... Is there a _v1_ in your entity_id?
Also, with v0.7.1, I added a cast to str just in case, so if you're uptodate, you shouldn't have this error anymore

from shopping-list-with-grocy.

anha7196 avatar anha7196 commented on June 23, 2024

Yes, youŕe right! There is a _v1_ one with the new list_X attributes, and one without _v1_ with the id_in_shopping_list attribute.

So it is expected behavior to have the old products as sensors still?

from shopping-list-with-grocy.

Anrolosia avatar Anrolosia commented on June 23, 2024

It was specified in the update that having products in double might be expected, in that case you have to hit the refresh service several times, or just delete the old sensor in Homeassistant

from shopping-list-with-grocy.

anha7196 avatar anha7196 commented on June 23, 2024

Ok, sorry for missing that. Refresh service seems to be dong nothing after many tries, so Iĺl have to delete manually.

I've made list for only my groceries now, works great! Thanks for the help!

from shopping-list-with-grocy.

Anrolosia avatar Anrolosia commented on June 23, 2024

No worries! I'm glad it works now
I'll close that ticket then, have a great one!

from shopping-list-with-grocy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.