Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
2f0efd251e | |||
55ac4972ca | |||
ab7ebb7f17 | |||
9b96af09a3 |
@ -1,4 +1,4 @@
|
||||
FROM python:3.11-slim
|
||||
FROM python:3.13-slim
|
||||
LABEL maintainer="Luke Tainton <luke@tainton.uk>"
|
||||
WORKDIR /home
|
||||
COPY . .
|
||||
|
@ -10,11 +10,9 @@ inputs:
|
||||
priority:
|
||||
description: 'Message priority'
|
||||
required: false
|
||||
default: '0'
|
||||
sound:
|
||||
description: 'Sound to play'
|
||||
required: false
|
||||
default: 'pushover'
|
||||
title:
|
||||
description: 'Message title'
|
||||
required: false
|
||||
|
@ -11,7 +11,7 @@ def get_args():
|
||||
parser.add_argument('--url', type=str, help='Supplementary URL to show with your message')
|
||||
parser.add_argument('--url_title', type=str, help='title for your supplementary URL, otherwise just the URL is shown')
|
||||
parser.add_argument('--device', type=str, help='Device name to send the message directly to')
|
||||
parser.add_argument('--priority', type=str, help='Notification priority (low-to-high: -2 to 1)')
|
||||
parser.add_argument('--priority', type=int, help='Notification priority (low-to-high: -2 to 1)')
|
||||
parser.add_argument('--sound', type=str, help='The name of a supported sound (https://pushover.net/api#sounds; custom sounds are supported)')
|
||||
args = parser.parse_args()
|
||||
return args
|
||||
@ -27,7 +27,7 @@ def main():
|
||||
url: str | None = args.url if args.url else None
|
||||
url_title: str | None = args.url_title if args.url_title else None
|
||||
device: str | None = args.device if args.device else None
|
||||
priority: str | None = args.priority if args.priority else None
|
||||
priority: int | None = args.priority if args.priority else None
|
||||
sound: str | None = args.sound if args.sound else None
|
||||
|
||||
if not msg:
|
||||
@ -52,6 +52,11 @@ def main():
|
||||
if sound:
|
||||
payload['sound'] = sound
|
||||
|
||||
_printable_payload = payload.copy()
|
||||
_printable_payload['token'] = '***'
|
||||
_printable_payload['user'] = '***'
|
||||
print(_printable_payload)
|
||||
|
||||
response = requests.post(
|
||||
url='https://api.pushover.net/1/messages.json',
|
||||
headers={'Content-Type': 'application/x-www-form-urlencoded'},
|
||||
|
Loading…
x
Reference in New Issue
Block a user