feat: More flexible ADC inputs (#3870)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com> Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
This commit is contained in:
co-authored by
3djc
Peter Feerick
philmoz
parent
f5593c44e8
commit
b48e07026d
@@ -43,6 +43,22 @@ KEYS_LUT = [
|
||||
"KEY_BIND",
|
||||
]
|
||||
|
||||
# def eprint(*args, **kwargs):
|
||||
# from sys import stderr
|
||||
# print(*args, file=stderr, **kwargs)
|
||||
|
||||
def is_ext_input(input):
|
||||
|
||||
if input.get('type') != 'FLEX':
|
||||
return False
|
||||
|
||||
name = input.get('name')
|
||||
if name and name.startswith('EXT'):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def generate_from_template(json_filename, template_filename, target):
|
||||
|
||||
with open(json_filename) as json_file:
|
||||
@@ -70,6 +86,8 @@ def generate_from_template(json_filename, template_filename, target):
|
||||
trim_blocks=True
|
||||
)
|
||||
|
||||
env.tests['ext_input'] = is_ext_input
|
||||
|
||||
template_str = template_file.read()
|
||||
template = env.from_string(template_str)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user