Skip to content

add getClientHistory() call to fetch history of client interactions #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions omada/omada.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,19 @@ def getWirelessGroups(self, site=None):
##
def getWirelessNetworks(self, group, site=None):
return self.__get( f'/sites/{self.__findKey(site)}/setting/wlans/{group}/ssids' )

##
## Returns client history based on clients mac adress
##
## Function does not validate mac address, use getSiteClients() to find clients of interest.
## timeStart and timeEnd are in unix timestamps (type int)
##
def getClientHistory(self, clientmac, site=None, timeStart = None, timeEnd = None):
params = dict()

if timeStart is not None:
params["filters.timeStart"] = int(timeStart)
if timeEnd is not None:
params["filters.timeEnd"] = int(timeEnd)

return self.__geterator(f"/sites/{self.__findKey(site)}/clientHistory/{clientmac}", params=params)