watkins-matt / home-assistant-google-keep-sync

Custom component for Home Assistant that enables bidirectional synchronization with Google Keep lists.
MIT License
46 stars 4 forks source link

Custom list name prefix #3

Closed alexschwantes closed 8 months ago

alexschwantes commented 8 months ago

This adds an configurable list prefix that will show in Home Assistant Todo's to aid in identifying lists. The default it is blank/nothing.

This can be useful in households where multiple people may want to have access to their shopping list, such that you could then have them named freds shopping list and maria's shopping list. Without this, you would just have two lists called shopping list, which would get confusing. It can also be useful when you may have multiple lists synced from different services to be able to differentiate them.

This is the default behaviour in some other list integrations such as anylist, that adds a hard coded Anylist to each list.

I had a go at the translations using google translate so they may be a little bit off.

Also, regarding generating a new token, I didn't have any luck with the method in the readme because I had different versions. I did find a much easier method using a docker container as outlined here https://github.com/fcastilloec/gkeep-list-sync/blob/218f1ff0af82b1815e0903a62d40f585ea623f7d/README.md#authentication-options

alexschwantes commented 8 months ago

hmm no luck. can't get the test environment running on local pc so just had a quick stab at fixing the test. can try again later, but there is an issue with @pytest.mark.asyncio not working with localhost :(

alexschwantes commented 8 months ago

ok so got them working. raised a new bug regarding localhost issue https://github.com/MatthewFlamm/pytest-homeassistant-custom-component/issues/178

I also removed @pytest.mark.asyncio marker from tests. as from https://pypi.org/project/pytest-asyncio/0.20.1/ Regarding asyncio_mode = auto. When the mode is auto, all discovered async tests are considered asyncio-driven even if they have no @pytest.mark.asyncio marker.

I was also getting an unusual timezone error until I installed tzdata, so I added that to requirements.txt

watkins-matt commented 8 months ago

Thanks, just a couple of quick thoughts:

Overall the code looked good from the quick look I took at it. I'm not near a computer now but once I get a chance I just want to double check that the tests don't start failing due to removing the mark.asyncio. I think it occurred based on whether you ran the tests individually or all at once from what I remember.

watkins-matt commented 8 months ago

Looks good, thank you.