Skip to content

Commit

Permalink
GoXLR minis throw errors when trying to get from None
Browse files Browse the repository at this point in the history
  • Loading branch information
samcarsonx committed Jul 18, 2023
1 parent df145a6 commit 22e792c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion goxlr/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.5"
__version__ = "1.4.6"
29 changes: 16 additions & 13 deletions goxlr/types/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ class Scribble:
inverted: bool

def __init__(self, scribble: dict):
self.file_name = scribble.get("file_name")
self.bottom_text = scribble.get("bottom_text")
self.left_text = scribble.get("left_text")
self.inverted = scribble.get("inverted")
if scribble: # GoXLR Minis don't have scribbles
self.file_name = scribble.get("file_name")
self.bottom_text = scribble.get("bottom_text")
self.left_text = scribble.get("left_text")
self.inverted = scribble.get("inverted")


@dataclass
Expand Down Expand Up @@ -564,10 +565,11 @@ class Effects:
current: CurrentEffects

def __init__(self, effects: dict):
self.is_enabled = effects.get("is_enabled")
self.active_preset = EffectBankPreset[effects.get("active_preset")]
self.preset_names = effects.get("preset_names")
self.current = CurrentEffects(effects.get("current"))
if effects: # GoXLR Minis don't have effects
self.is_enabled = effects.get("is_enabled")
self.active_preset = EffectBankPreset[effects.get("active_preset")]
self.preset_names = effects.get("preset_names")
self.current = CurrentEffects(effects.get("current"))


# -------------------------------------------------------
Expand Down Expand Up @@ -622,11 +624,12 @@ class Sampler:
banks: Dict[SampleBank, Dict[SampleButton, SampleMetadata]]

def __init__(self, sampler: dict):
self.processing_state = SamplerProcessState(sampler.get("processing_state"))
self.active_bank = SampleBank[sampler.get("active_bank")]
self.clear_active = sampler.get("clear_active")
self.record_buffer = sampler.get("record_buffer")
self.banks = sampler.get("banks")
if sampler: # GoXLR Minis don't have a sampler
self.processing_state = SamplerProcessState(sampler.get("processing_state"))
self.active_bank = SampleBank[sampler.get("active_bank")]
self.clear_active = sampler.get("clear_active")
self.record_buffer = sampler.get("record_buffer")
self.banks = sampler.get("banks")


# -------------------------------------------------------
Expand Down

0 comments on commit 22e792c

Please sign in to comment.