import asyncio from mcu.capture.smart_shooter_class import SmartShooter smart = SmartShooter(None) async def parserProperty(CameraPropertyType=None): status, camera_property = await smart.GetCameraProperty() if CameraPropertyType: camera_property_obj = None for item in camera_property: if item['CameraPropertyType'] == CameraPropertyType: camera_property_obj = item break return camera_property_obj if camera_property_obj else camera_property return camera_property async def setCameraProperty(property="Aperture", value=""): await smart.setCameraProperty(property=property, value=value) async def main(): ''' Aperture:光圈 ShutterSpeed:快门速度 ISO:ISO设置 Exposure:曝光 "CameraPropertyType": 参数类型, "CameraPropertyValue": 当前值, "CameraPropertyIsWriteable": 是否可写, "CameraPropertyRange" 参数范围 ''' # camera_property = await parserProperty("Aperture") # print('property', camera_property) await setCameraProperty('Exposure', '5.0') if __name__ == "__main__": asyncio.run(main())