diff --git a/instruments/tests/test_thorlabs/test_thorlabs_apt.py b/instruments/tests/test_thorlabs/test_thorlabs_apt.py index b68e6109..573b301c 100644 --- a/instruments/tests/test_thorlabs/test_thorlabs_apt.py +++ b/instruments/tests/test_thorlabs/test_thorlabs_apt.py @@ -1404,6 +1404,64 @@ def test_apt_mc_home_parameters_set_with_none(init_kdc101): apt.channel[0].home_parameters = None, None, None, None +def test_apt_mc_home_parameters_set_offset_to_zero(init_kdc101): + """Ensure setting offset to zero is not interpreted as `None`.""" + home_direction = 1 + limit_switch = 1 + velocity = 1000 + offset = 1250 + offset_new = 0 + with expected_protocol( + ik.thorlabs.APTMotorController, + [ + init_kdc101[0], + ThorLabsPacket( + message_id=ThorLabsCommands.MOT_REQ_HOMEPARAMS, + param1=0x01, + param2=0x00, + dest=0x50, + source=0x01, + data=None, + ).pack(), + ThorLabsPacket( + message_id=ThorLabsCommands.MOT_SET_HOMEPARAMS, + param1=None, + param2=None, + dest=0x50, + source=0x01, + data=struct.pack( + "