Add Alarm getters
This commit is contained in:
@@ -6,6 +6,7 @@ from .network import NetworkAPIMixin
|
||||
from .system import SystemAPIMixin
|
||||
from .user import UserAPIMixin
|
||||
from .ptz import PtzAPIMixin
|
||||
from .alarm import AlarmAPIMixin
|
||||
from resthandle import Request
|
||||
|
||||
|
||||
@@ -16,7 +17,8 @@ class APIHandler(SystemAPIMixin,
|
||||
DisplayAPIMixin,
|
||||
RecordingAPIMixin,
|
||||
ZoomAPIMixin,
|
||||
PtzAPIMixin):
|
||||
PtzAPIMixin,
|
||||
AlarmAPIMixin):
|
||||
"""
|
||||
The APIHandler class is the backend part of the API, the actual API calls
|
||||
are implemented in Mixins.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from .APIHandler import APIHandler
|
||||
|
||||
__version__ = "0.0.1"
|
||||
__version__ = "0.0.2"
|
||||
VERSION = __version__
|
||||
|
||||
11
api/alarm.py
Normal file
11
api/alarm.py
Normal file
@@ -0,0 +1,11 @@
|
||||
class AlarmAPIMixin:
|
||||
"""API calls for getting device alarm information."""
|
||||
|
||||
def get_alarm_motion(self) -> object:
|
||||
"""
|
||||
Gets the device alarm motion
|
||||
See examples/response/GetAlarmMotion.json for example response data.
|
||||
:return: response json
|
||||
"""
|
||||
body = [{"cmd": "GetAlarm", "action": 1, "param": {"Alarm": {"channel": 0, "type": "md"}}}]
|
||||
return self._execute_command('GetAlarm', body)
|
||||
Reference in New Issue
Block a user