<matchingFunction>
<operator>EQUALS</operator>
<contextType>DEVICE_PLATFORM</contextType>
</lhsOperand>
<type>STRING</type>
<stringValue>Mobile</stringValue>
</rhsOperand>
</matchingFunction>
In other words, replace the Identity function with a function where:
I'm a Java guy, so here's how I did it in Java. Python should be very similar.
RequestContextOperand platformRequestContextOperand = new RequestContextOperand();
platformRequestContextOperand.setContextType(RequestContextOperandContextType.DEVICE_PLATFORM);
ConstantOperand platformOperand = new ConstantOperand();
platformOperand.setStringValue("Mobile");
platformOperand.setType(ConstantOperandConstantType.STRING);
Function platformFunction = new Function();
platformFunction.setLhsOperand(new FunctionArgumentOperand[] {platformRequestContextOperand});
platformFunction.setOperator(FunctionOperator.EQUALS);
platformFunction.setRhsOperand(new FunctionArgumentOperand[] {platformOperand});
customerFeed.setMatchingFunction(platformFunction);
Once that CustomerFeed is added, you'll see (Mobile devices only) under Account extension on the Ad extensions tab in the AdWords UI.
Let me know if that doesn't clear things up.
Cheers,
Josh, AdWords API Team