Commit 9e6d7897 authored by Helperhaps's avatar Helperhaps

add device status & update smsmessage method

parent b0e84253
...@@ -52,3 +52,7 @@ def update_device_mobile(): ...@@ -52,3 +52,7 @@ def update_device_mobile():
reg_id = '1507bfd3f7c466c355c' reg_id = '1507bfd3f7c466c355c'
entity = jpush.device_mobile("18588232140") entity = jpush.device_mobile("18588232140")
device.set_devicemobile(reg_id, entity) device.set_devicemobile(reg_id, entity)
def get_device_status():
reg_id = '1507bfd3f7c466c355c'
device.get_device_status(reg_id)
...@@ -75,7 +75,7 @@ __all__ = [ ...@@ -75,7 +75,7 @@ __all__ = [
schedulepayload, schedulepayload,
] ]
__version__ = '3.2.9' __version__ = '3.3.0'
VERSION = tuple(map(int, __version__.split('.'))) VERSION = tuple(map(int, __version__.split('.')))
# Silence urllib3 INFO logging by default # Silence urllib3 INFO logging by default
......
...@@ -88,6 +88,18 @@ class Device(object): ...@@ -88,6 +88,18 @@ class Device(object):
info = self.send("GET", url, params = params) info = self.send("GET", url, params = params)
return info return info
def get_device_status(self, reg_ids):
"""Get Online Status of User (VIP Exclusive Interface)
"""
url = common.get_url('device', self.zone) + 'status'
if isinstance(reg_ids, str):
reg_ids = [ reg_ids ]
entity = { 'registration_ids': reg_ids }
body = json.dumps(entity)
info = self.send("POST", url, body)
return info
class DeviceResponse(object): class DeviceResponse(object):
"""Response to a successful device request send. """Response to a successful device request send.
......
...@@ -158,11 +158,12 @@ def message(msg_content, title=None, content_type=None, extras=None): ...@@ -158,11 +158,12 @@ def message(msg_content, title=None, content_type=None, extras=None):
payload['extras'] = extras payload['extras'] = extras
return payload return payload
def smsmessage(delay_time, temp_id, temp_para = None):
def smsmessage(content,delay_time):
payload = {} payload = {}
payload["content"]=content
payload["delay_time"]=delay_time payload["delay_time"]=delay_time
payload["temp_id"]=temp_id
if temp_para is not None:
payload['temp_para'] = temp_para
return payload return payload
......
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