Skip to content

Commit

Permalink
Merge pull request #2 from masutaka/support-priority
Browse files Browse the repository at this point in the history
Support priority
  • Loading branch information
umahmood authored May 23, 2022
2 parents c6e9e67 + 4334937 commit 5da3119
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 @@ -47,6 +47,7 @@ You can pass the following flags into the action:
| url | Supplementary URL to show with your message |
| 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) |

Example:
```
Expand All @@ -58,6 +59,7 @@ Example:
url: 'https://example.com'
url_title: 'example'
device: 'iphone' # or 'iphone,galaxy10'
priority: '1' # High priority
```

## Versioning
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ inputs:
description: 'title for your supplementary URL, otherwise just the URL is shown'
device:
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)'
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -27,3 +29,4 @@ runs:
- --url=${{ inputs.url }}
- --url_title=${{ inputs.url_title }}
- --device=${{ inputs.device }}
- --priority=${{ inputs.priority }}
4 changes: 4 additions & 0 deletions pushover.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def main():
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)')
args = parser.parse_args()
try:
token = os.environ['PUSHOVER_TOKEN']
Expand All @@ -42,6 +45,7 @@ def main():
'url' : args.url,
'url_title' : args.url_title,
'device' : args.device,
'priority' : args.priority,
}
response = requests.post('https://api.pushover.net/1/messages.json',
headers=headers,
Expand Down

0 comments on commit 5da3119

Please sign in to comment.