code: def _send_command(self, command):
          
          if self.status is None or self.status.media_session_id is None:
              self.logger.warning(
                  "%s command requested but no session is active.",
                  command[MESSAGE_TYPE])
              return
  
          command['mediaSessionId'] = self.status.media_session_id
  
          self.send_message(command, inc_session_id=True)
docs: Send a command to the Chromecast on media channel.