A method for controlling a device using a shape-memory alloy wire is disclosed. The method includes determining an ontime for the shape-memory alloy wire based on a target volume to be pumped by a pump plunger, determining the temperature of the shape-memory alloy wire and adjusting the ontime based on the temperature of the shape-memory alloy wire.