'Get the latest data from the DHT and updates the states.'

def update(self):

    self.dht_client.update()
    temperature_offset = self.temperature_offset
    humidity_offset = self.humidity_offset
    data = self.dht_client.data
    if (self.type == SENSOR_TEMPERATURE):
        temperature = data[SENSOR_TEMPERATURE]
        _LOGGER.debug('Temperature    %.1f    \\u00b0C    +    offset    %.1f', temperature, temperature_offset)
        if ((temperature >= (-20)) and (temperature < 80)):
            self._state = round((temperature + temperature_offset), 1)
            if (self.temp_unit == TEMP_FAHRENHEIT):
                self._state = round(celsius_to_fahrenheit(temperature), 1)
    elif (self.type == SENSOR_HUMIDITY):
        humidity = data[SENSOR_HUMIDITY]
        _LOGGER.debug('Humidity    %.1f%%    +    offset    %.1f', humidity, humidity_offset)
        if ((humidity >= 0) and (humidity <= 100)):
            self._state = round((humidity + humidity_offset), 1)
