code: def _observe(self, api_command):
          
          path = api_command.path
          duration = api_command.observe_duration
          if duration <= 0:
              raise ValueError("Observation duration has to be greater than 0.")
          url = api_command.url(self._host)
          err_callback = api_command.err_callback
  
          command = (self._base_command('get')
                     + ['-s', str(duration), '-B', str(duration), url])
  
          kwargs = {
              'stdout': subprocess.PIPE,
              'stderr': subprocess.DEVNULL,
              'universal_newlines': True
          }
          try:
              proc = subprocess.Popen(command, **kwargs)
          except subprocess.CalledProcessError as err:
              raise RequestError(
                  'Error executing request: %s'.format(err)) from None
  
          output = ''
          open_obj = 0
          start = time()
  
          for data in iter(lambda: proc.stdout.read(1), ''):
              if data == '\n':
                  _LOGGER.debug('Observing stopped for %s after %.1fs',
                                path, time() - start)
                  err_callback(RequestError("Observing stopped."))
                  break
  
              if data == '{':
                  open_obj += 1
              elif data == '}':
                  open_obj -= 1
  
              output += data
  
              if open_obj == 0:
                  api_command.result = _process_output(output)
                  output = ''
docs: Observe an endpoint.