@@ -338,8 +338,8 @@ async def get_value(self, field, handle, throw=True):
338338 FieldException: if the device does not have the specified field.
339339 """
340340 device = self .get_device (field )
341- # TODO some devices dont need to be awaited as they are just retrieving stored data,
342- # but other get data from PVs so do, make this better
341+ # TODO some devices dont need to be awaited as they are just retrieving stored
342+ # data, but others get data from PVs so do, make this better
343343 val = 0
344344 if inspect .iscoroutinefunction (device .get_value ):
345345 val = await device .get_value (handle , throw )
@@ -360,4 +360,10 @@ async def set_value(self, field, value, throw=True):
360360 Raises:
361361 FieldException: if the device does not have the specified field.
362362 """
363- await self .get_device (field ).set_value (value , throw )
363+ device = self .get_device (field )
364+ # TODO some devices dont need to be awaited as they are just setting local
365+ # data, but others set data to PVs, so do, make this better
366+ if inspect .iscoroutinefunction (device .set_value ):
367+ await device .set_value (value , throw )
368+ else :
369+ device .set_value (value , throw )
0 commit comments