docstr: Wait for server command to get set; return and clear the value and signal.
docstr_tok: ["Wait","for","server","command","to","get","set",";","return","and","clear","the","value","and","signal","."]
code: def wait_for_server_command(
      self, timeout: Optional[float] = None
  ) -> Optional[str]:
      """
      Wait for server command to get set; return and clear the value and signal.
      """
      if self._server_command_signal.wait(timeout):
          self._server_command_signal.clear()
          req = self._server_command
          self._server_command = None
          return req
      return None
  
imports: import datetime
  import logging
  import threading
  import time
  from modules import errors, shared, devices
  from typing import Optional
label_desc: Use image node_id 6 for calling the State obj's underlying member method code with example usage: obj.wait_for_server_command(timeout) and returns: None, req