2023-04-09 21:43:50 +05:30
|
|
|
import secrets
|
2023-04-14 02:55:49 +05:30
|
|
|
from typing import Dict
|
2023-04-09 21:43:50 +05:30
|
|
|
|
|
|
|
from pyhon import const
|
|
|
|
|
|
|
|
|
|
|
|
class HonDevice:
|
2023-04-14 02:55:49 +05:30
|
|
|
def __init__(self) -> None:
|
|
|
|
self._app_version: str = const.APP_VERSION
|
|
|
|
self._os_version: int = const.OS_VERSION
|
|
|
|
self._os: str = const.OS
|
|
|
|
self._device_model: str = const.DEVICE_MODEL
|
|
|
|
self._mobile_id: str = secrets.token_hex(8)
|
2023-04-09 21:43:50 +05:30
|
|
|
|
|
|
|
@property
|
2023-04-14 02:55:49 +05:30
|
|
|
def app_version(self) -> str:
|
2023-04-09 21:43:50 +05:30
|
|
|
return self._app_version
|
|
|
|
|
|
|
|
@property
|
2023-04-14 02:55:49 +05:30
|
|
|
def os_version(self) -> int:
|
2023-04-09 21:43:50 +05:30
|
|
|
return self._os_version
|
|
|
|
|
|
|
|
@property
|
2023-04-14 02:55:49 +05:30
|
|
|
def os(self) -> str:
|
2023-04-09 21:43:50 +05:30
|
|
|
return self._os
|
|
|
|
|
|
|
|
@property
|
2023-04-14 02:55:49 +05:30
|
|
|
def device_model(self) -> str:
|
2023-04-09 21:43:50 +05:30
|
|
|
return self._device_model
|
|
|
|
|
|
|
|
@property
|
2023-04-14 02:55:49 +05:30
|
|
|
def mobile_id(self) -> str:
|
2023-04-09 21:43:50 +05:30
|
|
|
return self._mobile_id
|
|
|
|
|
2023-04-14 02:55:49 +05:30
|
|
|
def get(self) -> Dict:
|
2023-04-10 00:25:36 +05:30
|
|
|
return {
|
|
|
|
"appVersion": self.app_version,
|
|
|
|
"mobileId": self.mobile_id,
|
|
|
|
"osVersion": self.os_version,
|
|
|
|
"os": self.os,
|
|
|
|
"deviceModel": self.device_model,
|
|
|
|
}
|