Skip to content

Commit

Permalink
Added HTML support for Pushover plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Sep 6, 2021
1 parent db69fc4 commit 1290344
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apprise/plugins/NotifyPushover.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

from .NotifyBase import NotifyBase
from ..common import NotifyType
from ..common import NotifyFormat
from ..utils import parse_list
from ..utils import validate_regex
from ..AppriseLocale import gettext_lazy as _
Expand Down Expand Up @@ -320,6 +321,10 @@ def send(self, body, title='', notify_type=NotifyType.INFO, attach=None,
'sound': self.sound,
}

if self.notify_format == NotifyFormat.HTML:
# https://pushover.net/api#html
payload['html'] = 1

if self.priority == PushoverPriority.EMERGENCY:
payload.update({'retry': self.retry, 'expire': self.expire})

Expand Down
4 changes: 4 additions & 0 deletions test/test_rest_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3533,6 +3533,10 @@
('pover://%s@%s?priority=high' % ('u' * 30, 'a' * 30), {
'instance': plugins.NotifyPushover,
}),
# API Key + priority setting + html mode
('pover://%s@%s?priority=high&format=html' % ('u' * 30, 'a' * 30), {
'instance': plugins.NotifyPushover,
}),
# API Key + invalid priority setting
('pover://%s@%s?priority=invalid' % ('u' * 30, 'a' * 30), {
'instance': plugins.NotifyPushover,
Expand Down

0 comments on commit 1290344

Please sign in to comment.