Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ahiuchingau committed Jul 9, 2024
1 parent 0848bfd commit 439e88f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions api/src/opentrons/drivers/absorbance_reader/async_byonoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
AbsorbanceHidInterface as AbsProtocol,
ErrorCodeNames,
DeviceStateNames,
SlotStateNames,
)
from opentrons.drivers.types import (
AbsorbanceReaderLidStatus,
Expand Down Expand Up @@ -276,17 +277,10 @@ async def get_single_measurement(self, wavelength: int) -> List[float]:
)

async def get_plate_presence(self) -> AbsorbanceReaderPlatePresence:

presence = await self._loop.run_in_executor(
executor=self._executor, func=self._get_slot_status
)
map = {
AbsProtocol.SlotState.BYONOY_SLOT_STATE_UNKNOWN: AbsorbanceReaderPlatePresence.UNKNOWN,
AbsProtocol.SlotState.BYONOY_SLOT_STATE_EMPTY: AbsorbanceReaderPlatePresence.ABSENT,
AbsProtocol.SlotState.BYONOY_SLOT_STATE_OCCUPIED: AbsorbanceReaderPlatePresence.PRESENT,
AbsProtocol.SlotState.BYONOY_SLOT_UNDETERMINED: AbsorbanceReaderPlatePresence.UNKNOWN,
}
return map[presence]
return self.convert_plate_presence(presence.name)

async def get_device_status(self) -> AbsorbanceReaderDeviceState:
status = await self._loop.run_in_executor(
Expand All @@ -306,3 +300,15 @@ def convert_device_state(
"BYONOY_DEVICE_STATE_ERROR": AbsorbanceReaderDeviceState.ERROR,
}
return state_map[device_state]

@staticmethod
def convert_plate_presence(
slot_state: SlotStateNames,
) -> AbsorbanceReaderPlatePresence:
state_map: Dict[SlotStateNames, AbsorbanceReaderPlatePresence] = {
"BYONOY_SLOT_UNKNOWN": AbsorbanceReaderPlatePresence.UNKNOWN,
"BYONOY_SLOT_EMPTY": AbsorbanceReaderPlatePresence.ABSENT,
"BYONOY_SLOT_OCCUPIED": AbsorbanceReaderPlatePresence.PRESENT,
"BYONOY_SLOT_UNDETERMINED": AbsorbanceReaderPlatePresence.UNKNOWN,
}
return state_map[slot_state]

0 comments on commit 439e88f

Please sign in to comment.