diff --git a/snmp2mqtt.py b/snmp2mqtt.py index dec1247..2bc6fdd 100755 --- a/snmp2mqtt.py +++ b/snmp2mqtt.py @@ -294,6 +294,9 @@ async def get_snmp(req): data.update({oid["name"]: "OFF"}) else: data.update({oid["name"]: value}) + except ValueError as e: + logging.warning(f"{req['device_name']} OID {oid['oid']} ({oid['name']}) returned an invalid value: {e}") + continue except Exception as e: logging.error(f"{req['device_name']} Exception getting OID {oid['oid']}: {e}") continue