Add include subject line for Pushover

This commit is contained in:
JonnyWong16 2018-02-19 19:10:08 -08:00
parent 8eed14ff3b
commit a81ad27d85

View file

@ -2686,6 +2686,7 @@ class PUSHOVER(Notifier):
'priority': 0, 'priority': 0,
'sound': '', 'sound': '',
'incl_url': 1, 'incl_url': 1,
'incl_subject': 1,
'incl_poster': 0, 'incl_poster': 0,
'movie_provider': '', 'movie_provider': '',
'tv_provider': '', 'tv_provider': '',
@ -2695,13 +2696,15 @@ class PUSHOVER(Notifier):
def agent_notify(self, subject='', body='', action='', **kwargs): def agent_notify(self, subject='', body='', action='', **kwargs):
data = {'token': self.config['api_token'], data = {'token': self.config['api_token'],
'user': self.config['key'], 'user': self.config['key'],
'title': subject.encode("utf-8"),
'message': body.encode("utf-8"), 'message': body.encode("utf-8"),
'sound': self.config['sound'], 'sound': self.config['sound'],
'html': self.config['html_support'], 'html': self.config['html_support'],
'priority': self.config['priority'], 'priority': self.config['priority'],
'timestamp': int(time.time())} 'timestamp': int(time.time())}
if self.config['incl_subject']:
data['title'] = subject.encode("utf-8")
headers = {'Content-type': 'application/x-www-form-urlencoded'} headers = {'Content-type': 'application/x-www-form-urlencoded'}
files = {} files = {}
@ -2802,6 +2805,12 @@ class PUSHOVER(Notifier):
'description': 'Include a supplementary URL with the notifications.', 'description': 'Include a supplementary URL with the notifications.',
'input_type': 'checkbox' 'input_type': 'checkbox'
}, },
{'label': 'Include Subject Line',
'value': self.config['incl_subject'],
'name': 'pushover_incl_subject',
'description': 'Include the subject line with the notifications.',
'input_type': 'checkbox'
},
{'label': 'Include Poster Image', {'label': 'Include Poster Image',
'value': self.config['incl_poster'], 'value': self.config['incl_poster'],
'name': 'pushover_incl_poster', 'name': 'pushover_incl_poster',