@pytest.mark.parametrize(argnames=['sensor', 'node_id', 'timeout'], argvalues=[[lazy_fixture('capacitive_sensor'), NodeId.pipette_left, 2], [lazy_fixture('pressure_sensor'), NodeId.pipette_right, 3], [lazy_fixture('temperature_sensor'), NodeId.pipette_left, 2], [lazy_fixture('humidity_sensor'), NodeId.pipette_right, 2]])
async def test_peripheral_status(mock_messenger: mock.AsyncMock, can_message_notifier: MockCanMessageNotifier, sensor: sensor_abc.AbstractAdvancedSensor, node_id: NodeId, timeout: int) -> None:
    'Test for getting peripheral device status.'

    def responder(node_id: NodeId, message: MessageDefinition) -> None:
        'Message responder.'
        if isinstance(message, PeripheralStatusRequest):
            can_message_notifier.notify(PeripheralStatusResponse(payload=PeripheralStatusResponsePayload(sensor=SensorTypeField(sensor._sensor_type), sensor_id=SensorIdField(SensorId.S0), status=UInt8Field(1))), ArbitrationId(parts=ArbitrationIdParts(message_id=ReadFromSensorResponse.message_id, node_id=node_id, function_code=0, originating_node_id=node_id)))
    mock_messenger.send.side_effect = responder
    status = (await sensor.get_device_status(mock_messenger, node_id, timeout))
    assert status
Test for getting peripheral device status.
@pytest.mark.parametrize(argnames=['sensor', 'node_id', 'timeout'], argvalues=[[lazy_fixture('capacitive_sensor'), NodeId.pipette_left, 2], [lazy_fixture('pressure_sensor'), NodeId.pipette_right, 3], [lazy_fixture('temperature_sensor'), NodeId.pipette_left, 2], [lazy_fixture('humidity_sensor'), NodeId.pipette_right, 2]])
async def test_peripheral_status(mock_messenger: mock.AsyncMock, can_message_notifier: MockCanMessageNotifier, sensor: sensor_abc.AbstractAdvancedSensor, node_id: NodeId, timeout: int) -> None:
    

    def responder(node_id: NodeId, message: MessageDefinition) -> None:
        'Message responder.'
        if isinstance(message, PeripheralStatusRequest):
            can_message_notifier.notify(PeripheralStatusResponse(payload=PeripheralStatusResponsePayload(sensor=SensorTypeField(sensor._sensor_type), sensor_id=SensorIdField(SensorId.S0), status=UInt8Field(1))), ArbitrationId(parts=ArbitrationIdParts(message_id=ReadFromSensorResponse.message_id, node_id=node_id, function_code=0, originating_node_id=node_id)))
    mock_messenger.send.side_effect = responder
    status = (await sensor.get_device_status(mock_messenger, node_id, timeout))
    assert status