Rename the driver module and update imports so tests and main entry use the new presets naming, while moving Preset to its own file. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
589 B
Python
25 lines
589 B
Python
class Preset:
|
|
def __init__(self, data):
|
|
# Set default values for all preset attributes
|
|
self.p = "off"
|
|
self.d = 100
|
|
self.b = 127
|
|
self.c = [(255, 255, 255)]
|
|
self.a = True
|
|
self.n1 = 0
|
|
self.n2 = 0
|
|
self.n3 = 0
|
|
self.n4 = 0
|
|
self.n5 = 0
|
|
self.n6 = 0
|
|
|
|
# Override defaults with provided data
|
|
self.edit(data)
|
|
|
|
def edit(self, data=None):
|
|
if not data:
|
|
return False
|
|
for key, value in data.items():
|
|
setattr(self, key, value)
|
|
return True
|