Improve __enter__ typing for things

This commit is contained in:
Julian Stirling 2025-12-17 23:07:39 +00:00
parent d52548cc13
commit afbc00acef
6 changed files with 19 additions and 20 deletions

View file

@ -15,7 +15,7 @@ import tempfile
import time
from datetime import datetime
from types import TracebackType
from typing import Any, Literal, Mapping, Optional, Tuple
from typing import Any, Literal, Mapping, Optional, Self, Tuple
import numpy as np
import piexif
@ -180,7 +180,7 @@ class BaseCamera(lt.Thing):
}
self._detector_name = "Channel Deviations (LUV)"
def __enter__(self) -> None:
def __enter__(self) -> Self:
"""Open hardware connection when the Thing context manager is opened."""
raise NotImplementedError("CameraThings must define their own __enter__ method")