docs: def run(self):  # Thread for receiving data from pilight
          """Receiver thread function called on Client.start()."""
          logging.debug('Pilight receiver thread started')
          if not self.callback:
              raise RuntimeError('No callback function set, cancel readout thread')
  
          def handle_messages(messages):
              """Call callback on each receive message."""
              for message in messages:  # Loop over received  messages
                  if message:  # Can be empty due to splitlines
                      message_dict = json.loads(message.decode())
                      if self.recv_codes_only:
                          # Filter: Only use receiver messages
                          if 'receiver' in message_dict['origin']:
                              if self.veto_repeats:
                                  if message_dict.get('repeats', 1) == 1:
                                      self.callback(message_dict)
                              else:
                                  self.callback(message_dict)
                      else:
                          self.callback(message_dict)
  
          while not self._stop_thread.isSet():
              try:  # Read socket in a non blocking call and interpret data
                  # Sometimes more than one JSON object is in the stream thus
                  # split at \n
                  with self._lock:
                      messages = self.receive_socket.recv(1024).splitlines()
                  handle_messages(messages)
              except (socket.timeout, ValueError):  # No data
                  pass
          logging.debug('Pilight receiver thread stopped')