Implemented root API v2 routes

This commit is contained in:
jtc42 2019-11-14 16:33:00 +00:00
parent 5aa783c269
commit 6581612312
27 changed files with 1205 additions and 148 deletions

View file

@ -26,7 +26,7 @@ class MockStreamer(BaseCamera):
BaseCamera.__init__(self)
# Store state of PiCameraStreamer
self.state.update(
self.status.update(
{"stream_active": False, "record_active": False, "board": None}
)
@ -74,13 +74,13 @@ class MockStreamer(BaseCamera):
BaseCamera.close(self)
# HANDLE SETTINGS
def read_config(self) -> dict:
def read_settings(self) -> dict:
"""
Return config dictionary of the PiCameraStreamer.
"""
# Get config items from the base class
conf_dict = BaseCamera.read_config(self)
conf_dict = BaseCamera.read_settings(self)
# Include device-specific config items
conf_dict.update(
@ -94,7 +94,7 @@ class MockStreamer(BaseCamera):
return conf_dict
def apply_config(self, config: dict):
def apply_settings(self, config: dict):
"""
Write a config dictionary to the PiCameraStreamer config.
@ -110,7 +110,7 @@ class MockStreamer(BaseCamera):
with self.lock:
# Apply valid config params to camera object
if not self.state["record_active"]: # If not recording a video
if not self.status["record_active"]: # If not recording a video
for key, value in config.items(): # For each provided setting
if hasattr(self, key):