code: def deserialize_packet_id(packet_id: str) -> dict:
      r
      if packet_id == 'rflink':
          return {'protocol': UNKNOWN}
  
      protocol, *id_switch = packet_id.split(PACKET_ID_SEP)
      assert len(id_switch) < 3
  
      packet_identifiers = {
          # lookup the reverse translation of the protocol in the translation
          # table, fallback to protocol. If this is a unserializable protocol
          # name, it has not been serialized before and is not in the
          # translate_protocols table this will result in an invalid command.
          'protocol': protocol_translations.get(protocol, protocol),
      }
      if id_switch:
          packet_identifiers['id'] = id_switch[0]
      if len(id_switch) > 1:
          packet_identifiers['switch'] = id_switch[1]
  
      return packet_identifiers
docs: r"""Turn a packet id into individual packet components.
  
      >>> deserialize_packet_id('newkaku_000001_01') == {
      ...     'protocol': 'newkaku',
      ...     'id': '000001',
      ...     'switch': '01',
      ... }
      True
      >>> deserialize_packet_id('ikeakoppla_000080_0') == {
      ...     'protocol': 'ikea koppla',
      ...     'id': '000080',
      ...     'switch': '0',
      ... }
      True