mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Added all available color options into a selection list.
This commit is contained in:
parent
9b9e31f54c
commit
ed2f87f57b
2 changed files with 12 additions and 10 deletions
|
@ -215,7 +215,7 @@ _CONFIG_DEFINITIONS = {
|
||||||
'HIPCHAT_URL': (str, 'Hipchat', ''),
|
'HIPCHAT_URL': (str, 'Hipchat', ''),
|
||||||
'HIPCHAT_COLOR': (str, 'Hipchat', 'green'),
|
'HIPCHAT_COLOR': (str, 'Hipchat', 'green'),
|
||||||
'HIPCHAT_INCL_SUBJECT': (int, 'Hipchat', 1),
|
'HIPCHAT_INCL_SUBJECT': (int, 'Hipchat', 1),
|
||||||
'HIPCHAT_INCL_EMOTICON': (str, 'Hipchat', ''),
|
'HIPCHAT_EMOTICON': (str, 'Hipchat', ''),
|
||||||
'HIPCHAT_ENABLED': (int, 'Hipchat', 0),
|
'HIPCHAT_ENABLED': (int, 'Hipchat', 0),
|
||||||
'HIPCHAT_ON_PLAY': (int, 'Hipchat', 0),
|
'HIPCHAT_ON_PLAY': (int, 'Hipchat', 0),
|
||||||
'HIPCHAT_ON_STOP': (int, 'Hipchat', 0),
|
'HIPCHAT_ON_STOP': (int, 'Hipchat', 0),
|
||||||
|
|
|
@ -2755,7 +2755,7 @@ class HIPCHAT(object):
|
||||||
self.apiurl = plexpy.CONFIG.HIPCHAT_URL
|
self.apiurl = plexpy.CONFIG.HIPCHAT_URL
|
||||||
self.color = plexpy.CONFIG.HIPCHAT_COLOR
|
self.color = plexpy.CONFIG.HIPCHAT_COLOR
|
||||||
self.incl_subject = plexpy.CONFIG.HIPCHAT_INCL_SUBJECT
|
self.incl_subject = plexpy.CONFIG.HIPCHAT_INCL_SUBJECT
|
||||||
self.incl_emoticon = plexpy.CONFIG.HIPCHAT_INCL_EMOTICON
|
self.emoticon = plexpy.CONFIG.HIPCHAT_EMOTICON
|
||||||
|
|
||||||
def notify(self, message, subject):
|
def notify(self, message, subject):
|
||||||
if not message or not subject:
|
if not message or not subject:
|
||||||
|
@ -2766,8 +2766,8 @@ class HIPCHAT(object):
|
||||||
else:
|
else:
|
||||||
text = message.encode('utf-8')
|
text = message.encode('utf-8')
|
||||||
|
|
||||||
if self.incl_emoticon:
|
if self.emoticon:
|
||||||
text = self.incl_emoticon + ' ' + text
|
text = self.emoticon + ' ' + text
|
||||||
|
|
||||||
data = {'color': self.color,
|
data = {'color': self.color,
|
||||||
'message': text,
|
'message': text,
|
||||||
|
@ -2797,11 +2797,13 @@ class HIPCHAT(object):
|
||||||
logger.warn(u"PlexPy Notifiers :: Hipchat notification failed.")
|
logger.warn(u"PlexPy Notifiers :: Hipchat notification failed.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def test(self, apiurl, color):
|
def test(self, apiurl, color, hipchat_emoticon, hipchat_incl_subject):
|
||||||
|
|
||||||
self.enabled = True
|
self.enabled = True
|
||||||
self.apiurl = apiurl
|
self.apiurl = apiurl
|
||||||
self.color = color
|
self.color = color
|
||||||
|
self.emoticon = hipchat_emoticon
|
||||||
|
self.incl_subject = hipchat_incl_subject
|
||||||
|
|
||||||
return self.notify('PlexPy', 'Test Message')
|
return self.notify('PlexPy', 'Test Message')
|
||||||
|
|
||||||
|
@ -2816,13 +2818,13 @@ class HIPCHAT(object):
|
||||||
{'label': 'Hipchat Color',
|
{'label': 'Hipchat Color',
|
||||||
'value': self.color,
|
'value': self.color,
|
||||||
'name': 'hipchat_color',
|
'name': 'hipchat_color',
|
||||||
'description': 'Color for the message to show up in your room. You'
|
'description': 'Background color for the message.',
|
||||||
' may use any valid Hipchat message color value.',
|
'input_type': 'select',
|
||||||
'input_type': 'text'
|
'select_options': {'yellow': 'yellow', 'green': 'green', 'red': 'red', 'purple': 'purple', 'gray': 'gray', 'random': 'random'}
|
||||||
},
|
},
|
||||||
{'label': 'Hipchat emoticon',
|
{'label': 'Hipchat emoticon',
|
||||||
'value': self.incl_emoticon,
|
'value': self.emoticon,
|
||||||
'name': 'hipchat_incl_emoticon',
|
'name': 'hipchat_emoticon',
|
||||||
'description': 'Include an emoticon tag at the beginning of all notifications. Leave blank for none.'
|
'description': 'Include an emoticon tag at the beginning of all notifications. Leave blank for none.'
|
||||||
' Use a stock emoticon or create a custom emoticon'
|
' Use a stock emoticon or create a custom emoticon'
|
||||||
' <a href="' + helpers.anon_url('https://www.hipchat.com/emoticons/') + '" target="_blank">here</a>.',
|
' <a href="' + helpers.anon_url('https://www.hipchat.com/emoticons/') + '" target="_blank">here</a>.',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue