adds check bounds.

bump pre-release a3
This commit is contained in:
2023-09-15 23:01:26 +01:00
parent 65a148aa7b
commit 719328c6de
3 changed files with 17 additions and 7 deletions

View File

@@ -128,3 +128,12 @@ def get_bus_modes(vm) -> list:
"lfeonly",
"rearonly",
]
def check_bounds(val, bounds):
lower, upper = bounds
if val > upper:
val = upper
elif val < lower:
val = lower
return val