'Get the latest data and updates the states.'

def update(self):

    self.refresh_sabnzbd_data()
    if self.sabnzb_client.queue:
        if (self.type == 'current_status'):
            self._state = self.sabnzb_client.queue.get('status')
        elif (self.type == 'speed'):
            mb_spd = (float(self.sabnzb_client.queue.get('kbpersec')) / 1024)
            self._state = round(mb_spd, 1)
        elif (self.type == 'queue_size'):
            self._state = self.sabnzb_client.queue.get('mb')
        elif (self.type == 'queue_remaining'):
            self._state = self.sabnzb_client.queue.get('mbleft')
        elif (self.type == 'disk_size'):
            self._state = self.sabnzb_client.queue.get('diskspacetotal1')
        elif (self.type == 'disk_free'):
            self._state = self.sabnzb_client.queue.get('diskspace1')
        else:
            self._state = 'Unknown'
