summaryrefslogtreecommitdiff
path: root/src/camera_node.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-01-04 03:44:07 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-01-04 03:44:07 +0300
commitd549f428cbbd54c49a90f92928e670d373c4a0d9 (patch)
treeb895a216a37483c082af6f20b2d6aef8560db7b3 /src/camera_node.py
parent00de2339b4a61921c4b8789883e5c77b4528a60b (diff)
config: use get_addr() instead of parse_addr(config[...])
Diffstat (limited to 'src/camera_node.py')
-rwxr-xr-xsrc/camera_node.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/camera_node.py b/src/camera_node.py
index 2df8df7..9ff0e77 100755
--- a/src/camera_node.py
+++ b/src/camera_node.py
@@ -5,7 +5,7 @@ import time
from home.config import config
from home.media import MediaNodeServer, ESP32CameraRecordStorage, CameraRecorder
from home.camera import CameraType, esp32
-from home.util import parse_addr, Addr
+from home.util import Addr
from home import http
@@ -69,7 +69,7 @@ if __name__ == '__main__':
recorder_kwargs = {}
camera_type = CameraType(config['camera']['type'])
if camera_type == CameraType.ESP32:
- recorder_kwargs['stream_addr'] = parse_addr(config['camera']['web_addr']) # this is not a mistake, we don't use stream_addr for esp32-cam anymore
+ recorder_kwargs['stream_addr'] = config.get_addr('camera.web_addr') # this is not a mistake, we don't use stream_addr for esp32-cam anymore
storage = ESP32CameraRecordStorage(config['node']['storage'])
else:
raise RuntimeError(f'unsupported camera type {camera_type}')
@@ -82,6 +82,6 @@ if __name__ == '__main__':
server = ESP32CameraNodeServer(
recorder=recorder,
storage=storage,
- web_addr=parse_addr(config['camera']['web_addr']),
- addr=parse_addr(config['node']['listen']))
+ web_addr=config.get_addr('camera.web_addr'),
+ addr=config.get_addr('node.listen'))
server.run()