add ha couter for 'Internal SW Exceptions'

This commit is contained in:
Stefan Allius
2023-12-24 11:49:26 +01:00
parent ba4a1f058f
commit cef28b06cd
5 changed files with 13 additions and 8 deletions

View File

@@ -156,6 +156,7 @@ class Inverter(AsyncStream):
except ConnectionRefusedError as error:
logging.info(f'{error}')
except Exception:
self.inc_counter('SW_Exception')
logging.error(
f"Inverter: Exception for {addr}:\n"
f"{traceback.format_exc()}")
@@ -181,6 +182,7 @@ class Inverter(AsyncStream):
except MqttCodeError as error:
logging.error(f'Mqtt except: {error}')
except Exception:
self.inc_counter('SW_Exception')
logging.error(
f"Inverter: Exception:\n"
f"{traceback.format_exc()}")