'Return the state attributes of the sensor.'

@property
def device_state_attributes(self):

    attributes = {}
    if (self.type == 'upcoming'):
        for show in self.data:
            attributes[show['series']['title']] = 'S{:02d}E{:02d}'.format(show['seasonNumber'], show['episodeNumber'])
    elif (self.type == 'queue'):
        for show in self.data:
            attributes[(show['series']['title'] + '    S{:02d}E{:02d}'.format(show['episode']['seasonNumber'], show['episode']['episodeNumber']))] = '{:.2f}%'.format((100 * (1 - (show['sizeleft'] / show['size']))))
    elif (self.type == 'wanted'):
        for show in self.data:
            attributes[(show['series']['title'] + '    S{:02d}E{:02d}'.format(show['seasonNumber'], show['episodeNumber']))] = show['airDate']
    elif (self.type == 'commands'):
        for command in self.data:
            attributes[command['name']] = command['state']
    elif (self.type == 'diskspace'):
        for data in self.data:
            attributes[data['path']] = '{:.2f}/{:.2f}{}    ({:.2f}%)'.format(to_unit(data['freeSpace'], self._unit), to_unit(data['totalSpace'], self._unit), self._unit, ((to_unit(data['freeSpace'], self._unit) / to_unit(data['totalSpace'], self._unit)) * 100))
    elif (self.type == 'series'):
        for show in self.data:
            attributes[show['title']] = '{}/{}    Episodes'.format(show['episodeFileCount'], show['episodeCount'])
    return attributes
