'Update sensors stats using the input method.'

@GlancesPlugin._check_decorator
@GlancesPlugin._log_result_decorator
def update(self):

    self.reset()
    if (self.input_method == 'local'):
        self.stats = []
        try:
            temperature = self.__set_type(self.glancesgrabsensors.get('temperature_core'), 'temperature_core')
        except Exception as e:
            logger.error(('Cannot    grab    sensors    temperatures    (%s)' % e))
        else:
            self.stats.extend(temperature)
        try:
            fan_speed = self.__set_type(self.glancesgrabsensors.get('fan_speed'), 'fan_speed')
        except Exception as e:
            logger.error(('Cannot    grab    FAN    speed    (%s)' % e))
        else:
            self.stats.extend(fan_speed)
        try:
            hddtemp = self.__set_type(self.hddtemp_plugin.update(), 'temperature_hdd')
        except Exception as e:
            logger.error(('Cannot    grab    HDD    temperature    (%s)' % e))
        else:
            self.stats.extend(hddtemp)
        try:
            batpercent = self.__set_type(self.batpercent_plugin.update(), 'battery')
        except Exception as e:
            logger.error(('Cannot    grab    battery    percent    (%s)' % e))
        else:
            self.stats.extend(batpercent)
    elif (self.input_method == 'snmp'):
        pass
    return self.stats
