Commit 77d15999 authored by hupantingxue's avatar hupantingxue

Return get/set/update/delete device info;

parent b5d0e42d
...@@ -25,6 +25,7 @@ class Device(object): ...@@ -25,6 +25,7 @@ class Device(object):
body = None body = None
info = self.send("GET", url, body) info = self.send("GET", url, body)
print (info) print (info)
return info
def get_deviceinfo(self, registration_id): def get_deviceinfo(self, registration_id):
"""Get deviceinfo with registration id. """Get deviceinfo with registration id.
...@@ -33,6 +34,7 @@ class Device(object): ...@@ -33,6 +34,7 @@ class Device(object):
body = None body = None
info = self.send("GET", url, body) info = self.send("GET", url, body)
print (info) print (info)
return info
def set_deviceinfo(self, registration_id, entity): def set_deviceinfo(self, registration_id, entity):
"""Update deviceinfo with registration id. """Update deviceinfo with registration id.
...@@ -41,6 +43,7 @@ class Device(object): ...@@ -41,6 +43,7 @@ class Device(object):
body = json.dumps(entity) body = json.dumps(entity)
info = self.send("POST", url, body) info = self.send("POST", url, body)
print (url), (body), (info) print (url), (body), (info)
return info
def delete_tag(self, tag, platform=None): def delete_tag(self, tag, platform=None):
"""Delete registration id tag. """Delete registration id tag.
...@@ -52,6 +55,7 @@ class Device(object): ...@@ -52,6 +55,7 @@ class Device(object):
print (url), (body) print (url), (body)
info = self.send("DELETE", url, body) info = self.send("DELETE", url, body)
print (info) print (info)
return info
def update_tagusers(self, tag, entity): def update_tagusers(self, tag, entity):
"""Add/Remove specified tag users. """Add/Remove specified tag users.
...@@ -61,6 +65,7 @@ class Device(object): ...@@ -61,6 +65,7 @@ class Device(object):
print (url), (body) print (url), (body)
info = self.send("POST", url, body) info = self.send("POST", url, body)
print (info) print (info)
return info
def check_taguserexist(self, tag, registration_id): def check_taguserexist(self, tag, registration_id):
"""Check registration id whether in tag. """Check registration id whether in tag.
...@@ -70,6 +75,7 @@ class Device(object): ...@@ -70,6 +75,7 @@ class Device(object):
print (url), (registration_id) print (url), (registration_id)
info = self.send("GET", url, body) info = self.send("GET", url, body)
print (info) print (info)
return info
def delete_alias(self, alias, platform=None): def delete_alias(self, alias, platform=None):
"""Delete appkey alias. """Delete appkey alias.
...@@ -81,6 +87,7 @@ class Device(object): ...@@ -81,6 +87,7 @@ class Device(object):
print (url), (body) print (url), (body)
info = self.send("DELETE", url, body) info = self.send("DELETE", url, body)
print (info) print (info)
return info
def get_aliasuser(self, alias, platform=None): def get_aliasuser(self, alias, platform=None):
"""Get appkey alias users. """Get appkey alias users.
...@@ -92,6 +99,7 @@ class Device(object): ...@@ -92,6 +99,7 @@ class Device(object):
print (url), (body) print (url), (body)
info = self.send("GET", url, body) info = self.send("GET", url, body)
print (info) print (info)
return info
class DeviceResponse(object): class DeviceResponse(object):
"""Response to a successful device request send. """Response to a successful device request send.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment