Add GetPPDev message
This commit is contained in:
parent
1b0a5caa1b
commit
f1c340fb3d
@ -50,6 +50,18 @@ class OMMClient2:
|
||||
return None
|
||||
return r.account[0]
|
||||
|
||||
def get_pp_dev(self, ppn):
|
||||
"""
|
||||
Get PP device
|
||||
|
||||
:param id: Device id
|
||||
"""
|
||||
r = self.session.request(messages.GetPPDev(ppn))
|
||||
r.raise_on_error()
|
||||
if r.pp is None:
|
||||
return None
|
||||
return r.pp[0]
|
||||
|
||||
def ping(self):
|
||||
"""
|
||||
Is OMM still there?
|
||||
|
@ -98,6 +98,7 @@ class Response:
|
||||
return self.attrs.get("maxLen")
|
||||
|
||||
from .getaccount import GetAccount, GetAccountResp
|
||||
from .getppdev import GetPPDev, GetPPDevResp
|
||||
from .open import Open, OpenResp
|
||||
from .ping import Ping, PingResp
|
||||
|
||||
@ -124,6 +125,7 @@ def construct(request):
|
||||
def _response_type_by_name(name):
|
||||
response_types = [
|
||||
GetAccountResp,
|
||||
GetPPDevResp,
|
||||
PingResp,
|
||||
]
|
||||
|
||||
|
27
mitel_ommclient2/messages/getppdev.py
Normal file
27
mitel_ommclient2/messages/getppdev.py
Normal file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from . import Request, Response
|
||||
|
||||
|
||||
class GetPPDev(Request):
|
||||
def __init__(self, ppn, maxRecords=None, **kwargs):
|
||||
super().__init__("GetPPDev", **kwargs)
|
||||
|
||||
self.attrs["ppn"] = ppn
|
||||
|
||||
if maxRecords is not None:
|
||||
self.attrs["maxRecords"] = maxRecords
|
||||
|
||||
@property
|
||||
def ppn(self):
|
||||
return self.attrs.get("ppn")
|
||||
|
||||
@property
|
||||
def maxRecords(self):
|
||||
return self.attrs.get("maxRecords")
|
||||
|
||||
|
||||
class GetPPDevResp(Response):
|
||||
@property
|
||||
def pp(self):
|
||||
return self.childs.get("pp")
|
Loading…
Reference in New Issue
Block a user