Skip to content

Commit a2c44f8

Browse files
authored
Merge pull request #5 from themoosman/master
Add System->Reboot
2 parents 24fb7d2 + 577dcad commit a2c44f8

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

APIHandler.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,26 @@ def get_information(self) -> json or None:
398398
print("Could not get device information", e)
399399
raise
400400

401+
###########
402+
# SET
403+
###########
404+
def reboot_camera(self) -> bool:
405+
"""
406+
Reboots the camera
407+
:return: bool
408+
"""
409+
try:
410+
param = {"cmd": "Reboot", "token": self.token}
411+
body = [{"cmd": "Reboot", "action": 0, "param": {}}]
412+
response = Request.post(self.url, data=body, params=param)
413+
if response.status_code == 200:
414+
return True
415+
print("Something went wrong. Could not reboot camera. Status:", response.status_code)
416+
return False
417+
except Exception as e:
418+
print("Could not reboot camera", e)
419+
raise
420+
401421
##########
402422
# User
403423
##########

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ This repository's purpose is to deliver a complete API for the Reolink Camera's,
77

88
### But Reolink gives an API in their documentation
99

10-
Not really. They only deliver a really basic API to retrieve Image data and Video data.
10+
Not really. They only deliver a really basic API to retrieve Image data and Video data.
1111

1212
### How?
1313

14-
You can get the Restful API calls by looking through the HTTP Requests made the camera web console. I use Google Chrome developer mode (ctr + shift + i) -> Network.
14+
You can get the Restful API calls by looking through the HTTP Requests made the camera web console. I use Google Chrome developer mode (ctr + shift + i) -> Network.
1515

1616
### Get started
1717

@@ -68,7 +68,7 @@ SET:
6868
- [ ] Alarm -> Motion
6969
- [X] System -> General
7070
- [ ] System -> DST
71-
- [ ] System -> Reboot
71+
- [X] System -> Reboot
7272
- [ ] User -> Online User
7373
- [ ] User -> Add User
7474
- [ ] User -> Manage User

0 commit comments

Comments
 (0)