code: def encode_packet(packet: dict) -> str:
      
      if packet['protocol'] == 'rfdebug':
          return '10;RFDEBUG=' + packet['command'] + ';'
      elif packet['protocol'] == 'rfudebug':
          return '10;RFDEBUG=' + packet['command'] + ';'
      else:
          return SWITCH_COMMAND_TEMPLATE.format(
              node=PacketHeader.master.value,
              **packet
          )
docs: Construct packet string from packet dictionary.
  
      >>> encode_packet({
      ...     'protocol': 'newkaku',
      ...     'id': '000001',
      ...     'switch': '01',
      ...     'command': 'on',
      ... })
      '10;newkaku;000001;01;on;'