'Initialize the Plex device.'

def __init__(self, config, device, session, plex_sessions, update_devices, update_sessions):

    from plexapi.utils import NA
    self._app_name = ''
    self._device = None
    self._device_protocol_capabilities = None
    self._is_player_active = False
    self._is_player_available = False
    self._machine_identifier = None
    self._make = ''
    self._media_content_id = None
    self._media_content_rating = None
    self._media_content_type = None
    self._media_duration = None
    self._media_image_url = None
    self._media_title = None
    self._name = None
    self._player_state = 'idle'
    self._previous_volume_level = 1
    self._session = None
    self._session_type = None
    self._session_username = None
    self._state = STATE_IDLE
    self._volume_level = 1
    self._volume_muted = False
    self.na_type = NA
    self.config = config
    self.plex_sessions = plex_sessions
    self.update_devices = update_devices
    self.update_sessions = update_sessions
    self._media_album_artist = None
    self._media_album_name = None
    self._media_artist = None
    self._media_track = None
    self._media_episode = None
    self._media_season = None
    self._media_series_title = None
    self.refresh(device, session)
    if self.config.get(CONF_USE_CUSTOM_ENTITY_IDS):
        prefix = ''
        if config.get('entity_namespace'):
            prefix = (config.get('entity_namespace') + '_')
        if self.machine_identifier:
            self.entity_id = ('%s.%s%s' % ('media_player', prefix, self.machine_identifier.lower().replace('-', '_')))
        elif self.name:
            self.entity_id = ('%s.%s%s' % ('media_player', prefix, self.name.lower().replace('-', '_')))
