code: def on_hid_pnp(self, hid_event = None):
          
          # keep old reference for UI updates
          old_device = self.device
  
          if hid_event:
              print("Hey, a hid device just %s!" % hid_event)
  
          if hid_event == "connected":
              # test if our device is available
              if self.device:
                  # see, at this point we could detect multiple devices!
                  # but... we only want just one
                  pass
              else:
                  self.test_for_connection()
          elif hid_event == "disconnected":
              # the hid object is automatically closed on disconnection we just
              # test if still is plugged (important as the object might be
              # closing)
              if self.device and not self.device.is_plugged():
                  self.device = None
                  print("you removed my hid device!")
          else:
              # poll for devices
              self.test_for_connection()
  
          if old_device != self.device:
              # update ui
              pass
docs: This function will be called on per class event changes, so we need
          to test if our device has being connected or is just gone