7777UNKNOWN = 401 # not in SECoP standard (yet)
7878
7979
80- READABLE_PARAMS = ["value" , "target" , "status" ]
80+ HINTED_PARAMS = [
81+ "value" ,
82+ ]
83+ UNCACHED_PARAMS = ["target" , "status" ]
8184
8285
8386def clean_identifier (anystring ):
@@ -250,7 +253,7 @@ def __init__(
250253 )
251254
252255 self .logger .info (f"Initializing SECoPBaseDevice for module { module_name } " )
253- # Add configuration Signal
256+ # Add configuration Signals
254257 with self .add_children_as_readables (
255258 format = StandardReadableFormat .CONFIG_SIGNAL
256259 ):
@@ -270,7 +273,7 @@ def __init__(
270273
271274 # generate Signals from Module parameters eiter r or rw
272275 for parameter , properties in module_desc ["parameters" ].items ():
273- if parameter in READABLE_PARAMS :
276+ if parameter in HINTED_PARAMS + UNCACHED_PARAMS :
274277 continue
275278 # generate new root path
276279 param_path = Path (parameter_name = parameter , module_name = module_name )
@@ -286,11 +289,34 @@ def __init__(
286289 )
287290 self .param_devices [parameter ] = getattr (self , parameter )
288291
289- # Add readables Signals
292+ # Add hinted readable Signals
290293 with self .add_children_as_readables (
291294 format = StandardReadableFormat .HINTED_SIGNAL
292295 ):
293- for parameter in READABLE_PARAMS :
296+ for parameter in HINTED_PARAMS :
297+ if parameter not in module_desc ["parameters" ].keys ():
298+ continue
299+ properties = module_desc ["parameters" ][parameter ]
300+
301+ # generate new root path
302+ param_path = Path (parameter_name = parameter , module_name = module_name )
303+
304+ # readonly propertyns to plans and plan stubs.
305+ readonly = properties .get ("readonly" , None )
306+
307+ # Normal types + (struct and tuple as JSON object Strings)
308+ self ._signal_from_parameter (
309+ path = param_path ,
310+ sig_name = parameter ,
311+ readonly = readonly ,
312+ )
313+ self .param_devices [parameter ] = getattr (self , parameter )
314+
315+ # Add uncached readable Signals
316+ with self .add_children_as_readables (
317+ format = StandardReadableFormat .UNCACHED_SIGNAL
318+ ):
319+ for parameter in UNCACHED_PARAMS :
294320 if parameter not in module_desc ["parameters" ].keys ():
295321 continue
296322 properties = module_desc ["parameters" ][parameter ]
0 commit comments