Fix picnicapi search (again) - #26
Conversation
…point which returns a new format
…is version seems to yield all expected search results.
…ults. This version seems to yield all expected search results." This reverts commit d09382e.
…" condition. This commit includes items that don't have a sole article id, and just sets the sole article id to None. Also includes some minor reformatting and refactor (updated type hint Optional for functions that can return a None).
Uh oh!
There was an error while loading. Please reload this page.
popeye1979
commented
Oct 18, 2024
Will this be approved/fixed soon? @corneyl |
corneyl
commented
Oct 18, 2024
@popeye1979 I'm afraid I'm not a maintainer for this repo, so there's not much I can do. @MikeBrink can you have a look or add someone as maintainer (or both)? Or would you advise to start a fork for further maintenance? |
There was a problem hiding this comment.
I don't think this should be checked in. There is also a username and password in here.
There are integration tests that use environment variables for username+password.
JanGiese
commented
Nov 20, 2024
works for me as well |
bobvanderlinden
commented
Nov 24, 2024
I emailed @MikeBrink about maintenance of this repo, but got no response. Maybe we should lean into forking or at least referring to this branch in Home Assistant? Apart from that, would it be possible to place libraries as this one under the home assistant organization? |
corneyl
commented
Jan 18, 2025
What about we start a GitHub organization, e.g. named |
maartenpaul
commented
Jan 18, 2025
Sounds like a cool idea, that would solve this kind of issue in the future! At home-assistant/core there is now a parallel discussion about this: If we can find somebody to take responsibility for the maintenance and fork the repository it would solve the problem for now. Since @MikeBrink is not responding for months, I guess we should just decide on this from the Home Assistant integration side. I use it now as a custom integration and especially with voice control it is really nice to have this working! |
I forked the repository and merged this PR into it. I also fixed #27 (home-assistant/core#138735) and will keep updating the The fork can be found at https://github.com/codesalatdev/python-picnic-api I am currently figuring out the setup and am already planning for some cleanup. |
glenndehaan
commented
Feb 20, 2025
@codesalatdev That sounds awesome. Are you also going to migrate the HA integration to your library? |
codesalatdev
commented
Feb 20, 2025
I am currently running my fork with a slightly modified version of the home assistant core integration (basically imports changed to |
maartenpaul
commented
Feb 20, 2025
That would be great if you could maintain the package! I just tested it on my HA setup running picnic as custom component, and all works fine. Maybe good to mention your repository and pypi package in this thread about the original issues with the API? |
codesalatdev
commented
Feb 20, 2025
Nice!
Will do :) |
corneyl
commented
Feb 23, 2025
@codesalatdev nice that you picked this up! I was also working on a fork for the past few days and didn't see any other recent forks, but missed yours for some reason. But I didn't get any further than fixing tests and making packages publish automatically to pypitest. |
codesalatdev
commented
Feb 23, 2025
If you want, I can add you as a collaborator to the PyPi project so that there's a second person with access to the project and you're obviously welcome to contribute :) Since you've approved the PR, I am assuming you do not want to use your own fork instead(?) |
thijmen-j
commented
Mar 12, 2025
@codesalatdev Since my PR was not being picked up I just copied the relevant code to my own project and I am keeping it updated there but would be happy to move back to a supported projects and also happy to contribute [I am keeping it updated anyways, might as well be for the common good ;)]. |
codesalatdev
commented
Mar 12, 2025
@thijmen-j I might be totally misunderstanding your comment, but your code (the extract search function) is part of the forked library and currently used by Home Assistant >= 2025.3 :) |
thijmen-j
commented
Mar 12, 2025
@codesalatdev Haha, OK, that's great!
|
codesalatdev
commented
Mar 12, 2025
Absolutely. I've changed a large part of the development workflow, added trusted publishing for PyPi, added scheduled integration tests, fixed the unit tests and got myself access to an account based in NL to spot differences in the API. This setup is here to stay. Also: my washing machine orders its own detergent, so that should be an indication of my commitment ;)
I plan to keep the library functional and add new features to it; but it's open source after all, so... sure? :D |
It seems that the Github API has been changed again. I'm not an expert Python developer, but tried to propose a working solution. Possibly it can be improved. I use it in combination with Home Assistant Picnic integration for which the search function was also broken (home-assistant/core#115351), now it seems to work again.
I have therefore tried to build upon the outstanding pull request from thijmen-j
#25
The Picnic API now returns a nested json structure which needs to be search through to find search results. I found this other project that makes use of the git and used their solution as inspiration.
https://github.com/simonmartyr/picnic-api/blob/main/search_page.go