Skip to content

Commit

Permalink
Merge pull request #5 from unikitty37/main
Browse files Browse the repository at this point in the history
Support custom sounds
  • Loading branch information
umahmood authored Jul 13, 2024
2 parents 5da3119 + 58feda7 commit 0582cb2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ You can pass the following flags into the action:
| url_title | title for your supplementary URL |
| device | Device name to send the message directly to |
| priority | Notification priority (low-to-high: -2 to 1) |
| sound | The name of a supported sound (https://pushover.net/api#sounds; custom sounds are supported) |

Example:
```
Expand All @@ -60,6 +61,7 @@ Example:
url_title: 'example'
device: 'iphone' # or 'iphone,galaxy10'
priority: '1' # High priority
sound: 'cashregister'
```

## Versioning
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ inputs:
description: 'Device name to send the message directly to, rather than all devices (multiple devices may be separated by a comma)'
priority:
description: 'Notification priority (low-to-high: -2 to 1)'
sound:
description: 'The name of a supported sound (https://pushover.net/api#sounds; custom sounds are supported)'
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -30,3 +32,4 @@ runs:
- --url_title=${{ inputs.url_title }}
- --device=${{ inputs.device }}
- --priority=${{ inputs.priority }}
- --sound=${{ inputs.sound }}
4 changes: 4 additions & 0 deletions pushover.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def main():
parser.add_argument('--priority',
type=str,
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()
try:
token = os.environ['PUSHOVER_TOKEN']
Expand All @@ -46,6 +49,7 @@ def main():
'url_title' : args.url_title,
'device' : args.device,
'priority' : args.priority,
'sound' : args.sound,
}
response = requests.post('https://api.pushover.net/1/messages.json',
headers=headers,
Expand Down

0 comments on commit 0582cb2

Please sign in to comment.