return function(gate) gate:cb(gate.ports[1].state and 1 or 0) end