custom-components / grocy

Custom Grocy integration for Home Assistant
Apache License 2.0
153 stars 45 forks source link

Add Todo Entity #305

Closed DellanX closed 5 months ago

DellanX commented 5 months ago

This code isn't quite complete, there is some cleanup I need to do. But I wanted to open the PR to begin the process.

I'll be working on the todo lists below:

I can pull the following into a list entities:

NOTE, shopping list completion doesn't represent the correct state. Needs this PR to close

I have had success in adding support for the entity services:

I have performed the following cleanup activities:

As I develop, is there any desired changes in how I am approaching this? Further, any additional features to be added?

I haven't implemented a Stock todo list yet, as I don't quite know how to define it's completion state. Perhaps if below desired stock amount?

DellanX commented 5 months ago

I put further thought into it, stock should probably be completed when no more of a product is available.

To explain,

Shopping lists show when there is items to be purchased. Checking off an item, means that it no longer needs to be purchased.

This begs the question, when is it appropriate to check something to indicate it needs to be purchased? I figure, the stock page.

I'll implement the product list, using any amount available as an indicator that there is stock that can be consumed (which will be what the todo entry indicates)

DellanX commented 5 months ago

I've added support to create for a few of the lists. But have decided it'd be too difficult to add support for all of the lists. My new services goals:

Create:

Update:

Delete for all. (Theoretically done, but running into headaches with pygrocy)

DellanX commented 5 months ago

I just need to go through the pygrocy API and root cause the delete service errors. Further, debug issues with the update logic for tasks.

Then, I'll go back and add moving things out of the complete step.

Finally, there are a lot of bugs I found with pygrocy that I'll need to either fix or escelate.