Update README (implemented methods), add more getters
This commit is contained in:
48
README.md
48
README.md
@@ -32,36 +32,36 @@ This project intends to stick with [PEP8](https://www.python.org/dev/peps/pep-00
|
||||
GET:
|
||||
- [X] Login
|
||||
- [X] Logout
|
||||
- [ ] Display -> OSD
|
||||
- [ ] Recording -> Encode (Clear and Fluent Stream)
|
||||
- [ ] Recording -> Advance (Scheduling)
|
||||
- [X] Display -> OSD
|
||||
- [X] Recording -> Encode (Clear and Fluent Stream)
|
||||
- [X] Recording -> Advance (Scheduling)
|
||||
- [X] Network -> General
|
||||
- [X] Network -> Advanced
|
||||
- [ ] Network -> DDNS
|
||||
- [ ] Network -> NTP
|
||||
- [ ] Network -> E-mail
|
||||
- [ ] Network -> FTP
|
||||
- [ ] Network -> Push
|
||||
- [X] Network -> DDNS
|
||||
- [X] Network -> NTP
|
||||
- [X] Network -> E-mail
|
||||
- [X] Network -> FTP
|
||||
- [X] Network -> Push
|
||||
- [X] Network -> WIFI
|
||||
- [ ] Alarm -> Motion
|
||||
- [X] System -> General
|
||||
- [ ] System -> DST
|
||||
- [ ] System -> Information
|
||||
- [X] System -> DST
|
||||
- [X] System -> Information
|
||||
- [ ] System -> Maintenance
|
||||
- [ ] System -> Performance
|
||||
- [X] System -> Performance
|
||||
- [ ] System -> Reboot
|
||||
- [ ] User -> Online User
|
||||
- [ ] User -> Add User
|
||||
- [ ] User -> Manage User
|
||||
- [ ] Device -> HDD/SD Card
|
||||
- [X] User -> Online User
|
||||
- [X] User -> Add User
|
||||
- [X] User -> Manage User
|
||||
- [X] Device -> HDD/SD Card
|
||||
- [ ] Zoom
|
||||
- [ ] Focus
|
||||
- [ ] Image (Brightness, Contrass, Saturation, Hue, Sharp, Mirror, Rotate)
|
||||
- [ ] Image (Brightness, Contrast, Saturation, Hue, Sharp, Mirror, Rotate)
|
||||
- [ ] Advanced Image (Anti-flicker, Exposure, White Balance, DayNight, Backlight, LED light, 3D-NR)
|
||||
- [ ] Image Data -> "Snap" Frame from Video Stream
|
||||
- [X] Image Data -> "Snap" Frame from Video Stream
|
||||
|
||||
SET:
|
||||
- [ ] Display -> OSD
|
||||
- [X] Display -> OSD
|
||||
- [ ] Recording -> Encode (Clear and Fluent Stream)
|
||||
- [ ] Recording -> Advance (Scheduling)
|
||||
- [X] Network -> General
|
||||
@@ -73,15 +73,15 @@ SET:
|
||||
- [ ] Network -> Push
|
||||
- [X] Network -> WIFI
|
||||
- [ ] Alarm -> Motion
|
||||
- [X] System -> General
|
||||
- [ ] System -> General
|
||||
- [ ] System -> DST
|
||||
- [X] System -> Reboot
|
||||
- [ ] User -> Online User
|
||||
- [ ] User -> Add User
|
||||
- [ ] User -> Manage User
|
||||
- [ ] Device -> HDD/SD Card
|
||||
- [X] User -> Online User
|
||||
- [X] User -> Add User
|
||||
- [X] User -> Manage User
|
||||
- [X] Device -> HDD/SD Card (Format)
|
||||
- [x] PTZ
|
||||
- [x] Zoom
|
||||
- [x] Focus
|
||||
- [ ] Image (Brightness, Contrass, Saturation, Hue, Sharp, Mirror, Rotate)
|
||||
- [ ] Image (Brightness, Contrast, Saturation, Hue, Sharp, Mirror, Rotate)
|
||||
- [ ] Advanced Image (Anti-flicker, Exposure, White Balance, DayNight, Backlight, LED light, 3D-NR)
|
||||
|
||||
@@ -36,6 +36,7 @@ class NetworkAPIMixin:
|
||||
def get_net_ports(self) -> object:
|
||||
"""
|
||||
Get network ports
|
||||
See examples/response/GetNetworkAdvanced.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetNetPort", "action": 1, "param": {}},
|
||||
@@ -50,3 +51,65 @@ class NetworkAPIMixin:
|
||||
def scan_wifi(self):
|
||||
body = [{"cmd": "ScanWifi", "action": 1, "param": {}}]
|
||||
return self._execute_command('ScanWifi', body)
|
||||
|
||||
def get_network_general(self) -> object:
|
||||
"""
|
||||
Get the camera information
|
||||
See examples/response/GetNetworkGeneral.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetLocalLink", "action": 0, "param": {}}]
|
||||
return self._execute_command('GetLocalLink', body)
|
||||
|
||||
def get_network_ddns(self) -> object:
|
||||
"""
|
||||
Get the camera DDNS network information
|
||||
See examples/response/GetNetworkDDNS.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetDdns", "action": 0, "param": {}}]
|
||||
return self._execute_command('GetDdns', body)
|
||||
|
||||
def get_network_ntp(self) -> object:
|
||||
"""
|
||||
Get the camera NTP network information
|
||||
See examples/response/GetNetworkNTP.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetNtp", "action": 0, "param": {}}]
|
||||
return self._execute_command('GetNtp', body)
|
||||
|
||||
def get_network_email(self) -> object:
|
||||
"""
|
||||
Get the camera email network information
|
||||
See examples/response/GetNetworkEmail.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetEmail", "action": 0, "param": {}}]
|
||||
return self._execute_command('GetEmail', body)
|
||||
|
||||
def get_network_ftp(self) -> object:
|
||||
"""
|
||||
Get the camera FTP network information
|
||||
See examples/response/GetNetworkFtp.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetFtp", "action": 0, "param": {}}]
|
||||
return self._execute_command('GetFtp', body)
|
||||
|
||||
def get_network_push(self) -> object:
|
||||
"""
|
||||
Get the camera push network information
|
||||
See examples/response/GetNetworkPush.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetPush", "action": 0, "param": {}}]
|
||||
return self._execute_command('GetPush', body)
|
||||
|
||||
def get_network_status(self) -> object:
|
||||
"""
|
||||
Get the camera status network information
|
||||
See examples/response/GetNetworkGeneral.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
return self.get_network_general()
|
||||
|
||||
@@ -30,3 +30,12 @@ class SystemAPIMixin:
|
||||
"""
|
||||
body = [{"cmd": "Reboot", "action": 0, "param": {}}]
|
||||
return self._execute_command('Reboot', body)
|
||||
|
||||
def get_dst(self) -> object:
|
||||
"""
|
||||
Get the camera DST information
|
||||
See examples/response/GetDSTInfo.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetTime", "action": 0, "param": {}}]
|
||||
return self._execute_command('GetTime', body)
|
||||
35
examples/response/GetDSTInfo.json
Normal file
35
examples/response/GetDSTInfo.json
Normal file
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"cmd": "GetTime",
|
||||
"code": 0,
|
||||
"value": {
|
||||
"Dst": {
|
||||
"enable": 1,
|
||||
"endHour": 2,
|
||||
"endMin": 0,
|
||||
"endMon": 11,
|
||||
"endSec": 0,
|
||||
"endWeek": 1,
|
||||
"endWeekday": 0,
|
||||
"offset": 1,
|
||||
"startHour": 2,
|
||||
"startMin": 0,
|
||||
"startMon": 3,
|
||||
"startSec": 0,
|
||||
"startWeek": 1,
|
||||
"startWeekday": 0
|
||||
},
|
||||
"Time": {
|
||||
"day": 27,
|
||||
"hour": 18,
|
||||
"hourFmt": 0,
|
||||
"min": 50,
|
||||
"mon": 10,
|
||||
"sec": 46,
|
||||
"timeFmt": "MM/DD/YYYY",
|
||||
"timeZone": 21600,
|
||||
"year": 2020
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
42
examples/response/GetNetworkAdvanced.json
Normal file
42
examples/response/GetNetworkAdvanced.json
Normal file
@@ -0,0 +1,42 @@
|
||||
[
|
||||
{
|
||||
"cmd": "GetNetPort",
|
||||
"code": 0,
|
||||
"initial": {
|
||||
"NetPort": {
|
||||
"httpPort": 80,
|
||||
"httpsPort": 443,
|
||||
"mediaPort": 9000,
|
||||
"onvifPort": 8000,
|
||||
"rtmpPort": 1935,
|
||||
"rtspPort": 554
|
||||
}
|
||||
},
|
||||
"range": {
|
||||
"NetPort": {
|
||||
"httpPort": { "max": 65535, "min": 1 },
|
||||
"httpsPort": { "max": 65535, "min": 1 },
|
||||
"mediaPort": { "max": 65535, "min": 1 },
|
||||
"onvifPort": { "max": 65535, "min": 1 },
|
||||
"rtmpPort": { "max": 65535, "min": 1 },
|
||||
"rtspPort": { "max": 65535, "min": 1 }
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"NetPort": {
|
||||
"httpPort": 80,
|
||||
"httpsPort": 443,
|
||||
"mediaPort": 9000,
|
||||
"onvifPort": 8000,
|
||||
"rtmpPort": 1935,
|
||||
"rtspPort": 554
|
||||
}
|
||||
}
|
||||
},
|
||||
{ "cmd": "GetUpnp", "code": 0, "value": { "Upnp": { "enable": 0 } } },
|
||||
{
|
||||
"cmd": "GetP2p",
|
||||
"code": 0,
|
||||
"value": { "P2p": { "enable": 0, "uid": "99999999999999" } }
|
||||
}
|
||||
]
|
||||
15
examples/response/GetNetworkDDNS.json
Normal file
15
examples/response/GetNetworkDDNS.json
Normal file
@@ -0,0 +1,15 @@
|
||||
[
|
||||
{
|
||||
"cmd": "GetDdns",
|
||||
"code": 0,
|
||||
"value": {
|
||||
"Ddns": {
|
||||
"domain": "",
|
||||
"enable": 0,
|
||||
"password": "",
|
||||
"type": "no-ip",
|
||||
"userName": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
25
examples/response/GetNetworkEmail.json
Normal file
25
examples/response/GetNetworkEmail.json
Normal file
@@ -0,0 +1,25 @@
|
||||
[
|
||||
{
|
||||
"cmd": "GetEmail",
|
||||
"code": 0,
|
||||
"value": {
|
||||
"Email": {
|
||||
"addr1": "",
|
||||
"addr2": "",
|
||||
"addr3": "",
|
||||
"attachment": "picture",
|
||||
"interval": "5 Minutes",
|
||||
"nickName": "",
|
||||
"password": "",
|
||||
"schedule": {
|
||||
"enable": 1,
|
||||
"table": "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
|
||||
},
|
||||
"smtpPort": 465,
|
||||
"smtpServer": "smtp.gmail.com",
|
||||
"ssl": 1,
|
||||
"userName": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
24
examples/response/GetNetworkFtp.json
Normal file
24
examples/response/GetNetworkFtp.json
Normal file
@@ -0,0 +1,24 @@
|
||||
[
|
||||
{
|
||||
"cmd": "GetFtp",
|
||||
"code": 0,
|
||||
"value": {
|
||||
"Ftp": {
|
||||
"anonymous": 0,
|
||||
"interval": 30,
|
||||
"maxSize": 100,
|
||||
"mode": 0,
|
||||
"password": "",
|
||||
"port": 21,
|
||||
"remoteDir": "",
|
||||
"schedule": {
|
||||
"enable": 1,
|
||||
"table": "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
|
||||
},
|
||||
"server": "",
|
||||
"streamType": 0,
|
||||
"userName": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
19
examples/response/GetNetworkGeneral.json
Normal file
19
examples/response/GetNetworkGeneral.json
Normal file
@@ -0,0 +1,19 @@
|
||||
[
|
||||
{
|
||||
"cmd": "GetLocalLink",
|
||||
"code": 0,
|
||||
"value": {
|
||||
"LocalLink": {
|
||||
"activeLink": "LAN",
|
||||
"dns": { "auto": 1, "dns1": "192.168.255.4", "dns2": "192.168.255.4" },
|
||||
"mac": "EC:71:DB:AA:59:CF",
|
||||
"static": {
|
||||
"gateway": "192.168.255.1",
|
||||
"ip": "192.168.255.58",
|
||||
"mask": "255.255.255.0"
|
||||
},
|
||||
"type": "DHCP"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
14
examples/response/GetNetworkNTP.json
Normal file
14
examples/response/GetNetworkNTP.json
Normal file
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"cmd": "GetNtp",
|
||||
"code": 0,
|
||||
"value": {
|
||||
"Ntp": {
|
||||
"enable": 1,
|
||||
"interval": 1440,
|
||||
"port": 123,
|
||||
"server": "ntp.moos.xyz"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
14
examples/response/GetNetworkPush.json
Normal file
14
examples/response/GetNetworkPush.json
Normal file
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"cmd": "GetPush",
|
||||
"code": 0,
|
||||
"value": {
|
||||
"Push": {
|
||||
"schedule": {
|
||||
"enable": 1,
|
||||
"table": "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user