feat(notification): add pushover priority setting (#186)

This commit is contained in:
John Dyer
2020-09-23 23:25:42 -04:00
committed by GitHub
parent f9ed774595
commit f277172191
4 changed files with 4 additions and 0 deletions
+1
View File
@@ -19,6 +19,7 @@ PLAY_SOUND=""
PUSHBULLET="" PUSHBULLET=""
PUSHOVER_TOKEN="" PUSHOVER_TOKEN=""
PUSHOVER_USER="" PUSHOVER_USER=""
PUSHOVER_PRIORITY=""
PAGE_SLEEP_MIN="" PAGE_SLEEP_MIN=""
PAGE_SLEEP_MAX="" PAGE_SLEEP_MAX=""
SHOW_ONLY_BRANDS="" SHOW_ONLY_BRANDS=""
+1
View File
@@ -82,6 +82,7 @@ Here is a list of variables that you can use to customize your newly copied `.en
| `PUSHBULLET` | PushBullet API key | Generate at https://www.pushbullet.com/#settings/account | | | `PUSHBULLET` | PushBullet API key | Generate at https://www.pushbullet.com/#settings/account | |
| `PUSHOVER_TOKEN` | Pushover access token | Generate at https://pushover.net/apps/build | | | `PUSHOVER_TOKEN` | Pushover access token | Generate at https://pushover.net/apps/build | |
| `PUSHOVER_USER` | Pushover username | | | `PUSHOVER_USER` | Pushover username | |
| `PUSHOVER_PRIORITY` | Pushover message priority |
| `PAGE_SLEEP_MIN` | Minimum sleep time between queries of the same store | In milliseconds, default: `5000` | | `PAGE_SLEEP_MIN` | Minimum sleep time between queries of the same store | In milliseconds, default: `5000` |
| `PAGE_SLEEP_MAX` | Maximum sleep time between queries of the same store | In milliseconds, default: `10000` | | `PAGE_SLEEP_MAX` | Maximum sleep time between queries of the same store | In milliseconds, default: `10000` |
| `SCREENSHOT` | Capture screenshot of page if a card is found | Default: `true` | | `SCREENSHOT` | Capture screenshot of page if a card is found | Default: `true` |
+1
View File
@@ -88,6 +88,7 @@ const notifications = {
playSound: envOrString(process.env.PLAY_SOUND), playSound: envOrString(process.env.PLAY_SOUND),
pushBulletApiKey: envOrString(process.env.PUSHBULLET), pushBulletApiKey: envOrString(process.env.PUSHBULLET),
pushover: { pushover: {
priority: envOrString(process.env.PUSHOVER_PRIORITY),
token: envOrString(process.env.PUSHOVER_TOKEN), token: envOrString(process.env.PUSHOVER_TOKEN),
username: envOrString(process.env.PUSHOVER_USER) username: envOrString(process.env.PUSHOVER_USER)
}, },
+1
View File
@@ -12,6 +12,7 @@ const push = new Push({
export function sendPushoverNotification(link: Link, store: Store) { export function sendPushoverNotification(link: Link, store: Store) {
const message = { const message = {
message: link.cartUrl ? link.cartUrl : link.url, message: link.cartUrl ? link.cartUrl : link.url,
priority: pushover.priority,
title: Print.inStock(link, store) title: Print.inStock(link, store)
}; };