diff --git a/moonraker/components/mqtt.py b/moonraker/components/mqtt.py index b5d36e2..a18a26b 100644 --- a/moonraker/components/mqtt.py +++ b/moonraker/components/mqtt.py @@ -482,7 +482,7 @@ class MQTTClient(APITransport, Subscribable): except asyncio.CancelledError: raise except Exception as e: - if type(last_err) != type(e) or last_err.args != e.args: + if type(last_err) is not type(e) or last_err.args != e.args: logging.exception("MQTT Connection Error") last_err = e continue diff --git a/moonraker/components/power.py b/moonraker/components/power.py index 60f5f9f..60e5464 100644 --- a/moonraker/components/power.py +++ b/moonraker/components/power.py @@ -447,7 +447,7 @@ class HTTPDevice(PowerDevice): except asyncio.CancelledError: raise except Exception as e: - if type(last_err) != type(e) or last_err.args != e.args: + if type(last_err) is not type(e) or last_err.args != e.args: logging.exception(f"Device Init Error: {self.name}") last_err = e await asyncio.sleep(5.) @@ -887,7 +887,7 @@ class TPLinkSmartPlug(PowerDevice): except asyncio.CancelledError: raise except Exception as e: - if type(last_err) != type(e) or last_err.args != e.args: + if type(last_err) is not type(e) or last_err.args != e.args: logging.exception(f"Device Init Error: {self.name}") last_err = e await asyncio.sleep(5.)