Return current bed temperature for in-progress session.
559573
def current_bed_temp(self):
        """"""
        try:
            bedtemps = self.intervals[0]['timeseries']['tempBedC']
            num_temps = len(bedtemps)

            if num_temps == 0:
                return None

            bedtemp = bedtemps[num_temps-1][1]
        except KeyError:
            bedtemp = None
        return bedtemp
275410
def heating_remaining(self):
        """"""
        try:
            if self.side == 'left':
                timerem = self.device.device_data['leftHeatingDuration']
            elif self.side == 'right':
                timerem = self.device.device_data['rightHeatingDuration']
            return timerem
        except TypeError:
            return None
765836
def get_current_word(self, completion=False):
        """"""
        ret = self.get_current_word_and_position(completion)
        if ret is not None:
            return ret[0]
1345307
def _get_temperature(self, data):
        ''''''
        if data[1:2] == 0x7FFF:
            return None

        temperature = twos_complement((data[1] << 8) + data[2], 16) / 200
        return round(temperature, 2)
902178
def get_target_temp(self):
        
        if not self._connected:
            return
        temp_ovrd = self._protocol.status.get(DATA_ROOM_SETPOINT_OVRD)
        if temp_ovrd:
            return temp_ovrd
        return self._protocol.status.get(DATA_ROOM_SETPOINT)
390622
def get_target_temperature(self):
        
        value = self.box.homeautoswitch("gethkrtsoll", self.actor_id)
        self.target_temperature = self.__get_temp(value)
        return self.target_temperature
459953
def get_chron_var(temp_sheet, start_row):
    
    col_dict = OrderedDict()
    out_list = []
    column = 1

    while (temp_sheet.cell_value(start_row, 0) != '') and (start_row < temp_sheet.nrows):
        short_cell = temp_sheet.cell_value(start_row, 0)
        units_cell = temp_sheet.cell_value(start_row, 1)
        long_cell = temp_sheet.cell_value(start_row, 2)

        # Fill the dictionary for this column
        col_dict['number'] = column
        col_dict['variableName'] = short_cell
        col_dict['description'] = long_cell
        col_dict['units'] = units_cell
        out_list.append(col_dict.copy())
        start_row += 1
        column += 1

    return out_list
1008735
def get_hkr_state(self):
        """"""
        self.update()
        try:
            return {
                126.5: 'off',
                127.0: 'on',
                self.eco_temperature: 'eco',
                self.comfort_temperature: 'comfort'
            }[self.target_temperature]
        except KeyError:
            return 'manual'
892993
def get_current_temperature(self, refresh=False):
        """"""
        if refresh:
            self.refresh()
        try:
            return float(self.get_value('temperature'))
        except (TypeError, ValueError):
            return None
1016738
def set_temperature(self, temp):
        """"""
        temp = round(temp, 1)
        self.__manual_update_time = time.time()
        data = self._controller.command(self._id, 'set_temps',
                                        {"driver_temp": temp,
                                         "passenger_temp": temp},
                                        wake_if_asleep=True)
        if data['response']['result']:
            self.__driver_temp_setting = temp
            self.__passenger_temp_setting = temp
850895
def heating_stats(self):
        """"""
        local_5 = []
        local_10 = []

        for i in range(0, 10):
            level = self.past_heating_level(i)
            if level == 0:
                _LOGGER.debug('Cant calculate stats yet...')
                return
            if i < 5:
                local_5.append(level)
            local_10.append(level)

        _LOGGER.debug('%s Heating History: %s', self.side, local_10)

        try:
            # Average of 5min on the history dict.
            fiveminavg = statistics.mean(local_5)
            tenminavg = statistics.mean(local_10)
            _LOGGER.debug('%s Heating 5 min avg: %s', self.side, fiveminavg)
            _LOGGER.debug('%s Heating 10 min avg: %s', self.side, tenminavg)

            # Standard deviation
            fivestdev = statistics.stdev(local_5)
            tenstdev = statistics.stdev(local_10)
            _LOGGER.debug('%s Heating 5 min stdev: %s', self.side, fivestdev)
            _LOGGER.debug('%s Heating 10 min stdev: %s', self.side, tenstdev)

            # Variance
            fivevar = statistics.variance(local_5)
            tenvar = statistics.variance(local_10)
            _LOGGER.debug('%s Heating 5 min variance: %s', self.side, fivevar)
            _LOGGER.debug('%s Heating 10 min variance: %s', self.side, tenvar)
        except:
            _LOGGER.debug('Cant calculate stats yet...')
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
814021
def read_raw_temp(self):
        """"""
        self.i2c.write8(BMP085_CONTROL, BMP085_READTEMPCMD)
        time.sleep(0.005)  # Wait 5ms
        raw = self.i2c.read_U16BE(BMP085_TEMPDATA)
        self.logger.debug('Raw temp 0x{0:X} ({1})', raw & 0xFFFF, raw)
        return raw
514557
def get_zone_temperature(self, zone_name):
        
        zone = self.get_zone(zone_name)

        if zone is None:
            raise RuntimeError("Unknown zone")

        return zone['currentTemperature']
812570
def get_current_state_m(self):
        """"""
        page_id = self.view.notebook.get_current_page()
        if page_id == -1:
            return None
        page = self.view.notebook.get_nth_page(page_id)
        state_identifier = self.get_state_identifier_for_page(page)
        return self.tabs[state_identifier]['state_m']
214826
private synchronized float getInternal() {
    int phaseCount = phases.size();
    if (phaseCount != 0) {
      float subProgress =
        currentPhase < phaseCount ? phase().getInternal() : 0.0f;
      return progressPerPhase*(currentPhase + subProgress);
    } else {
      return progress;
    }
  }
178613
def system_status(self):
        """"""
        flag, timestamp, status = self._query(('GETDAT? 1', (Integer, Float, Integer)))
        return {
            # convert unix timestamp to datetime object
            'timestamp': datetime.datetime.fromtimestamp(timestamp),
            # bit 0-3 represent the temperature controller status
            'temperature': STATUS_TEMPERATURE[status & 0xf],
            # bit 4-7 represent the magnet status
            'magnet': STATUS_MAGNET[(status >> 4) & 0xf],
            # bit 8-11 represent the chamber status
            'chamber': STATUS_CHAMBER[(status >> 8) & 0xf],
            # bit 12-15 represent the sample position status
            'sample_position': STATUS_SAMPLE_POSITION[(status >> 12) & 0xf],
        }