actuators: remove function from center param (#26517)

* fix center parameter metadata

* revert module_schema

---------

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
This commit is contained in:
Nick
2026-03-06 09:00:52 +01:00
committed by GitHub
parent b5deafdc92
commit ce828af85c
5 changed files with 33 additions and 38 deletions

View File

@@ -234,14 +234,14 @@ def get_actuator_output(yaml_config, output_functions, timer_config_file, verbos
param_prefix = process_param_prefix(group['param_prefix'])
standard_params = group.get('standard_params', {})
standard_params_array = [
( 'function', 'Function', 'FUNC', False ),
( 'disarmed', 'Disarmed', 'DIS', False ),
( 'min', 'Minimum', 'MIN', False ),
( 'max', 'Maximum', 'MAX', False ),
( 'center', 'Center\n(for Servos)', 'CENT', False ),
( 'failsafe', 'Failsafe', 'FAIL', True ),
( 'function', 'Function', 'FUNC', False, True ),
( 'disarmed', 'Disarmed', 'DIS', False, True ),
( 'min', 'Minimum', 'MIN', False, True ),
( 'center', 'Center\n(for Servos)', 'CENT', False, False ),
( 'max', 'Maximum', 'MAX', False, True ),
( 'failsafe', 'Failsafe', 'FAIL', True, True ),
]
for key, label, param_suffix, advanced in standard_params_array:
for key, label, param_suffix, advanced, has_function in standard_params_array:
show_if = None
if key in standard_params and 'show_if' in standard_params[key]:
show_if = standard_params[key]['show_if']
@@ -250,13 +250,12 @@ def get_actuator_output(yaml_config, output_functions, timer_config_file, verbos
param = {
'label': label,
'name': param_prefix+'_'+param_suffix+'${i}',
'function': key,
}
if has_function: param['function'] = key
if advanced: param['advanced'] = True
if show_if: param['show-if'] = show_if
per_channel_params.append(param)
param = {
'label': 'Rev Range\n(for Servos)',
'name': param_prefix+'_REV',

View File

@@ -312,11 +312,7 @@ When set to -1 (default), the value depends on the function (see {:}).
if standard_params[key]['max'] >= 1<<16:
raise Exception('maximum value for {:} expected <= {:} (got {:})'.format(key, 1<<16, standard_params[key]['max']))
if key == 'failsafe':
standard_params[key]['default'] = -1
standard_params[key]['min'] = -1
if key == 'center':
if key == 'failsafe' or key == 'center':
standard_params[key]['default'] = -1
standard_params[key]['min'] = -1