with notify script

This commit is contained in:
2026-08-10 20:56:51 +02:00
parent da15ec1ca4
commit 164664a075
2 changed files with 115 additions and 0 deletions
+20
View File
@@ -869,6 +869,26 @@ Add:
There is no need to run `source`, activate the virtual environment, or use a
wrapper script.
## Sending an ntfy notification
`ntfy_notify.py` provides both a command-line interface and a reusable Python
function. Send a message from the command line with:
```bash
/opt/ups/.venv/bin/python /opt/ups/ntfy_notify.py "Some text"
```
Use it as a Python library with:
```python
from ntfy_notify import send_notification
send_notification("Some text")
```
The default topic can be overridden with `--topic-url` or the
`NTFY_TOPIC_URL` environment variable.
After a few minutes:
```bash