diff --git a/APIHandler.py b/APIHandler.py index ee7472b..b855c43 100644 --- a/APIHandler.py +++ b/APIHandler.py @@ -398,6 +398,26 @@ class APIHandler: print("Could not get device information", e) raise + ########### + # SET + ########### + def reboot_camera(self) -> bool: + """ + Reboots the camera + :return: bool + """ + try: + param = {"cmd": "Reboot", "token": self.token} + body = [{"cmd": "Reboot", "action": 0, "param": {}}] + response = Request.post(self.url, data=body, params=param) + if response.status_code == 200: + return True + print("Something went wrong. Could not reboot camera. Status:", response.status_code) + return False + except Exception as e: + print("Could not reboot camera", e) + raise + ########## # User ########## diff --git a/README.md b/README.md index 20aa9b5..7feee35 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ This repository's purpose is to deliver a complete API for the Reolink Camera's, ### But Reolink gives an API in their documentation -Not really. They only deliver a really basic API to retrieve Image data and Video data. +Not really. They only deliver a really basic API to retrieve Image data and Video data. ### How? -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. +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. ### Get started @@ -68,7 +68,7 @@ SET: - [ ] Alarm -> Motion - [X] System -> General - [ ] System -> DST -- [ ] System -> Reboot +- [X] System -> Reboot - [ ] User -> Online User - [ ] User -> Add User - [ ] User -> Manage User