forked from platypush/platypush
Create a device if it doesn't exist
This commit is contained in:
parent
f6221a798a
commit
9324ad3f9b
1 changed files with 5 additions and 1 deletions
|
@ -55,7 +55,11 @@ class PushbulletBackend(Backend):
|
||||||
self.pb = Pushbullet(token)
|
self.pb = Pushbullet(token)
|
||||||
self.pb_device_id = self.get_device_id()
|
self.pb_device_id = self.get_device_id()
|
||||||
self.listener = None
|
self.listener = None
|
||||||
|
|
||||||
|
try:
|
||||||
self.device = self.pb.get_device(self.device_name)
|
self.device = self.pb.get_device(self.device_name)
|
||||||
|
except:
|
||||||
|
self.device = self.pb.new_device(self.device_name)
|
||||||
|
|
||||||
|
|
||||||
def _get_latest_push(self):
|
def _get_latest_push(self):
|
||||||
|
|
Loading…
Reference in a new issue