get temperature information

@return void
511353
private function _temperature()
    {
        for ($intPosi = 3; $intPosi < 6; $intPosi++) {
            if ($this->_buf_value[$intPosi] == 0) {
                continue;
            }
            preg_match("/([0-9\.])*/", str_replace(",", ".", $this->_buf_value[$intPosi]), $hits);
            $dev = new SensorDevice();
            $dev->setName($this->_buf_label[$intPosi]);
            $dev->setValue($hits[0]);
//            $dev->setMax(70);
            $this->mbinfo->setMbTemp($dev);
        }
    }
164826
private function _buildMbinfo()
    {
        $mbinfo = $this->_xml->addChild('MBInfo');
        $temp = $fan = $volt = $power = $current = $other = null;

        if (sizeof(unserialize(PSI_MBINFO))>0) {
            foreach (unserialize(PSI_MBINFO) as $mbinfoclass) {
                $mbinfo_data = new $mbinfoclass();
                $mbinfo_detail = $mbinfo_data->getMBInfo();

                if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='temperature') foreach ($mbinfo_detail->getMbTemp() as $dev) {
                    if ($temp == null) {
                        $temp = $mbinfo->addChild('Temperature');
                    }
                    $item = $temp->addChild('Item');
                    $item->addAttribute('Label', $dev->getName());
                    $item->addAttribute('Value', $dev->getValue());
                    if ($dev->getMax() !== null) {
                        $item->addAttribute('Max', $dev->getMax());
                    }
                    if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") {
                        $item->addAttribute('Event', $dev->getEvent());
                    }
                }

                if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='fans') foreach ($mbinfo_detail->getMbFan() as $dev) {
                    if ($fan == null) {
                        $fan = $mbinfo->addChild('Fans');
                    }
                    $item = $fan->addChild('Item');
                    $item->addAttribute('Label', $dev->getName());
                    $item->addAttribute('Value', $dev->getValue());
                    if ($dev->getMin() !== null) {
                        $item->addAttribute('Min', $dev->getMin());
                    }
                    if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") {
                        $item->addAttribute('Event', $dev->getEvent());
                    }
                }

                if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='voltage') foreach ($mbinfo_detail->getMbVolt() as $dev) {
                    if ($volt == null) {
                        $volt = $mbinfo->addChild('Voltage');
                    }
                    $item = $volt->addChild('Item');
                    $item->addAttribute('Label', $dev->getName());
                    $item->addAttribute('Value', $dev->getValue());
                    if ($dev->getMin() !== null) {
                        $item->addAttribute('Min', $dev->getMin());
                    }
                    if ($dev->getMax() !== null) {
                        $item->addAttribute('Max', $dev->getMax());
                    }
                    if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") {
                        $item->addAttribute('Event', $dev->getEvent());
                    }
                }

                if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='power') foreach ($mbinfo_detail->getMbPower() as $dev) {
                    if ($power == null) {
                        $power = $mbinfo->addChild('Power');
                    }
                    $item = $power->addChild('Item');
                    $item->addAttribute('Label', $dev->getName());
                    $item->addAttribute('Value', $dev->getValue());
                    if ($dev->getMax() !== null) {
                        $item->addAttribute('Max', $dev->getMax());
                    }
                    if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") {
                        $item->addAttribute('Event', $dev->getEvent());
                    }
                }

                if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='current') foreach ($mbinfo_detail->getMbCurrent() as $dev) {
                    if ($current == null) {
                        $current = $mbinfo->addChild('Current');
                    }
                    $item = $current->addChild('Item');
                    $item->addAttribute('Label', $dev->getName());
                    $item->addAttribute('Value', $dev->getValue());
                    if ($dev->getMin() !== null) {
                        $item->addAttribute('Min', $dev->getMin());
                    }
                    if ($dev->getMax() !== null) {
                        $item->addAttribute('Max', $dev->getMax());
                    }
                    if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") {
                        $item->addAttribute('Event', $dev->getEvent());
                    }
                }

                if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='other') foreach ($mbinfo_detail->getMbOther() as $dev) {
                    if ($other == null) {
                        $other = $mbinfo->addChild('Other');
                    }
                    $item = $other->addChild('Item');
                    $item->addAttribute('Label', $dev->getName());
                    $item->addAttribute('Value', $dev->getValue());
                    if (defined('PSI_SENSOR_EVENTS') && PSI_SENSOR_EVENTS && $dev->getEvent() !== "") {
                        $item->addAttribute('Event', $dev->getEvent());
                    }
                }
            }
        }
    }
7802
def temperatures(self):
        """"""
        self.location.status()

        if self.hotwater:
            yield {
                'thermostat': 'DOMESTIC_HOT_WATER',
                'id': self.hotwater.dhwId,
                'name': '',
                'temp': self.hotwater.temperatureStatus['temperature'],          # pylint: disable=no-member
                'setpoint': ''
            }

        for zone in self._zones:
            zone_info = {
                'thermostat': 'EMEA_ZONE',
                'id': zone.zoneId,
                'name': zone.name,
                'temp': None,
                'setpoint': zone.setpointStatus['targetHeatTemperature']
            }

            if zone.temperatureStatus['isAvailable']:
                zone_info['temp'] = zone.temperatureStatus['temperature']
            yield zone_info
730149
public function getTemps()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Temperature');
        }

        // Hold them here
        $return = [];

        // hddtemp?
        if (array_key_exists('hddtemp', (array) $this->settings['temps']) && !empty($this->settings['temps']['hddtemp']) && isset($this->settings['hddtemp'])) {
            try {
                // Initiate class
                $hddtemp = new Hddtemp($this->settings);

                // Set mode, as in either daemon or syslog
                $hddtemp->setMode($this->settings['hddtemp']['mode']);

                // If we're daemon, save host and port
                if ($this->settings['hddtemp']['mode'] == 'daemon') {
                    $hddtemp->setAddress(
                        $this->settings['hddtemp']['address']['host'],
                        $this->settings['hddtemp']['address']['port']);
                }

                // Result after working it
                $hddtemp_res = $hddtemp->work();

                // If it's an array, it worked
                if (is_array($hddtemp_res)) {
                    // Save result
                    $return = array_merge($return, $hddtemp_res);
                }
            }

            // There was an issue
            catch (\Exception $e) {
                Errors::add('hddtemp parser', $e->getMessage());
            }
        }

        // mbmon?
        if (array_key_exists('mbmon', (array) $this->settings['temps']) && !empty($this->settings['temps']['mbmon']) && isset($this->settings['mbmon'])) {
            try {
                // Initiate class
                $mbmon = new Mbmon();

                // Set host and port
                $mbmon->setAddress(
                    $this->settings['mbmon']['address']['host'],
                    $this->settings['mbmon']['address']['port']);

                // Get result after working it
                $mbmon_res = $mbmon->work();

                // If it's an array, it worked
                if (is_array($mbmon_res)) {
                    // Save result
                    $return = array_merge($return, $mbmon_res);
                }
            } catch (Exception $e) {
                Errors::add('mbmon parser', $e->getMessage());
            }
        }

        // sensord? (part of lm-sensors)
        if (array_key_exists('sensord', (array) $this->settings['temps']) && !empty($this->settings['temps']['sensord'])) {
            try {
                // Iniatate class
                $sensord = new Sensord();

                // Work it
                $sensord_res = $sensord->work();

                // If it's an array, it worked
                if (is_array($sensord_res)) {
                    // Save result
                    $return = array_merge($return, $sensord_res);
                }
            } catch (Exception $e) {
                Errors::add('sensord parser', $e->getMessage());
            }
        }

        // hwmon? (probably the fastest of what's here)
        // too simple to be in its own class
        if (array_key_exists('hwmon', (array) $this->settings['temps']) && !empty($this->settings['temps']['hwmon'])) {

            // Store them here
            $hwmon_vals = [];

            // Wacky location
            foreach ((array) @glob('/sys/class/hwmon/hwmon*/{,device/}*_input', GLOB_NOSORT | GLOB_BRACE) as $path) {
                $initpath = rtrim($path, 'input');
                $value = Common::getContents($path);
                $base = basename($path);
                $labelpath = $initpath.'label';
                $showemptyfans = isset($this->settings['temps_show0rpmfans']) ? $this->settings['temps_show0rpmfans'] : false;
                $drivername = @basename(@readlink(dirname($path).'/driver')) ?: false;

                // Temperatures
                if (is_file($labelpath) && strpos($base, 'temp') === 0) {
                    $label = Common::getContents($labelpath);
                    $value /= $value > 10000 ? 1000 : 1;
                    $unit = 'C'; // I don't think this is ever going to be in F
                }

                // Fan RPMs
                elseif (preg_match('/^fan(\d+)_/', $base, $m)) {
                    $label = 'fan'.$m[1];
                    $unit = 'RPM';

                    if ($value == 0 && !$showemptyfans) {
                        continue;
                    }
                }

                // Volts
                elseif (preg_match('/^in(\d+)_/', $base, $m)) {
                    $unit = 'V';
                    $value /= 1000;
                    $label = Common::getContents($labelpath) ?: 'in'.$m[1];
                } else {
                    continue;
                }

                // Append values
                $hwmon_vals[] = array(
                    'path' => '',
                    'name' => $label.($drivername ? ' <span class="faded">('.$drivername.')</span>' : ''),
                    'temp' => $value,
                    'unit' => $unit,
                );
            }

            // Save any if we have any
            if (count($hwmon_vals) > 0) {
                $return = array_merge($return, $hwmon_vals);
            }
        }

        // thermal_zone?
        if (array_key_exists('thermal_zone', (array) $this->settings['temps']) && !empty($this->settings['temps']['thermal_zone'])) {

            // Store them here
            $thermal_zone_vals = [];

            // Wacky location
            foreach ((array) @glob('/sys/class/thermal/thermal_zone*', GLOB_NOSORT | GLOB_BRACE) as $path) {
                $labelpath = $path.'/type';
                $valuepath = $path.'/temp';

                if (!is_file($labelpath) || !is_file($valuepath)) {
                    continue;
                }

                // Temperatures
                $label = Common::getContents($labelpath);
                $value = Common::getIntFromFile($valuepath);
                $value /= $value > 10000 ? 1000 : 1;

                // Append values
                $thermal_zone_vals[] = array(
                    'path' => '',
                    'name' => $label . ' ('.basename($path).')',
                    'temp' => $value,
                    'unit' => 'C', // I don't think this is ever going to be in F
                );
            }

            // Save any if we have any
            if (count($thermal_zone_vals) > 0) {
                $return = array_merge($return, $thermal_zone_vals);
            }
        }

        // Laptop backlight percentage
        foreach ((array) @glob('/sys/{devices/virtual,class}/backlight/*/max_brightness', GLOB_NOSORT | GLOB_BRACE) as $bl) {
            $dir = dirname($bl);
            if (!is_file($dir.'/actual_brightness')) {
                continue;
            }
            $max = Common::getIntFromFile($bl);
            $cur = Common::getIntFromFile($dir.'/actual_brightness');
            if ($max < 0 || $cur < 0) {
                continue;
            }
            $return[] = array(
                'name' => 'Backlight brightness',
                'temp' => round($cur / $max, 2) * 100,
                'unit' => '%',
                'path' => 'N/A',
                'bar' => true,
            );
        }

        // Done
        return $return;
    }
1373503
def _get_temperature(self, decoded):
        ''''''
        temp = (decoded[2] & 127) + decoded[3] / 100
        sign = (decoded[2] >> 7) & 1
        if sign == 0:
            return round(temp, 2)
        return round(-1 * temp, 2)
445263
public function executeUpdate(): bool {
        $temp = false;
        
        if ($this->build()) {
            $this->conect->query($this->generate);
            $this->generate = "";
            $temp = true;
        }
        return $temp;           
    }
587942
def temperature(self, temperature):
        
        try:
            cmd = self.command_set.temperature(temperature)
            self.send(cmd)
            self._temperature = temperature
        except AttributeError:
            self._setter('_temperature', temperature,
                         self._warmest, self._coolest,
                         self._to_temperature)
644094
public function getUpdatedAt()
    {
        if (!$this->updatedAt) {
            return null;
        } else {
            return $this->updatedAt
                ->setTimezone(new DateTimeZone(app('config')->timezone));
        }
    }
1203036
protected function readFromTempFile()
    {
        // Upload temp file
        $sUploadTempFile = $this->getUploadTempFile();
        $aFiles = json_decode(file_get_contents($sUploadTempFile), true);
        foreach($aFiles as $sVarName => $aUserFiles)
        {
            $this->aUserFiles[$sVarName] = [];
            foreach($aUserFiles as $aUserFile)
            {
                $this->aUserFiles[$sVarName][] = UploadedFile::fromTempData($aUserFile);
            }
        }
        unlink($sUploadTempFile);
    }
819522
def update(self):
        """"""
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            # Update stats using the dedicated lib
            stats = []
            # Get the temperature
            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:
                # Append temperature
                stats.extend(temperature)
            # Get the FAN speed
            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:
                # Append FAN speed
                stats.extend(fan_speed)
            # Update HDDtemp stats
            try:
                hddtemp = self.__set_type(self.hddtemp_plugin.update(),
                                          'temperature_hdd')
            except Exception as e:
                logger.error("Cannot grab HDD temperature (%s)" % e)
            else:
                # Append HDD temperature
                stats.extend(hddtemp)
            # Update batteries stats
            try:
                batpercent = self.__set_type(self.batpercent_plugin.update(),
                                             'battery')
            except Exception as e:
                logger.error("Cannot grab battery percent (%s)" % e)
            else:
                # Append Batteries %
                stats.extend(batpercent)

        elif self.input_method == 'snmp':
            # Update stats using SNMP
            # No standard:
            # http://www.net-snmp.org/wiki/index.php/Net-SNMP_and_lm-sensors_on_Ubuntu_10.04

            pass

        # Set the alias for each stat
        for stat in stats:
            alias = self.has_alias(stat["label"].lower())
            if alias:
                stat["label"] = alias

        # Update the stats
        self.stats = stats

        return self.stats
735544
def temperature(self):
        
        ut = self.get_raw_temp()
        x1 = ((ut - self.cal['AC6']) * self.cal['AC5']) >> 15
        x2 = (self.cal['MC'] << 11) // (x1 + self.cal['MD'])
        b5 = x1 + x2
        return ((b5 + 8) >> 4) / 10
985328
private function _temperature()
    {
        foreach ($this->_lines as $line) {
            if (preg_match('/^hw\.sensors\.[0-9]+=[^\s,]+,\s+([^,]+),\s+temp,\s+([0-9\.]+)\s+degC.*$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbTemp($dev);
            } elseif (preg_match('/^hw\.sensors\.[0-9]+=[^\s,]+,\s+([^,]+),\s+([0-9\.]+)\s+degC$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbTemp($dev);
            } elseif (preg_match('/^hw\.sensors\.[^\.]+\.(.*)=([0-9\.]+)\s+degC\s+\((.*)\)$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[3]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbTemp($dev);
            } elseif (preg_match('/^hw\.sensors\.[^\.]+\.(.*)=([0-9\.]+)\s+degC$/', $line, $ar_buf)) {
                $dev = new SensorDevice();
                $dev->setName($ar_buf[1]);
                $dev->setValue($ar_buf[2]);
                $this->mbinfo->setMbTemp($dev);
            }
        }
    }
610219
public function getInfo() {
		$info = $this->createInfoset();
		
		$elapsed = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
		
		$info->setIcon('clock')
		     ->setName('Execution time')
		     ->setTitle($this->formatTime($elapsed));
		
		return $info;
	}
278555
public function getData()
    {
        if (!$this->enabled()) {
            return null;
        }

        $this->addDeprecations();
        $this->timers = [];

        return $this->debugbar->getData();
    }
939963
private function _temperature()
    {
        if (count($this->_values) == 14) {
            $dev1 = new SensorDevice();
            $dev1->setName('temp1');
            $dev1->setValue($this->_values[1]);
//            $dev1->setMax(70);
            $this->mbinfo->setMbTemp($dev1);
            $dev2 = new SensorDevice();
            $dev2->setName('temp1');
            $dev2->setValue($this->_values[2]);
//            $dev2->setMax(70);
            $this->mbinfo->setMbTemp($dev2);
            $dev3 = new SensorDevice();
            $dev3->setName('temp1');
            $dev3->setValue($this->_values[3]);
//            $dev3->setMax(70);
            $this->mbinfo->setMbTemp($dev3);
        }
    }
1300327
public function getData()
    {
        if ($this->tempFileName == '') {
            return $this->outputMemory(true);
        } else {
            $this->flush();
            return file_get_contents($this->tempFileName);
        }
    }
444820
private function getAllInfo()
    {
        $data = [];
        $episode_area = $this->_parser->find('table.episode_list', 0);
        if ($episode_area) {
            foreach ($episode_area->find('.episode-list-data') as $each_episode) {
                $temp = [];

                $temp['episode'] = $this->getEpisodeNo($each_episode);
                $temp['link'] = $this->getEpisodeLink($each_episode);
                $temp['title'] = $this->getEpisodeTitle($each_episode);
                $temp['japanese_title'] = $this->getEpisodeTitle($each_episode, true);
                $temp['aired'] = $this->getEpisodeAired($each_episode);

                $data[] = $temp;
            }
        }

        return $data;
    }