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

def update(self):

    self.owa_client.update()
    data = self.owa_client.data
    fc_data = self.owa_client.fc_data
    if ((data is None) or (fc_data is None)):
        return
    if (self.type == 'weather'):
        self._state = data.get_detailed_status()
    elif (self.type == 'temperature'):
        if (self.temp_unit == TEMP_CELSIUS):
            self._state = round(data.get_temperature('celsius')['temp'], 1)
        elif (self.temp_unit == TEMP_FAHRENHEIT):
            self._state = round(data.get_temperature('fahrenheit')['temp'], 1)
        else:
            self._state = round(data.get_temperature()['temp'], 1)
    elif (self.type == 'wind_speed'):
        self._state = round(data.get_wind()['speed'], 1)
    elif (self.type == 'wind_bearing'):
        self._state = round(data.get_wind()['deg'], 1)
    elif (self.type == 'humidity'):
        self._state = round(data.get_humidity(), 1)
    elif (self.type == 'pressure'):
        self._state = round(data.get_pressure()['press'], 0)
    elif (self.type == 'clouds'):
        self._state = data.get_clouds()
    elif (self.type == 'rain'):
        if data.get_rain():
            self._state = round(data.get_rain()['3h'], 0)
            self._unit_of_measurement = 'mm'
        else:
            self._state = 'not    raining'
            self._unit_of_measurement = ''
    elif (self.type == 'snow'):
        if data.get_snow():
            self._state = round(data.get_snow(), 0)
            self._unit_of_measurement = 'mm'
        else:
            self._state = 'not    snowing'
            self._unit_of_measurement = ''
    elif (self.type == 'forecast'):
        self._state = fc_data.get_weathers()[0].get_status()
