Skip to content

Commit

Permalink
Merge pull request #593 from LedFx/harden_invalid_config_handling
Browse files Browse the repository at this point in the history
Catch invalid schemas in Effect class
  • Loading branch information
shauneccles committed Jan 7, 2024
2 parents 941dffe + 0898abd commit 5c200a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ledfx/effects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,13 @@ def deactivate(self):

def update_config(self, config):
self.lock.acquire()
validated_config = type(self).schema()(config)
try:
validated_config = type(self).schema()(config)
except vol.Invalid as err:
_LOGGER.warning(f"Error updating effect {self.NAME} config: {err}")
self.lock.release()
return

prior_config = self._config

if self._config != {}:
Expand Down

0 comments on commit 5c200a2

Please sign in to comment.