import json

class Device:

	PUSH_URL = "https://www.pushbullet.com/api/pushes"

	def __init__(self, session, device_info):
		self._session = session
		self.dev_id = device_info.get("id")
		self.owner = device_info.get("owner_name", None)

		extras = device_info["extras"]
		self.model = extras.get("model")
		self.manufacturer = extras.get("manufacturer")
		self.android_version = extras.get("android_version")
		self.sdk_version = extras.get("sdk_version")
		self.app_version = extras.get("app_version")

		self._fullname = "{} {} {}".format(self.manufacturer,
										   self.model, self.android_version)
		
		nickname = extras.get("nickname")
		self.name = nickname or self._fullname

	def push_note(self, title, body):
		data = {"type": "note", "title": title, "body": body}
		return self._push(data)

	def push_address(self, name, address):
		pass

	def push_list(self, title, items):
		data = {"type": "list", "title": title, "items": items}
		return self._push(data)		

	def push_file(self, file):
		pass

	def push_link(self, title, url):
		pass

	def _push(self, data, headers={}):
		data["device_id"] = self.dev_id
		return self._session.post(self.PUSH_URL, data=json.dumps(data), headers=headers)

	def __repr__(self):
		return self.__str__()

	def __str__(self):
		owner_info = ", 'owner': '%s '}" % (self.owner) if self.owner else "}"
		return "{'dev_id': %s, 'name': '%s'" % (self.dev_id, self.name) + owner_info

@@ -840,28 +840,110 @@
 address):%0A%09%09
-pass
+data = %7B%22type%22: %22address%22, %22name%22: name, %22address%22: address%7D%0A%09%09return self._push(data)
 %0A%0A%09def push_
@@ -1051,18 +1051,16 @@
 sh(data)
-%09%09
 %0A%0A%09def p
@@ -1121,28 +1121,101 @@
 le, url):%0A%09%09
-pass
+data = %7B%22type%22: %22link%22, %22title%22: title, %22url%22: url%7D%0A%09%09return self._push(data)
 %0A%0A%09def _push

Add support for links and addresses.