Deepcopy default tuning file so it isn't affected by calibration.

This commit is contained in:
Julian Stirling 2025-08-20 13:14:16 +01:00
parent 469562df4b
commit ab0bece70b

View file

@ -20,6 +20,7 @@ from datetime import datetime
import json import json
import logging import logging
import os import os
import copy
import tempfile import tempfile
import time import time
from contextlib import contextmanager from contextlib import contextmanager
@ -138,7 +139,7 @@ class StreamingPiCamera2(BaseCamera):
# Set tuning to default tuning. This will be overwritten when the Thing is # Set tuning to default tuning. This will be overwritten when the Thing is
# connects to the server if tuning is saved to disk. # connects to the server if tuning is saved to disk.
try: try:
self.tuning = self.default_tuning self.tuning = copy.deepcopy(self.default_tuning)
except NotConnectedToServerError: except NotConnectedToServerError:
# This will throw an error after setting as we are not connected to # This will throw an error after setting as we are not connected to
# a server. But we know this, so we ignore the error. # a server. But we know this, so we ignore the error.