Browse Source

Use new id for pushbullet. fix #2864

pull/2875/head
Ruud 11 years ago
parent
commit
12adde8f80
  1. 23
      couchpotato/core/notifications/pushbullet/main.py

23
couchpotato/core/notifications/pushbullet/main.py

@ -1,5 +1,5 @@
from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import tryInt from couchpotato.core.helpers.variable import splitString
from couchpotato.core.logger import CPLog from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification from couchpotato.core.notifications.base import Notification
import base64 import base64
@ -32,7 +32,7 @@ class Pushbullet(Notification):
response = self.request( response = self.request(
'pushes', 'pushes',
cache = False, cache = False,
device_id = device, device_iden = device,
type = 'note', type = 'note',
title = self.default_title, title = self.default_title,
body = toUnicode(message) body = toUnicode(message)
@ -46,24 +46,7 @@ class Pushbullet(Notification):
return successful == len(devices) return successful == len(devices)
def getDevices(self): def getDevices(self):
devices = [d.strip() for d in self.conf('devices').split(',')] return splitString(self.conf('devices'))
# Remove empty items
devices = [d for d in devices if len(d)]
# Break on any ids that aren't integers
valid_devices = []
for device_id in devices:
d = tryInt(device_id, None)
if not d:
log.error('Device ID "%s" is not valid', device_id)
return None
valid_devices.append(d)
return valid_devices
def request(self, method, cache = True, **kwargs): def request(self, method, cache = True, **kwargs):
try: try:

Loading…
Cancel
Save