Temp changes

Nicholas Hope 2022-08-20 17:21:22 -04:00
parent c2a2e010f1
commit a806215054
1 changed files with 7 additions and 4 deletions

View File

@ -183,6 +183,9 @@ def removeRelaventFields(key, data, bindType):
errMsgs.append('impulse requires `command` argument')
if not isinstance(content, str) and not isinstance(content, list):
errMsgs.append(f'impulse must be a single string or list')
elif bindType == "toggle":
if isinstance(content, dict):
@ -227,10 +230,10 @@ def removeRelaventFields(key, data, bindType):
if not validKey(condition):
errMsgs.append(f'Invalid condition to toggle "{condition}"')
if "cancel both" in content:
cancelBoth = content["cancel both"]
if not isinstance(cancelBoth, bool):
errMsgs.append(f'"cancel both" field in "{key}" makes no sense: "{cancelBoth}"')
if "cancel" in content:
canType = content["cancel"]
if canType not in ["released", "both"]:
errMsgs.append(f'"cancel" must be either "released" or "both", not {canType}')
elif bindType == "repeat":
unit = "s"