fix issues with sea is_running

This commit is contained in:
zolliker 2021-04-26 11:56:48 +02:00 committed by Markus Zolliker
parent 25b8780b11
commit 7ff88cf819

View File

@ -420,7 +420,11 @@ class SeaModule(Module):
include = True include = True
for paramdesc in descr['params']: for paramdesc in descr['params']:
path = paramdesc['path'] path = paramdesc['path']
if paramdesc.get('visibility', 1) > visibility_level and not path.endswith('is_running'): if path.endswith('is_running'):
# take this always
result.append(paramdesc)
continue
if paramdesc.get('visibility', 1) > visibility_level:
continue continue
sub = path.split('/', 1) sub = path.split('/', 1)
if rpath == '.': # take all except subpaths with readonly node at top if rpath == '.': # take all except subpaths with readonly node at top
@ -431,12 +435,10 @@ class SeaModule(Module):
elif sub[0] == rpath: elif sub[0] == rpath:
result.append(paramdesc) result.append(paramdesc)
descr['params'] = result descr['params'] = result
rel0 = '' if rel_paths[0] == '.' else rel_paths[0] for valuedesc in result:
if result[0]['path'] == rel0: if valuedesc['path'] == '':
if issubclass(cls, Readable): valuedesc['key'] = 'value'
result[0]['key'] = 'value' break
else:
result.pop(0)
else: else:
logger.error('%s: no value found', name) logger.error('%s: no value found', name)
# logger.info('PARAMS %s %r', name, result) # logger.info('PARAMS %s %r', name, result)