'Get the latest data from Transmission and updates the state.'

def update(self):

    self.refresh_transmission_data()
    if (self.type == 'current_status'):
        if self.transmission_client.session:
            upload = self.transmission_client.session.uploadSpeed
            download = self.transmission_client.session.downloadSpeed
            if ((upload > 0) and (download > 0)):
                self._state = 'Up/Down'
            elif ((upload > 0) and (download == 0)):
                self._state = 'Seeding'
            elif ((upload == 0) and (download > 0)):
                self._state = 'Downloading'
            else:
                self._state = STATE_IDLE
        else:
            self._state = STATE_UNKNOWN
    if self.transmission_client.session:
        if (self.type == 'download_speed'):
            mb_spd = float(self.transmission_client.session.downloadSpeed)
            mb_spd = ((mb_spd / 1024) / 1024)
            self._state = round(mb_spd, (2 if (mb_spd < 0.1) else 1))
        elif (self.type == 'upload_speed'):
            mb_spd = float(self.transmission_client.session.uploadSpeed)
            mb_spd = ((mb_spd / 1024) / 1024)
            self._state = round(mb_spd, (2 if (mb_spd < 0.1) else 1))
