Skip to content

Commit c9cd544

Browse files
lint
1 parent 3d5ab7a commit c9cd544

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

opendbc/car/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,36 @@ def apply_hysteresis(val: float, val_steady: float, hyst_gap: float) -> float:
2626
val_steady = val + hyst_gap
2727
return val_steady
2828

29+
2930
class ButtonMap(NamedTuple):
3031
event: structs.CarState.ButtonEvent.Type
3132
val: int = 1
3233

34+
3335
class ButtonEvent(NamedTuple):
3436
current_btn: int
3537
button_maps: list[ButtonMap]
3638
unpressed_btn: int = 0
3739

40+
3841
_prev_btns: dict[int, int] = {}
3942

43+
4044
def create_button_events(ret, button_list):
4145
ev = []
4246
for cur, maps, up in button_list:
43-
k = id(maps); prev = _prev_btns.setdefault(k, cur)
44-
if cur == prev: continue
47+
k = id(maps)
48+
prev = _prev_btns.setdefault(k, cur)
49+
if cur == prev:
50+
continue
4551
for pressed, b in ((False, prev), (True, cur)):
4652
if b != up:
4753
etype = next((m.event for m in maps if m.val == b), ButtonType.unknown)
4854
ev.append(structs.CarState.ButtonEvent(pressed=pressed, type=etype))
4955
_prev_btns[k] = cur
5056
ret.buttonEvents = ev
5157

58+
5259
def gen_empty_fingerprint():
5360
return {i: {} for i in range(8)}
5461

opendbc/car/honda/carstate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ def update(self, can_parsers) -> structs.CarState:
204204
ButtonEvent(cp.vl["SCM_BUTTONS"]["CRUISE_SETTING"], SETTINGS_BUTTON_MAPS)
205205
])
206206

207-
208207
return ret
209208

210209
def get_can_parsers(self, CP):

0 commit comments

Comments
 (0)