Sessions¶
- class terminusgps.wialon.session.WialonSession(token: str | None = None, sid: str | None = None, scheme: str = 'https', host: str = 'hst-api.wialon.com', port: int = 443)[source]¶
Starts or continues a Wialon API session.
- Parameters:
token (str | None) – A Wialon API token. If not provided, the environment variable
"WIALON_TOKEN"
is used.sid (str | None) – An optional Wialon API session id. If provided, the session is continued.
scheme (str) – HTTP request scheme to use. Default is
"https"
.host (str) – Wialon API host url. Default is
"hst-api.wialon.com"
.port (int) – Wialon API port. Default is
443
.
- Returns:
Nothing.
- Return type:
None
- login(token: str, flags: int | None = None) str [source]¶
Logs into the Wialon API, starts a new session then returns its id.
- Parameters:
- Raises:
WialonError – If the login fails.
AssertionError – If the login token was not set.
- Returns:
The new session id.
- Return type:
- property id: str | None¶
Wialon API session id.
Shortcut property for
WialonSession.wialon_api.sid
.Returns
None
if the session wasn’t logged in.- Type:
str | None
- Value:
None