diff --git a/docs/reference/notification.md b/docs/reference/notification.md index f4c17ce5a3..9bc0d66874 100644 --- a/docs/reference/notification.md +++ b/docs/reference/notification.md @@ -147,14 +147,17 @@ Generate token at [pushbullet.com/#settings/account](https://pushbullet.com/#set Generate token at [pushover.net/apps/build](https://pushover.net/apps/build). -| Environment variable | Description | -|:---:|---| -| `PUSHOVER_EXPIRE` | How many seconds your notification will continue to be retried for (every `PUSHOVER_RETRY` seconds) | -| `PUSHOVER_RETRY` | How often (in seconds) the Pushover servers will send the same notification to the user | -| `PUSHOVER_PRIORITY` | Message priority | -| `PUSHOVER_TOKEN` | API token | -| `PUSHOVER_USER` | Username | +API Documentation: [pushover.net/api](https://pushover.net/api) + +| Environment variable | Description | Required +|:---:|---|---| +| `PUSHOVER_EXPIRE` | How many seconds your notification will continue to be retried for (every `PUSHOVER_RETRY` seconds) | false | +| `PUSHOVER_DEVICE` | Devices to send notificaiton to. Blank will send to all registered devices. | false | +| `PUSHOVER_PRIORITY` | Message priority | false | +| `PUSHOVER_RETRY` | How often (in seconds) the Pushover servers will send the same notification to the user | false | | `PUSHOVER_SOUND` | Message sound | +| `PUSHOVER_TOKEN` | Application API token | true | +| `PUSHOVER_USER` | User key | true | ???+ note `PUSHOVER_EXPIRE` and `PUSHOVER_RETRY` are only used when `PUSHOVER_PRIORITY="2"` diff --git a/dotenv-example b/dotenv-example index a4895ef9e2..7623d9b3df 100644 --- a/dotenv-example +++ b/dotenv-example @@ -92,11 +92,12 @@ PROXY_PROTOCOL= PROXY_PORT= PUSHBULLET= PUSHOVER_EXPIRE= +PUSHOVER_DEVICE= +PUSHOVER_PRIORITY= PUSHOVER_RETRY= +PUSHOVER_SOUND= PUSHOVER_TOKEN= PUSHOVER_USER= -PUSHOVER_PRIORITY= -PUSHOVER_SOUND= RESTART_TIME= SCREENSHOT= SHOW_ONLY_BRANDS= diff --git a/src/config.ts b/src/config.ts index a4c389c532..b147ae0f9f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -306,6 +306,7 @@ const notifications = { sound: envOrString(process.env.PUSHOVER_SOUND, 'pushover'), token: envOrString(process.env.PUSHOVER_TOKEN), username: envOrString(process.env.PUSHOVER_USER), + device: envOrString(process.env.PUSHOVER_DEVICE), }, redis: { url: envOrString(process.env.REDIS_URL), diff --git a/src/notification/pushover.ts b/src/notification/pushover.ts index ffee26d69a..2c8b04e40e 100644 --- a/src/notification/pushover.ts +++ b/src/notification/pushover.ts @@ -21,6 +21,7 @@ export function sendPushoverNotification(link: Link, store: Store) { priority: pushover.priority, sound: pushover.sound, title: Print.inStock(link, store), + device: pushover.device, ...(link.screenshot && {file: `./${link.screenshot}`}), } : { @@ -30,6 +31,7 @@ export function sendPushoverNotification(link: Link, store: Store) { sound: pushover.sound, retry: pushover.retry, title: Print.inStock(link, store), + device: pushover.device, ...(link.screenshot && {file: `./${link.screenshot}`}), };