fix for elentra cruise button

This commit is contained in:
ajouatom 2025-02-05 13:49:23 +09:00
parent bc55f1e2e3
commit a127fe1a42

View File

@ -225,16 +225,13 @@ class CarState(CarStateBase):
#self.cruise_buttons.extend(cp.vl_all["CLU11"]["CF_Clu_CruiseSwState"])
#carrot {{
cruise_button = [Buttons.NONE]
if self.CP.extFlags & HyundaiExtFlags.CRUISE_BUTTON_ALT.value:
if self.CP.extFlags & HyundaiExtFlags.CRUISE_BUTTON_ALT.value and cp.vl_all["CRUISE_BUTTON_ALT"]["SET_ME_1"] == 1:
lfa_button = cp.vl.get("CRUISE_BUTTON_LFA", {}).get("CruiseSwLfa", 0)
cruise_button = [Buttons.LFA_BUTTON] if lfa_button > 0 else cp.vl_all["CRUISE_BUTTON_ALT"]["CruiseSwState"]
elif self.CP.extFlags & HyundaiExtFlags.HAS_LFA_BUTTON.value:
if cp.vl.get("BCM_PO_11", {}).get("LFA_Pressed", 0):
elif self.CP.extFlags & HyundaiExtFlags.HAS_LFA_BUTTON.value and cp.vl.get("BCM_PO_11", {}).get("LFA_Pressed", 0):
cruise_button = [Buttons.LFA_BUTTON]
else:
cruise_button = cp.vl_all["CLU11"]["CF_Clu_CruiseSwState"]
else:
cruise_button = cp.vl_all["CLU11"]["CF_Clu_CruiseSwState"]
self.cruise_buttons.extend(cruise_button)
# }} carrot
prev_main_buttons = self.main_buttons[-1]