Chip class copy constructor: deep-copy the config dict.
@@ -39,7 +39,10 @@ class Chip:
self.cfg = {}
for key in default_cfg.keys():
self.cfg[key] = {}
- self.cfg[key]['values'] = default_cfg[key]['values']
+ if type(self.cfg[key]['values']) in [dict, list]:
+ self.cfg[key]['values'] = default_cfg[key]['values'].copy()
+ else:
+ self.cfg[key]['values'] = default_cfg[key]['switch']
self.cfg[key]['help'] = default_cfg[key]['help']
self.cfg[key]['switch'] = default_cfg[key]['switch']
