Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pushover): ability to specify device #2101

Merged
merged 2 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions docs/reference/notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
5 changes: 3 additions & 2 deletions dotenv-example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 2 additions & 0 deletions src/notification/pushover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`}),
}
: {
Expand All @@ -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}`}),
};

Expand Down