diff --git a/hardware/button/ldr_button.py b/hardware/button/ldr_button.py index 910f8f475..1265b214c 100644 --- a/hardware/button/ldr_button.py +++ b/hardware/button/ldr_button.py @@ -42,7 +42,7 @@ def __run(self): self._device["internal_state"] = self.PRESSED if count <= (self.__CAPACITOR * 10000) else self.RELEASED sleep(0.1) - except KeyboardInterrupt as ex: + except KeyboardInterrupt: self.stop() # print(f"Fetch CTRL-c... and now what..? For now.. press again Ctrl-C .. ({ex})") diff --git a/hardware/webcam/hlslive_webcam.py b/hardware/webcam/hlslive_webcam.py index d7d0b82b1..a61d81d1f 100644 --- a/hardware/webcam/hlslive_webcam.py +++ b/hardware/webcam/hlslive_webcam.py @@ -3,9 +3,6 @@ logger = terrariumLogging.logging.getLogger(__name__) -from io import BytesIO -import subprocess - from . import terrariumWebcam from terrariumUtils import terrariumUtils diff --git a/terrariumArea.py b/terrariumArea.py index 5e8a82352..1ed83407d 100644 --- a/terrariumArea.py +++ b/terrariumArea.py @@ -3,7 +3,6 @@ logger = terrariumLogging.logging.getLogger(__name__) -from operator import itemgetter import copy import datetime import time diff --git a/terrariumAudio.py b/terrariumAudio.py index 05b34da85..c198adfcf 100644 --- a/terrariumAudio.py +++ b/terrariumAudio.py @@ -54,7 +54,7 @@ def volume(__cls__, hw, value=None): # Try to 'overload' the volume by 20%. Can work for some sound cards value = int(max(0, min(120, 120 * (value / 100)))) mixer.setvolume(value, alsaaudio.MIXER_CHANNEL_ALL) - except alsaaudio.ALSAAudioError as ex: + except alsaaudio.ALSAAudioError: try: # When the 'overloaded' value is to high, fall back to normal max volume value = int(max(0, min(100, value))) diff --git a/terrariumNotification.py b/terrariumNotification.py index 41c88610b..0ae30c27a 100644 --- a/terrariumNotification.py +++ b/terrariumNotification.py @@ -2329,7 +2329,7 @@ def load_setup(self, setup_data): self.connection = mqtt.Client( mqtt.CallbackAPIVersion.VERSION1, client_id=f"TerrariumPI {self.setup['version']}" ) - except Exception as ex: + except Exception: # Old version self.connection = mqtt.Client(client_id=f"TerrariumPI {self.setup['version']}") diff --git a/weather/__init__.py b/weather/__init__.py index 786acc5a4..05da7bf4d 100644 --- a/weather/__init__.py +++ b/weather/__init__.py @@ -56,7 +56,6 @@ def update(self): self._device["last_update"] is None or (datetime.now() - self._device["last_update"]).total_seconds() > self.__UPDATE_TIMEOUT ): - start = time.time() logger.debug(f"Loading online weather data from source: {self.address}") if self._load_data():