feat: allow Sticky LS state to persist across EM or optionally across reboot (#4978)

This commit is contained in:
philmoz
2024-06-02 16:22:36 +10:00
committed by GitHub
parent 0399858a76
commit b16524837a
26 changed files with 121 additions and 46 deletions
@@ -29,6 +29,7 @@ enum LogicalSwitchFields {
LS_FIELD_ANDSW,
LS_FIELD_DURATION,
LS_FIELD_DELAY,
LS_FIELD_PERSIST,
LS_FIELD_COUNT,
LS_FIELD_LAST = LS_FIELD_COUNT-1
};
@@ -219,6 +220,14 @@ void menuModelLogicalSwitchOne(event_t event)
CHECK_INCDEC_MODELVAR_ZERO(event, cs->delay, MAX_LS_DELAY);
}
break;
case LS_FIELD_PERSIST:
if (cstate == LS_FAMILY_STICKY) {
lcdDrawTextAlignedLeft(y, STR_PERSISTENT);
drawCheckBox(CSWONE_2ND_COLUMN, y, cs->lsPersist, attr);
if (attr) cs->lsPersist = checkIncDecModel(event, cs->lsPersist, 0, 1);
}
break;
}
}
}