diff options
| author | Sophie Schiller <sophie.schiller01@gmail.com> | 2023-05-01 15:28:42 +0200 |
|---|---|---|
| committer | Sophie Schiller <sophie.schiller01@gmail.com> | 2023-05-01 15:28:42 +0200 |
| commit | 968194e89f4efb3c0bb96267b498f05ec5d0ee2c (patch) | |
| tree | 5f0e51dc1847414219ef12a2fb0bed34ac28afdd | |
| parent | dc775c9113ad65b5e5773dfd5ebe8a61d29c1711 (diff) | |
error handling
| -rw-r--r-- | switcher.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/switcher.py b/switcher.py index 595962a..e4387a2 100644 --- a/switcher.py +++ b/switcher.py @@ -71,11 +71,15 @@ class PyATEMSwitcher: self.atem.setVideoModeFormat(video_mode) if conf.get("inputs", None): - for key, name in conf["inputs"].items(): - input_number = getattr(self.atem.atem.videoSources, key) - self.log.debug(f"setting input {input_number} to name '{name}'") - self.atem.setInputLongName(input_number, name) - self.atem.setInputShortName(input_number, name[0:3]) + try: + for key, name in conf["inputs"].items(): + input_number = getattr(self.atem.atem.videoSources, key) + self.log.debug(f"setting input {input_number} to name '{name}'") + self.atem.setInputLongName(input_number, name) + self.atem.setInputShortName(input_number, name[0:4].upper()) + except Exception as e: + self.log.error("An error occurred while trying to adjust input names") + self.log.exception(e) def _validate_config(self): if "ip" not in self.config: |
