UT330BUI/model/UT330.py
def read_offsets(self):

        """Reads the temperature, humidity, pressure offset"""
        self._buffer = [0xab, 0xcd, 0x03, 0x17, 0xF1, 0x01]

        self._write_buffer()

        # Now get the response data from the buffer. The returned buffer length
        # is known to be 18.
        self._read_buffer(18)

        # Decode the data

        offsets = {}

        self._index = 4
        offsets['temperature'] = self._get_temperature()

        if self._buffer[6] < 128:
            offsets['temperature offset'] = float(self._buffer[6]) / 10
        else:
            offsets['temperature offset'] = float(self._buffer[6] - 256) / 10

        offsets['humidity'] = float(256*self._buffer[8] + self._buffer[7]) / 10

        if self._buffer[9] < 128:
            offsets['humidity offset'] = float(self._buffer[9]) / 10
        else:
            offsets['humidity offset'] = float(self._buffer[9] - 256) / 10

        offsets['pressure'] = float(256*self._buffer[11] + self._buffer[10])/10

        if self._buffer[12] < 128:
            offsets['pressure offset'] = float(self._buffer[12]) / 10
        else:
            offsets['pressure offset'] = float(self._buffer[12] - 256) / 10

        # I don't know what bytes 13, 14, and 15 are

        return offsets
Reads the temperature, humidity, pressure offset
Reads the temperature, humidity, pressure offset
Reads the temperature humidity pressure offset
def read_offsets(self):
        self._buffer = [0xab, 0xcd, 0x03, 0x17, 0xF1, 0x01]
        self._write_buffer()
        self._read_buffer(18)
        offsets = {}
        self._index = 4
        offsets['temperature'] = self._get_temperature()
        if self._buffer[6] < 128:
            offsets['temperature offset'] = float(self._buffer[6]) / 10
        else:
            offsets['temperature offset'] = float(self._buffer[6] - 256) / 10
        offsets['humidity'] = float(256*self._buffer[8] + self._buffer[7]) / 10
        if self._buffer[9] < 128:
            offsets['humidity offset'] = float(self._buffer[9]) / 10
        else:
            offsets['humidity offset'] = float(self._buffer[9] - 256) / 10
        offsets['pressure'] = float(256*self._buffer[11] + self._buffer[10])/10
        if self._buffer[12] < 128:
            offsets['pressure offset'] = float(self._buffer[12]) / 10
        else:
            offsets['pressure offset'] = float(self._buffer[12] - 256) / 10
        return offsets
def read_offsets ( self ) : self . _buffer = [ 0xab , 0xcd , 0x03 , 0x17 , 0xF1 , 0x01 ] self . _write_buffer ( ) self . _read_buffer ( 18 ) offsets = { } self . _index = 4 offsets [ 'temperature' ] = self . _get_temperature ( ) if self . _buffer [ 6 ] < 128 : offsets [ 'temperature offset' ] = float ( self . _buffer [ 6 ] ) / 10 else : offsets [ 'temperature offset' ] = float ( self . _buffer [ 6 ] - 256 ) / 10 offsets [ 'humidity' ] = float ( 256 * self . _buffer [ 8 ] + self . _buffer [ 7 ] ) / 10 if self . _buffer [ 9 ] < 128 : offsets [ 'humidity offset' ] = float ( self . _buffer [ 9 ] ) / 10 else : offsets [ 'humidity offset' ] = float ( self . _buffer [ 9 ] - 256 ) / 10 offsets [ 'pressure' ] = float ( 256 * self . _buffer [ 11 ] + self . _buffer [ 10 ] ) / 10 if self . _buffer [ 12 ] < 128 : offsets [ 'pressure offset' ] = float ( self . _buffer [ 12 ] ) / 10 else : offsets [ 'pressure offset' ] = float ( self . _buffer [ 12 ] - 256 ) / 10 return offsets
Reads the temperature, humidity, pressure offset
Reads the temperature humidity pressure offset
"""Reads the temperature, humidity, pressure offset""" # Now get the response data from the buffer. The returned buffer length # is known to be 18. # Decode the data # I don't know what bytes 13, 14, and 15 are
self