Complete second logic pass, remove underscore from package name
This commit is contained in:
@@ -1,18 +1,18 @@
|
|||||||
import requests
|
import requests
|
||||||
from typing import Dict, List, Optional, Union
|
from typing import Dict, List, Optional, Union
|
||||||
from reolink_api.alarm import AlarmAPIMixin
|
from reolinkapi.alarm import AlarmAPIMixin
|
||||||
from reolink_api.device import DeviceAPIMixin
|
from reolinkapi.device import DeviceAPIMixin
|
||||||
from reolink_api.display import DisplayAPIMixin
|
from reolinkapi.display import DisplayAPIMixin
|
||||||
from reolink_api.download import DownloadAPIMixin
|
from reolinkapi.download import DownloadAPIMixin
|
||||||
from reolink_api.image import ImageAPIMixin
|
from reolinkapi.image import ImageAPIMixin
|
||||||
from reolink_api.motion import MotionAPIMixin
|
from reolinkapi.motion import MotionAPIMixin
|
||||||
from reolink_api.network import NetworkAPIMixin
|
from reolinkapi.network import NetworkAPIMixin
|
||||||
from reolink_api.ptz import PtzAPIMixin
|
from reolinkapi.ptz import PtzAPIMixin
|
||||||
from reolink_api.recording import RecordingAPIMixin
|
from reolinkapi.recording import RecordingAPIMixin
|
||||||
from reolink_api.resthandle import Request
|
from reolinkapi.resthandle import Request
|
||||||
from reolink_api.system import SystemAPIMixin
|
from reolinkapi.system import SystemAPIMixin
|
||||||
from reolink_api.user import UserAPIMixin
|
from reolinkapi.user import UserAPIMixin
|
||||||
from reolink_api.zoom import ZoomAPIMixin
|
from reolinkapi.zoom import ZoomAPIMixin
|
||||||
|
|
||||||
|
|
||||||
class APIHandler(AlarmAPIMixin,
|
class APIHandler(AlarmAPIMixin,
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
from typing import List
|
from typing import List, Dict
|
||||||
|
|
||||||
|
|
||||||
class DeviceAPIMixin:
|
class DeviceAPIMixin:
|
||||||
"""API calls for getting device information."""
|
"""API calls for getting device information."""
|
||||||
DEFAULT_HDD_ID = [0]
|
DEFAULT_HDD_ID = [0]
|
||||||
|
|
||||||
def get_hdd_info(self) -> object:
|
def get_hdd_info(self) -> Dict:
|
||||||
"""
|
"""
|
||||||
Gets all HDD and SD card information from Camera
|
Gets all HDD and SD card information from Camera
|
||||||
See examples/response/GetHddInfo.json for example response data.
|
See examples/response/GetHddInfo.json for example response data.
|
||||||
@@ -14,7 +14,7 @@ class DeviceAPIMixin:
|
|||||||
body = [{"cmd": "GetHddInfo", "action": 0, "param": {}}]
|
body = [{"cmd": "GetHddInfo", "action": 0, "param": {}}]
|
||||||
return self._execute_command('GetHddInfo', body)
|
return self._execute_command('GetHddInfo', body)
|
||||||
|
|
||||||
def format_hdd(self, hdd_id: List[int] = None) -> bool:
|
def format_hdd(self, hdd_id: List[float] = None) -> bool:
|
||||||
"""
|
"""
|
||||||
Format specified HDD/SD cards with their id's
|
Format specified HDD/SD cards with their id's
|
||||||
:param hdd_id: List of id's specified by the camera with get_hdd_info api. Default is 0 (SD card)
|
:param hdd_id: List of id's specified by the camera with get_hdd_info api. Default is 0 (SD card)
|
||||||
@@ -22,7 +22,7 @@ class DisplayAPIMixin:
|
|||||||
body = [{"cmd": "GetMask", "action": 1, "param": {"channel": 0}}]
|
body = [{"cmd": "GetMask", "action": 1, "param": {"channel": 0}}]
|
||||||
return self._execute_command('GetMask', body)
|
return self._execute_command('GetMask', body)
|
||||||
|
|
||||||
def set_osd(self, bg_color: bool = 0, channel: int = 0, osd_channel_enabled: bool = 0,
|
def set_osd(self, bg_color: bool = 0, channel: float = 0, osd_channel_enabled: bool = 0,
|
||||||
osd_channel_name: str = "", osd_channel_pos: str = "Lower Right", osd_time_enabled: bool = 0,
|
osd_channel_name: str = "", osd_channel_pos: str = "Lower Right", osd_time_enabled: bool = 0,
|
||||||
osd_time_pos: str = "Lower Right") -> bool:
|
osd_time_pos: str = "Lower Right") -> bool:
|
||||||
"""
|
"""
|
||||||
@@ -3,7 +3,7 @@ from datetime import datetime as dt
|
|||||||
|
|
||||||
|
|
||||||
# Type hints for input and output of the motion api response
|
# Type hints for input and output of the motion api response
|
||||||
RAW_MOTION_LIST_TYPE = List[Dict[str, Union[str, int, Dict[str, str]]]]
|
RAW_MOTION_LIST_TYPE = List[Dict[str, Union[str, float, Dict[str, str]]]]
|
||||||
PROCESSED_MOTION_LIST_TYPE = List[Dict[str, Union[str, dt]]]
|
PROCESSED_MOTION_LIST_TYPE = List[Dict[str, Union[str, dt]]]
|
||||||
|
|
||||||
|
|
||||||
@@ -3,8 +3,8 @@ from typing import Dict
|
|||||||
|
|
||||||
class NetworkAPIMixin:
|
class NetworkAPIMixin:
|
||||||
"""API calls for network settings."""
|
"""API calls for network settings."""
|
||||||
def set_net_port(self, http_port: int = 80, https_port: int = 443, media_port: int = 9000,
|
def set_net_port(self, http_port: float = 80, https_port: float = 443, media_port: float = 9000,
|
||||||
onvif_port: int = 8000, rtmp_port: int = 1935, rtsp_port: int = 554) -> bool:
|
onvif_port: float = 8000, rtmp_port: float = 1935, rtsp_port: float = 554) -> bool:
|
||||||
"""
|
"""
|
||||||
Set network ports
|
Set network ports
|
||||||
If nothing is specified, the default values will be used
|
If nothing is specified, the default values will be used
|
||||||
@@ -5,7 +5,7 @@ from urllib import parse
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from typing import Dict, Any, Optional
|
from typing import Dict, Any, Optional
|
||||||
from PIL.Image import Image, open as open_image
|
from PIL.Image import Image, open as open_image
|
||||||
from reolink_api.rtsp_client import RtspClient
|
from reolinkapi.rtsp_client import RtspClient
|
||||||
|
|
||||||
|
|
||||||
class RecordingAPIMixin:
|
class RecordingAPIMixin:
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import json
|
|
||||||
import requests
|
import requests
|
||||||
from typing import List, Dict, Union, Optional
|
from typing import List, Dict, Union, Optional
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@ import os
|
|||||||
from threading import ThreadError
|
from threading import ThreadError
|
||||||
from typing import Any
|
from typing import Any
|
||||||
import cv2
|
import cv2
|
||||||
from reolink_api.util import threaded
|
from reolinkapi.util import threaded
|
||||||
|
|
||||||
|
|
||||||
class RtspClient:
|
class RtspClient:
|
||||||
Reference in New Issue
Block a user