mirror of https://github.com/caronc/apprise
Added HTML support for Pushover plugin (#437)
parent
db69fc44a2
commit
1916a9105d
|
@ -29,6 +29,7 @@ import requests
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .NotifyBase import NotifyBase
|
||||||
from ..common import NotifyType
|
from ..common import NotifyType
|
||||||
|
from ..common import NotifyFormat
|
||||||
from ..utils import parse_list
|
from ..utils import parse_list
|
||||||
from ..utils import validate_regex
|
from ..utils import validate_regex
|
||||||
from ..AppriseLocale import gettext_lazy as _
|
from ..AppriseLocale import gettext_lazy as _
|
||||||
|
@ -320,6 +321,10 @@ class NotifyPushover(NotifyBase):
|
||||||
'sound': self.sound,
|
'sound': self.sound,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.notify_format == NotifyFormat.HTML:
|
||||||
|
# https://pushover.net/api#html
|
||||||
|
payload['html'] = 1
|
||||||
|
|
||||||
if self.priority == PushoverPriority.EMERGENCY:
|
if self.priority == PushoverPriority.EMERGENCY:
|
||||||
payload.update({'retry': self.retry, 'expire': self.expire})
|
payload.update({'retry': self.retry, 'expire': self.expire})
|
||||||
|
|
||||||
|
|
|
@ -3533,6 +3533,10 @@ TEST_URLS = (
|
||||||
('pover://%s@%s?priority=high' % ('u' * 30, 'a' * 30), {
|
('pover://%s@%s?priority=high' % ('u' * 30, 'a' * 30), {
|
||||||
'instance': plugins.NotifyPushover,
|
'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
|
# API Key + invalid priority setting
|
||||||
('pover://%s@%s?priority=invalid' % ('u' * 30, 'a' * 30), {
|
('pover://%s@%s?priority=invalid' % ('u' * 30, 'a' * 30), {
|
||||||
'instance': plugins.NotifyPushover,
|
'instance': plugins.NotifyPushover,
|
||||||
|
|
Loading…
Reference in New Issue