docs: def GetDeviceIntProperty(dev_ref, key):
    """Reads int property from the HID device."""
    cf_key = CFStr(key)
    type_ref = iokit.IOHIDDeviceGetProperty(dev_ref, cf_key)
    cf.CFRelease(cf_key)
    if not type_ref:
      return None
  
    if cf.CFGetTypeID(type_ref) != cf.CFNumberGetTypeID():
      raise errors.OsHidError('Expected number type, got {}'.format(
          cf.CFGetTypeID(type_ref)))
  
    out = ctypes.c_int32()
    ret = cf.CFNumberGetValue(type_ref, K_CF_NUMBER_SINT32_TYPE,
                              ctypes.byref(out))
    if not ret:
      return None
  
    return out.value