Skip to content

Commit e984072

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

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

ardupilot_methodic_configurator/data_model_vehicle_components_validation.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ def _get_current_esc_to_fc_dict(self) -> "EscToFcTelemetryDict":
362362
return {}
363363

364364
def get_valid_esc_telemetry_types(self) -> tuple[str, ...]:
365-
"""Return valid ESC->FC Telemetry Type values for the current FC->ESC connection protocol.
365+
"""
366+
Return valid ESC->FC Telemetry Type values for the current FC->ESC connection protocol.
366367
367368
Uses the ESC_CONNECTION_DICT directly (via _get_current_esc_to_fc_dict) so it does not
368369
depend on _mot_pwm_types being populated from a doc file. This makes it safe to call from
@@ -382,7 +383,8 @@ def get_valid_esc_telemetry_types(self) -> tuple[str, ...]:
382383
return tuple(valid) if valid else ("None",)
383384

384385
def is_esc_telemetry_type_mirrored(self) -> bool:
385-
"""Return True when the ESC->FC Telemetry Type combobox should be greyed-out.
386+
"""
387+
Return True when the ESC->FC Telemetry Type combobox should be greyed-out.
386388
387389
True ONLY when the ESC_to_FC dict has EXACTLY ONE key: ("same_as_FC_to_ESC",).
388390
This covers fully-mirrored entries like ESC_TO_FC_TELEMETRY_SAME (CAN/DroneCAN and
@@ -396,7 +398,8 @@ def is_esc_telemetry_type_mirrored(self) -> bool:
396398
return esc_to_fc_dict == {("same_as_FC_to_ESC",): esc_to_fc_dict.get(("same_as_FC_to_ESC",))}
397399

398400
def is_esc_telemetry_protocol_mirrored(self) -> bool:
399-
"""Return True when the ESC->FC Telemetry Protocol combobox should be greyed-out.
401+
"""
402+
Return True when the ESC->FC Telemetry Protocol combobox should be greyed-out.
400403
401404
True when the matching ESC_CONNECTION_DICT entry has "same_as_FC_to_ESC" as a value,
402405
meaning the telemetry protocol is forced to match the FC->ESC protocol exactly.
@@ -557,7 +560,7 @@ def _compute_telem_serial_protocols(
557560
# PWM / None: restrict to protocols supported by the currently selected FC->ESC Protocol.
558561
fc_esc_protocol = str(self.get_component_value(("ESC", "FC->ESC Connection", "Protocol")) or "")
559562
# Find the ESC_to_FC dict for the current protocol entry.
560-
esc_to_fc: "EscToFcTelemetryDict" = {("None",): "None"}
563+
esc_to_fc: EscToFcTelemetryDict = {("None",): "None"}
561564
for entry in esc_sub.values():
562565
if entry.get("protocol") == fc_esc_protocol:
563566
raw = entry.get("ESC_to_FC", {("None",): "None"})

ardupilot_methodic_configurator/frontend_tkinter_component_editor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ def update_component_protocol_combobox_entries(self, component_path: ComponentPa
140140
return err_msg
141141

142142
def _set_esc_telemetry_combobox_mirror_state(self) -> None:
143-
"""Mirror (grey-out) or unmirror ESC->FC Telemetry comboboxes based on FC->ESC Connection Type.
143+
"""
144+
Mirror (grey-out) or unmirror ESC->FC Telemetry comboboxes based on FC->ESC Connection Type.
144145
145146
Delegates the mirror condition to the data model:
146147
- Type is greyed when FC->ESC uses a CAN or SERIAL port (shared-port topology).

tests/gui_frontend_tkinter_component_editor.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,7 @@ def test_changing_fc_esc_protocol_to_brushed_resets_both_telemetry_type_and_prot
806806
editor.root.update()
807807

808808
telem_type_choices = editor.data_model.get_combobox_values_for_path(telem_type_path)
809-
assert "SERIAL3" in telem_type_choices, (
810-
f"SERIAL3 should be available for DShot150: {telem_type_choices}"
811-
)
809+
assert "SERIAL3" in telem_type_choices, f"SERIAL3 should be available for DShot150: {telem_type_choices}"
812810
telem_type_cb.set_entries_tuple([(k, k) for k in telem_type_choices], "SERIAL3")
813811
telem_type_cb.event_generate("<<ComboboxSelected>>")
814812
editor.root.update_idletasks()

0 commit comments

Comments
 (0)