docs: def on_message(self, client, userdata, msg):
          '''
          Callback for when a ``PUBLISH`` message is received from the broker.
          '''
          if msg.topic == 'serial_device/refresh_comports':
              self.refresh_comports()
              return
  
          match = CRE_MANAGER.match(msg.topic)
          if match is None:
              logger.debug('Topic NOT matched: `%s`', msg.topic)
          else:
              logger.debug('Topic matched: `%s`', msg.topic)
              # Message topic matches command.  Handle request.
              command = match.group('command')
              port = match.group('port')
  
              #     serial_device/<port>/send   # Bytes to send
              if command == 'send':
                  self._serial_send(port, msg.payload)
              elif command == 'connect':
                  # serial_device/<port>/connect  # Request connection
                  try:
                      request = json.loads(msg.payload)
                  except ValueError as exception:
                      logger.error('Error decoding "%s (%s)" request: %s',
                                   command, port, exception)
                      return
                  self._serial_connect(port, request)
              elif command == 'close':
                  self._serial_close(port)