code: def state(self):
          
          if self.is_active:
              if 'NowPlayingItem' in self.session:
                  if self.session['PlayState']['IsPaused']:
                      return STATE_PAUSED
                  else:
                      return STATE_PLAYING
              else:
                  return STATE_IDLE
          else:
              return STATE_OFF
docs: Return current playstate of the device.