Skip to content

Commit facfa1b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 485e75e commit facfa1b

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

Components.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,3 @@ Select the FC connection **type** (serial port or CAN bus) and the matching **pr
217217
| other | vendor-specific |
218218

219219
If you do not have a telemetry radio, select `None` as the connection type.
220-

ardupilot_methodic_configurator/data_model_vehicle_components_validation.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -456,18 +456,17 @@ def _update_possible_choices_for_path( # pylint: disable=too-many-branches
456456
for v in ESC_TELEMETRY_DICT.values()
457457
if isinstance(v["type"], list) and value in v["type"]
458458
) or ("None",)
459-
else: # "FC->ESC Connection"
460-
if value == "None":
461-
self._possible_choices[protocol_path] = ("None",)
462-
elif value in CAN_PORTS:
463-
self._possible_choices[protocol_path] = ("DroneCAN",)
464-
elif value in SERIAL_PORTS:
465-
self._possible_choices[protocol_path] = tuple(
466-
str(v["protocol"]) for v in SERIAL_PROTOCOLS_DICT.values() if v["component"] == "ESC"
467-
)
468-
else:
469-
# For PWM outputs, use motor PWM types
470-
self._possible_choices[protocol_path] = self._mot_pwm_types
459+
elif value == "None":
460+
self._possible_choices[protocol_path] = ("None",)
461+
elif value in CAN_PORTS:
462+
self._possible_choices[protocol_path] = ("DroneCAN",)
463+
elif value in SERIAL_PORTS:
464+
self._possible_choices[protocol_path] = tuple(
465+
str(v["protocol"]) for v in SERIAL_PROTOCOLS_DICT.values() if v["component"] == "ESC"
466+
)
467+
else:
468+
# For PWM outputs, use motor PWM types
469+
self._possible_choices[protocol_path] = self._mot_pwm_types
471470

472471
elif component_name == "GNSS Receiver":
473472
if value == "None":
@@ -651,8 +650,8 @@ def validate_all_data(self, entry_values: dict[ComponentPath, str]) -> tuple[boo
651650

652651
# Check for duplicate connections
653652
esc_conn_sections = {"FC->ESC Connection", "ESC->FC Telemetry"}
654-
is_fc_conn_type = len(path) >= 3 and path[2] == "Type" and (
655-
path[1] == "FC Connection" or path[1] in esc_conn_sections
653+
is_fc_conn_type = (
654+
len(path) >= 3 and path[2] == "Type" and (path[1] == "FC Connection" or path[1] in esc_conn_sections)
656655
)
657656
if is_fc_conn_type:
658657
if value in fc_serial_connection and value not in {"CAN1", "CAN2", "I2C1", "I2C2", "I2C3", "I2C4", "None"}:

0 commit comments

Comments
 (0)