Merge pull request #477 from elseym/pushover-html-support

Pushover HTML Support
This commit is contained in:
JonnyWong16 2016-02-21 21:35:07 -08:00
commit 5e094e7597
2 changed files with 11 additions and 1 deletions

View file

@ -291,6 +291,7 @@ _CONFIG_DEFINITIONS = {
'PUSHBULLET_ON_INTUP': (int, 'PushBullet', 0),
'PUSHOVER_APITOKEN': (str, 'Pushover', ''),
'PUSHOVER_ENABLED': (int, 'Pushover', 0),
'PUSHOVER_HTML_SUPPORT': (int, 'Pushover', 1),
'PUSHOVER_KEYS': (str, 'Pushover', ''),
'PUSHOVER_PRIORITY': (int, 'Pushover', 0),
'PUSHOVER_SOUND': (str, 'Pushover', ''),

View file

@ -1054,6 +1054,7 @@ class PUSHOVER(object):
self.keys = plexpy.CONFIG.PUSHOVER_KEYS
self.priority = plexpy.CONFIG.PUSHOVER_PRIORITY
self.sound = plexpy.CONFIG.PUSHOVER_SOUND
self.html_support = plexpy.CONFIG.PUSHOVER_HTML_SUPPORT
def conf(self, options):
return cherrypy.config['config'].get('Pushover', options)
@ -1069,6 +1070,7 @@ class PUSHOVER(object):
'title': event.encode("utf-8"),
'message': message.encode("utf-8"),
'sound': plexpy.CONFIG.PUSHOVER_SOUND,
'html': plexpy.CONFIG.PUSHOVER_HTML_SUPPORT,
'priority': plexpy.CONFIG.PUSHOVER_PRIORITY}
http_handler.request("POST",
@ -1095,11 +1097,12 @@ class PUSHOVER(object):
# For uniformity reasons not removed
return
def test(self, keys, priority, sound):
def test(self, keys, priority, sound, html_support):
self.enabled = True
self.keys = keys
self.priority = priority
self.sound = sound
self.html_support = html_support
self.notify('Main Screen Activate', 'Test Message')
@ -1151,6 +1154,12 @@ class PUSHOVER(object):
'description': 'Set the notification sound. Leave blank for the default sound.',
'input_type': 'select',
'select_options': self.get_sounds()
},
{'label': 'Enable HTML Support',
'value': self.html_support,
'name': 'pushover_html_support',
'description': 'Style your messages using these HTML Tags: b, i, u, a[href], font[color]',
'input_type': 'checkbox'
}
]