def METHOD_NAME(self):
    if self.use_sensors:
        log.debug("Retrieve temperature from sensors -u")
        return self._get_temp_from_sensors()
    try:
        path = None
        # use path provided by the user
        if self.parameter("path") is not None:
            path = self.parameter("path")
        # find the thermal zone that provides cpu temperature
        else:
            for zone in os.listdir("/sys/class/thermal"):
                if not zone.startswith("thermal_zone"):
                    continue
                if open(f"/sys/class/thermal/{zone}/type").read().strip() != "x86_pkg_temp":
                    continue
                path = f"/sys/class/thermal/{zone}/temp"
        # use zone 0 as fallback
        if path is None:
            log.info("Can not determine temperature path, using thermal_zone0")
            path = "/sys/class/thermal/thermal_zone0/temp"
        log.debug(f"retrieving temperature from {path}")
        # the values are t°C * 1000, so divide by 1000
        return str(int(open(path).read()) / 1000)
    except IOError:
        log.info("Can not determine temperature, please install lm-sensors")
        return "unknown"