New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Bring! recently list #109854
Support Bring! recently list #109854
Conversation
Hey there @tr4nt0r, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
0a4ba56
to
6504dd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the change and it makes sense generally. However, i suspect removing completed Todo items doesn't do anything here? If so, that gives me a little pause since it makes this part of the Home Assistant UI inconsistent and odd/broken?
there was a small bug, fixed it localy and it worked as expected but after this PR #110769 is merged it has to be updated again anyway |
Thank you @allenporter for the review. I just have small question for unterstanding. What do you mean with inconsistancy? |
Ah yes I'm talking about how this appears in the home assistant UI |
Ok, so you mean completed=recently and pending=purchase? Indeed, this is a bit odd but the best we can do for now😅 |
Yes, I am saying this is not following the spec. This integration support deleting Todo items by setting A way to support the recently list is to expose as a read-only todo list with recent items, and it won't claim in the UI to support deletion. (Users can then hide that entity if they don't want it to show up.) |
Ok, I think I get it know. All the items are deletable in bring, including the recently items (it is just the list of completed items). If that is not the case and items show up again when deleted, it is a bug. I will go over it again and verify the behaviour. |
Hello, I went again through the code and tested the use cases. Please tell me if that is not how it should work as I would see it the closest to the home assistant way of working: For Bring! following is true:
In my opinion, this aligns quite good with the behaviour of home assistant. |
@allenporter If there is still a mismatch from your point of view, feel free to contact me on discord (@miaucl) to dive deeper ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks for checking, looks good to me.
51c7b0a
to
c2515fa
Compare
@allenporter I had to rebase and align with version 0.3.1 after pep8 changes from this PR: #110769 |
Proposed change
Since version
2.1.0
(and as we are currently on3.0.0
), the bring api supports a method calledcomplete
andcompleteAsync
, which allows to check off items instead of just deleting them. In addition to thepurchase
list available in thegetItems
andgetItemsAsync
, arecently
list is now available to, letting us perform following mappingpurchase->NEEDS_ACTION
andrecently->COMPLETED
and use the full functionality of the todo lists. A small detail, the bring api does not at all support anyuncomplete
method and basic create method can be used instead, resulting in the removal from the item from therecently
list and getting moved topurchase
list.DISCLAIMER: In the meantime we switched the lib to
bring-api@0.1.1
which is essentially the same as3.0.0
. Have a look at #110355 for more details about it.Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: