ljmerza / our-groceries-card

our groceries lovelace card

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting List Order

DennisOtt-git-hub opened this issue · comments

Is there a way to set the list oder similarly to the way the OurGroceries app does? One of the main reasons I like this app is that you can set the list sort order to alphabetize the items in the list. The HA component appears to just order them as last selected. I have found that alphabetizing the list reduces duplicates and the amount of time I spend searching for items ina long shopping list (since I never delete items from the list, they just get crossed off and wait until I need them again).

It appears that when the sort order is set in the OurGroceries app it sorts the list appropriately at the source and renders it correctly. when the HA card gets the list through the API it is sorted and the active items are alphabetic as desired. But the card code appears to separate the list items by active and crossed off (as it should). When it does it does some sort of 'push' action that adds the crossed off items to the front of the crossed off list before displaying. When it does this the sort order is lost. There probably needs to be a config item that denotes sort order as available in the app so that the HA integration can maintain the appropriate actions and item order of the main app.

added in v1.5.1 with sort_by_name setting