allow to choose a list by UUID

This commit is contained in:
Lysann Tranvouez 2025-07-21 21:15:28 +00:00
parent 4a6d2ff96d
commit 1838e35b78
4 changed files with 81 additions and 4 deletions

View file

@ -36,7 +36,8 @@ You can either run the backend service through docker or run the script directly
#### Docker
Pull the docker image and pass the email, password and webhook url as env variables.
Pull the docker image and pass the email, password and webhook url as env variables.<br/>
You can also provide an optional list UUID (see 3. below).
```bash
docker pull ghcr.io/yshrdbrn/trmnl-bring-plugin:main
@ -47,15 +48,44 @@ docker run
-e 'EMAIL'='<email>'
-e 'PASSWORD'='<password>'
-e 'WEBHOOK_URL'='<url>'
-e 'LIST_UUID'='<list UUID>' # optional
'ghcr.io/yshrdbrn/trmnl-bring-plugin:main'
```
#### Run the script directly
Clone the repo and rename `.env.example` to `.env` and put in your email, password and webhook url there. Then run the script:
Clone the repo and rename `.env.example` to `.env` and put in your email, password, webhook url, and optionally list UUID there. Then run the script:
```bash
python3 -m venv venv
pip install -r requirements.txt
python ./main.py
```
### 3. Optional: Determine your list UUID and provide it to the plugin
You can manage several shopping lists on Bring with the same account.<br/>
If you want to choose a specific list, you need to determine its UUID. Otherwise the plugin just uses the first list it encounters (which might not be the first list you see in the app or web page).
```bash
docker run
-e 'EMAIL'='<email>'
-e 'PASSWORD'='<password>'
'ghcr.io/yshrdbrn/trmnl-bring-plugin:main'
python -u ./fetch_lists.py
```
Or run it without docker (EMAIL and PASSWORD must be set in .env and dependencies installed as in 2. above):
```bash
python ./fetch_lists.py
```
You should get a list of lists like this:
| **Name** | **UUID** |
| --------- | ------------------------------- |
| Groceries | 12345678-90ab-cdef-0123456789ab |
| Stuff | abcdef01-2345-6789-0123456789ab |
Copy the UUID of the list you would like to display, and set it as `LIST_UUID` either via `-e` in docker or in the `.env` file. Restart your plugin service to apply the change.