From b99a9a810b1f09e4ee6e32ffe5a40bfa80ba53ed Mon Sep 17 00:00:00 2001 From: thijs snijder <snijder@astron.nl> Date: Thu, 31 Mar 2022 14:08:20 +0200 Subject: [PATCH] added test for namedValue --- tangostationcontrol/tangostationcontrol/clients/snmp_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tangostationcontrol/tangostationcontrol/clients/snmp_client.py b/tangostationcontrol/tangostationcontrol/clients/snmp_client.py index 5852ed582..551f46626 100644 --- a/tangostationcontrol/tangostationcontrol/clients/snmp_client.py +++ b/tangostationcontrol/tangostationcontrol/clients/snmp_client.py @@ -13,6 +13,7 @@ __all__ = ["SNMP_client"] snmp_to_numpy_dict = { hlapi.Integer32: numpy.int64, + hlapi.Integer: numpy.int64, hlapi.TimeTicks: numpy.int64, hlapi.OctetString: str, hlapi.ObjectIdentity: str, @@ -218,7 +219,7 @@ class snmp_attribute: # IpAddress values get printed as their raw value but in hex (7F 20 20 01 for 127.0.0.1 for example) vals.append(varBind[1].prettyPrint()) - elif snmp_type is hlapi.Integer32 and self.dtype == str: + elif snmp_type is hlapi.Integer32 or snmp_type is hlapi.Integer and self.dtype == str: # Integers can have 'named values', Where a value can be translated to a specific name. A dict basically # Example: {1: "other", 2: "invalid", 3: "dynamic", 4: "static",} -- GitLab