Flash LED endpoint in simulator for parity

This commit is contained in:
Joe Knapper 2026-02-10 15:52:06 +00:00
parent 9ab5a461c0
commit 1de4366df7
2 changed files with 23 additions and 2 deletions

View file

@ -342,7 +342,11 @@ class SimulatedCamera(BaseCamera):
def generate_frame(self) -> Image.Image:
"""Generate a frame with blobs based on the stage coordinates."""
pos = self._stage.instantaneous_position
return self.generate_image((pos["y"], pos["x"], pos["z"]))
frame = self.generate_image((pos["y"], pos["x"], pos["z"]))
# Simulate LED turning off by setting all channels to 0
if not self._stage.led_on:
frame = np.full((self.shape[0], self.shape[1], 3), 0, dtype=np.uint8)
return frame
def __enter__(self) -> Self:
"""Start the capture thread when the Thing context manager is opened."""