Fix simulated imports

This commit is contained in:
Joe Knapper 2026-02-11 10:26:04 +00:00
parent 676d34842a
commit 16458db85b
2 changed files with 5 additions and 7 deletions

View file

@ -341,7 +341,6 @@ class SimulatedCamera(BaseCamera):
return pl_img.resize((self.shape[1], self.shape[0]), Image.Resampling.BILINEAR)
def set_led(self, led_on: bool = True) -> None:
def set_led(self, led_on: bool = True, led_channel: str = None) -> None: # noqa: ARG002
"""Set the simulated LED to on or off."""
if led_on:
self.mult = 1

View file

@ -5,8 +5,8 @@ from typing import Literal
import labthings_fastapi as lt
from .camera import SimulatedCamera
from .stage import SangaboardThing
from .camera.simulation import SimulatedCamera
from .stage.sangaboard import SangaboardThing
class Illumination(lt.Thing):
@ -58,15 +58,14 @@ class SimulatorIllumination(Illumination):
self,
number_of_flashes: int = 10,
dt: float = 0.5,
led_channel: Literal["cc"] = "cc",
) -> None:
"""Flash an LED a given number of times.
Flashes the LED on channel led_channel number_of_flashes times,
Flashes the simulated LED number_of_flashes times,
for a duration of dt each.
"""
for _ in range(number_of_flashes):
self._cam.set_led(False, led_channel)
self._cam.set_led(False)
time.sleep(dt)
self._cam.set_led(True, led_channel)
self._cam.set_led(True)
time.sleep(dt)