(self, value)
return None
Convert value string to float for reporting
Convert value string to float for reporting
Convert value string to float for reporting
def parse_value(self, value):
        """
        Convert value string to float for reporting
        """
        value = value.strip()

        # Skip missing sensors
        if value == 'na':
            return None

        # Try just getting the float value
        try:
            return float(value)
        except:
            pass

        # Next best guess is a hex value
        try:
            return float.fromhex(value)
        except:
            pass

        # No luck, bail
        return None
def parse_value ( self , value ) : value = value . strip ( ) # Skip missing sensors if value == 'na' : return None # Try just getting the float value try : return float ( value ) except : pass # Next best guess is a hex value try : return float . fromhex ( value ) except : pass # No luck, bail return None