with notify script
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user